-
-
Notifications
You must be signed in to change notification settings - Fork 6
Architecture
Michael Elliott edited this page Mar 14, 2026
·
2 revisions
┌──────────────────────────────────────────────────────────────────┐
│ CLI (commander.js) │
│ gateway, agent, send, onboard, doctor, model, create-skill, │
│ mcp-server, teams, skills, config, update, mesh, graphiti │
├──────────────────────────────────────────────────────────────────┤
│ Gateway (Express + WS) │
│ HTTP API | WebSocket | SSE Streaming | MC v2 SPA │
├──────────┬──────────┬────────────┬───────────────────────────────┤
│ Channels │ Agent │ Skills │ Memory │
│ 15 │ Router │ ~149 tools │ Graph (entities) │
│ adapters │ Multi- │ Shell │ Learning (patterns) │
│ Discord │ Agent │ Browser │ Briefings (daily) │
│ Telegram │ Planner │ GitHub │ Relationships │
│ Slack │ Autonomy │ Email │ RAG / Vector Search │
│ WhatsApp │ Goals │ Training │ Embeddings (FTS5) │
│ Matrix │ Self- │ Self-Impr │ │
│ Signal │ Initiative│ CAPTCHA │ │
│ Teams │ Autopilot│ X/Twitter │ │
│ G. Chat │ Sessions │ Voice │ │
│ IRC │ Cost Opt │ MCP │ │
│ Mmost │ Context │ ... │ │
│ Lark │ Fallback │ │ │
│ Email │ Chains │ │ │
│ LINE │ │ │ │
│ Zulip │ │ │ │
├──────────┴──────────┼────────────┼───────────────────────────────┤
│ Providers │ Security │ Mesh Network │
│ 34 LLM providers │ Shield │ mDNS + WebSocket │
│ 4 native + 30 compat│ Sandbox │ HMAC auth │
│ Fallback chains │ Vault │ Cross-node routing │
│ Self-heal │ Audit Log │ Peer approval │
└─────────────────────┴────────────┴───────────────────────────────┘
src/
├── agent/ # Core agent: processing, multi-agent, autonomy, planning, goals, self-initiative
├── channels/ # 15 messaging adapters (Discord, Telegram, Slack, WhatsApp, Matrix, Signal, Teams, Google Chat, IRC, Mattermost, Lark/Feishu, Email IMAP, LINE, Zulip, WebChat)
├── providers/ # 34 LLM providers (4 native: Anthropic, OpenAI, Google, Ollama + 30 OpenAI-compatible)
├── skills/ # ~149 tool/skill implementations across 91 skills
│ ├── builtin/ # Core built-in skills
│ └── dev/ # Dev-only skills (env-gated: TITAN_DEV_SKILLS=1)
├── memory/ # Graph memory, learning, briefings, relationships, RAG, embeddings
├── security/ # Prompt shield, sandbox, encrypted vault (AES-256-GCM), audit logging, pairing
├── gateway/ # HTTP/WS/SSE server, Mission Control v2 SPA, slash commands
├── voice/ # LiveKit WebRTC voice, Orpheus TTS, livekitAgent.ts
├── mcp/ # MCP Server mode (JSON-RPC 2.0, stdio + HTTP) and MCP client
├── browsing/ # Shared browser pool (Playwright), CapSolver CAPTCHA solving
├── training/ # Local model fine-tuning (LoRA via unsloth → GGUF → Ollama), dual pipelines
├── self-improvement/# LLM-as-judge eval, autoresearch, self-improvement system
├── mesh/ # Peer-to-peer networking (mDNS, WebSocket, HMAC auth)
├── recipes/ # Multi-step workflow recipes
├── config/ # Zod schema, config loading
├── cli/ # CLI commands (gateway, agent, create-skill, mcp-server, teams, doctor, etc.)
├── context/ # ContextEngine plugin system
├── metrics/ # Prometheus metrics
└── utils/ # Constants, helpers, logger, updater
- Inbound Message arrives via any of the 15 channel adapters or the HTTP API
- Slash Command Check — native commands or recipe commands
- Multi-Agent Router selects the appropriate agent (with fallback chains)
- Agent Processing — builds context (ContextEngine plugins), calls LLM, executes tools
- Tool Execution — autonomy check, sandbox enforcement, execute, return result
- Streaming — response streamed via SSE or WebSocket to the client
- Response — sent back through the originating channel
- Memory — conversation stored, graph updated, patterns learned, RAG indexed
- Self-Improvement — periodic LLM-as-judge evaluation, autoresearch for knowledge gaps
-
Zero native dependencies — All optional deps in
optionalDependencies - Pure ESM — Full ES module architecture with TypeScript strict mode
-
Dynamic imports — Optional features use
await import()to avoid crash-on-missing - JSON file storage — No database server required (SQLite FTS5 for RAG)
-
Event-driven channels — All channels extend
ChannelAdapterand emit events - Provider normalization — Unified interface with automatic routing and fallback chains
- ContextEngine plugins — Modular context injection before each LLM call
- MCP interop — Both server (expose tools) and client (consume external tools) via JSON-RPC 2.0