nextlevelbuilder / goclaw
Multi-agent AI gateway with teams, delegation & orchestration. Single Go binary, 11+ LLM providers, 5 channels.
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing nextlevelbuilder/goclaw in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewGoClaw **GoClaw** is a multi-agent AI gateway that connects LLMs to your tools, channels, and data — deployed as a single Go binary with zero runtime dependencies. It orchestrates agent teams and inter-agent delegation across 13+ LLM providers with full multi-tenant isolation. A Go port of OpenClaw with enhanced security, multi-tenant PostgreSQL, and production-grade observability. What Makes It Different • **Agent Teams & Orchestration** — Teams with shared task boards, inter-agent delegation (sync/async), and hybrid agent discovery • **Multi-Tenant PostgreSQL** — Per-user workspaces, per-user context files, encrypted API keys (AES-256-GCM), isolated sessions — the only Claw project with DB-native multi-tenancy • **Single Binary** — ~25 MB static Go binary, no Node.js runtime, 1 GB | 5 s | **GoClaw unique strengths:** Only project with multi-tenant PostgreSQL, agent teams, hooks system, knowledge graph, and MCP protocol support. Architecture Multi-Agent Orchestration GoClaw supports four orchestration patterns for agent collaboration, all managed through explicit permission links. Agent Delegation Agent delegation enables named agents to delegate tasks to other agents — each running with its own identity, tools, LLM provider, and context files. Unlike subagents (anonymous clones of the parent), delegation targets are fully independent agents. | Mode | How it works | Best for | |------|-------------|----------| | **Sync** | Agent A asks Agent B and **waits** for the answer | Quick lookups, fact checks | | **Async** | Agent A asks Agent B and **moves on**. B announces the result later | Long tasks, reports, deep analysis | **Permission Links** — Agents communicate through explicit **agent links** with access control: | Direction | Meaning | |-----------|---------| | | Source can delegate TO target | | | Target can delegate TO source | | | Both agents can delegate to each other | **Concurrency Control** — Two layers prevent any agent from being overwhelmed: | Layer | Config | Example | |-------|--------|---------| | **Per-link** | | support → research: max 3 | | **Per-agent** | | research-bot: max 5 total | **Per-User Restrictions** — The JSONB on agent links supports per-user deny/allow lists. **Agent Discovery** — Each agent has a field for discovery. With ≤15 targets, auto-generated is injected into context. Delegation uses subagent spawning for larger target sets. Delegation vs Subagents | Aspect | Subagents | Agent Delegation | |--------|-----------|-----------------| | Target | Anonymous clone of parent | Named agent with own identity | | Provider/Model | Inherited from parent | Target's own configuration | | Tools | Parent's tools minus deny list | Target's own tool registry + policy | | Context files | Simplified system prompt | Target's own SOUL.md, IDENTITY.md, etc. | | Session | Shared with parent | Isolated (fresh per delegation) | | Permission | Depth-based limits only | Explicit with direction | | User control | None | Per-user deny/allow via settings JSONB | | Concurrency | Global + per-parent limits | Per-link + per-target-agent limits | Agent Teams Teams enable coordinated multi-agent workflows with a shared task board and peer-to-peer messaging. • **Team roles** — Lead agent orchestrates work, member agents execute tasks • **Shared task board** — Create, claim, complete, search tasks with dependencies. Atomic claiming prevents double-assignment • **Team mailbox** — Direct peer-to-peer messaging (send, broadcast, read unread) • **Tools**: for task management, for mailbox Features LLM Providers • **13+ providers** — OpenRouter, Anthropic, OpenAI, Groq, DeepSeek, Gemini, Mistral, xAI, MiniMax, Cohere, Perplexity, DashScope (Qwen), Bailian Coding, and any OpenAI-compatible endpoint • **Anthropic native** — Direct HTTP+SSE integration with prompt caching ( ) for ~90% cost reduction on repeated prefixes. Also supports Claude CLI mode (stdio + MCP bridge with session management) • **OpenAI-compatible** — Automatic prompt caching for OpenAI, MiniMax, OpenRouter (cache metrics tracked in traces). Also supports Codex mode (gpt-5.3-codex via OAuth with "phase" metadata) • **Extended thinking** — Per-provider thinking mode: Anthropic (budget tokens), OpenAI-compat (reasoning effort), DashScope (thinking budget) with streaming support Agent Orchestration • **Agent loop** — Think-act-observe cycle with tool use, session history, and auto-summarization • **Subagents** — Spawn child agents with different models for parallel task execution • **Agent delegation** — Sync/async inter-agent task delegation with permission links, concurrency limits, and per-user restrictions • **Agent teams** — Shared task boards with dependencies, team mailbox, and coordinated multi-agent workflows • **Delegation history** — Queryable audit trail of all inter-agent delegations • **Concurrent execution** — Lane-based scheduler (main/subagent/delegate/cron), adaptive throttle for group chats Tools & Integrations • **60+ built-in tools** — File system, shell exec, web search/fetch, memory, browser automation, TTS, and more • **MCP integration** — Connect external MCP servers via stdio, SSE, or streamable-http with per-agent/per-user grants • **Hooks system** — Event-driven hooks with command evaluators (shell exit code) and agent evaluators (delegate to reviewer) for output validation Messaging Channels • **Telegram** — Full integration with streaming, rich formatting (HTML, tables, code blocks), reactions, media, forum topics (per-topic config and session isolation), speech-to-text, bot commands, group file writer restrictions • **Slack** — Channel integration with bot commands • **Feishu/Lark** — Streaming card updates, media attachments (images/files), mention resolution, topic session mode • **Zalo OA** — Official Account integration for DM conversations • **Zalo Personal** — Unofficial reverse-engineered protocol supporting DM + group messages with restrictive default policies • **D…