Chuyển đến nội dung chính

Building AI Agent Platform from Zero — Real battle with xClaw

A hands-on series on building a complete AI Agent Platform using TypeScript — from monorepo design, LLM Router, Tool Registry, RAG Pipeline, Workflow Engine, Multi-tenant RBAC to deploying Docker production. Learn through the actual source code of xClaw — an open-source platform running in production.

Introducing the Series

Building an AI Agent Platform from Zero is a practical series that helps you understand and build a complete AI Agent Platform yourself — not a simple chatbot, but an enterprise-level platform with multi-LLM, RAG, workflow automation, multi-tenant RBAC, plugin system and more.

The entire series is based on the actual source code of xClaw — open-source AI Agent Platform running in production, written in TypeScript.

🎯 Goal: Once completed, you can build your own AI Agent Platform — or contribute to xClaw.

What will you learn?

Part 1: Monorepo Architecture & Platform

  • Lesson 1: Architecture overview — why do we need platform, dual-database design
  • Lesson 2: Setup TypeScript monorepo with npm workspaces and project references
  • Lesson 3: Dual-database — PostgreSQL (Drizzle ORM) + MongoDB + Redis
  • Lesson 4: API Gateway with Hono — routes, middleware, JWT auth, OAuth2

Part 2: LLM Engine & Agent Core

  • Lesson 5: LLM Router — Adapter Pattern for 10 LLM providers with fallback chains
  • Lesson 6: Tool Registry — register, manage and execute tools
  • Lesson 7: Agent class — complete tool-calling loop, memory, RAG context
  • Lesson 8: Streaming responses — AsyncGenerator, EventBus, Server-Sent Events

Part 3: RAG Pipeline & Knowledge Base

  • Lesson 9: Document Processor — chunking strategies, metadata extraction
  • Lesson 10: Embedding & Vector Store — cosine similarity, batch processing
  • Lesson 11: RAG Engine — retrieval, reranking, collections, web crawler

Part 4: Workflow Engine & Automation

  • Lesson 12: Workflow Engine — 16 node types, handler pattern, edge traversal
  • Lesson 13: Validation, execution, sandboxed code, template resolution

Part 5: Skills, Domains & Plugin System

  • Lesson 14: Skill System — defineSkill, SkillManager, RL-based selection
  • Lesson 15: Domain Packs — 13 areas, domain-specific prompts & tools
  • Lesson 16: Plugin architecture, MCP Protocol, Skill Hub marketplace

Part 6: Multi-tenant, RBAC & Channels

  • Lesson 17: Multi-tenant RBAC — roles, permissions, tenant isolation
  • Lesson 18: Chat Channels — Telegram, Discord, Slack, Zalo, WebChat

Part 7: Frontend, Monitoring & Production

  • Lesson 19: React frontend — Chat UI, Workflow Builder, Dashboard
  • Lesson 20: Monitoring, audit logs, Docker deploy, Nginx SSL

Request

  • Basic TypeScript/JavaScript (ES2022+, async/await, generators)
  • Node.js ≥ 20
  • Docker & Docker Compose
  • Basic understanding of REST API, SQL, NoSQL
  • Have used ChatGPT or Claude API (good to have, not required)

Source Code

Full source code reference:

git clone --recurse-submodules https://github.com/xdev-asia-labs/xClaw.git
cd xClaw
cp .env.example .env
docker compose up --build

GitHub: github.com/xdev-asia-labs/xClaw License: MIT