goclaw

GoClaw is a multi-tenant AI agent platform that integrates with over 20 LLM providers and supports multiple messaging channels.

<p align="center"> <img src="_statics/goclaw-logo.svg" alt="GoClaw" height="200" /> </p> <p align="center"><strong>Multi-Tenant AI Agent Platform</strong></p> <p align="center"> Multi-agent AI gateway built in Go. 20+ LLM providers. 7 channels. Multi-tenant PostgreSQL.<br/> Single binary. Production-tested. Agents that orchestrate for you. </p> <p align="center"> <a href="https://docs.goclaw.sh">Documentation</a> • <a href="https://docs.goclaw.sh/#quick-start">Quick Start</a> • <a href="https://x.com/nlb_io">Twitter / X</a> </p> <p align="center"> <a href="https://go.dev/"><img src="https://img.shields.io/badge/Go_1.26-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go" /></a> <a href="https://www.postgresql.org/"><img src="https://img.shields.io/badge/PostgreSQL_18-316192?style=flat-square&logo=postgresql&logoColor=white" alt="PostgreSQL" /></a> <a href="https://www.docker.com/"><img src="https://img.shields.io/badge/Docker-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker" /></a> <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket"><img src="https://img.shields.io/badge/WebSocket-010101?style=flat-square&logo=socket.io&logoColor=white" alt="WebSocket" /></a> <a href="https://opentelemetry.io/"><img src="https://img.shields.io/badge/OpenTelemetry-000000?style=flat-square&logo=opentelemetry&logoColor=white" alt="OpenTelemetry" /></a> <a href="https://www.anthropic.com/"><img src="https://img.shields.io/badge/Anthropic-191919?style=flat-square&logo=anthropic&logoColor=white" alt="Anthropic" /></a> <a href="https://openai.com/"><img src="https://img.shields.io/badge/OpenAI_Compatible-412991?style=flat-square&logo=openai&logoColor=white" alt="OpenAI" /></a> <img src="https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey?style=flat-square" alt="License: CC BY-NC 4.0" /> </p>

🌐 Languages: 🇨🇳 简体中文 · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇻🇳 Tiếng Việt · 🇵🇭 Tagalog · 🇪🇸 Español · 🇧🇷 Português · 🇮🇹 Italiano · 🇩🇪 Deutsch · 🇫🇷 Français · 🇸🇦 العربية · 🇮🇳 हिन्दी · 🇷🇺 Русский · 🇧🇩 বাংলা · 🇮🇱 עברית · 🇵🇱 Polski · 🇨🇿 Čeština · 🇳🇱 Nederlands · 🇹🇷 Türkçe · 🇺🇦 Українська · 🇮🇩 Bahasa Indonesia · 🇹🇭 ไทย · 🇵🇰 اردو · 🇷🇴 Română · 🇸🇪 Svenska · 🇬🇷 Ελληνικά · 🇭🇺 Magyar · 🇫🇮 Suomi · 🇩🇰 Dansk · 🇳🇴 Norsk

Core Features

  • 8-Stage Agent Pipeline — context → history → prompt → think → act → observe → memory → summarize. Pluggable stages, always-on execution
  • 4-Mode Prompt System — Full / Task / Minimal / None with section gating, cache boundary optimization, and per-session mode resolution
  • 3-Tier Memory — Working (conversation) → Episodic (session summaries) → Semantic (knowledge graph). Progressive loading L0/L1/L2
  • Knowledge Vault — Document registry with [[wikilinks]], hybrid search (FTS + pgvector), filesystem sync
  • Agent Teams & Orchestration — Shared task boards, inter-agent delegation (sync/async), 3 orchestration modes (auto/explicit/manual)
  • Self-Evolution — Metrics → suggestions → auto-adapt with guardrails. Agents refine their own communication style
  • Multi-Tenant PostgreSQL — Per-user workspaces, per-user context files, encrypted API keys (AES-256-GCM), RBAC, isolated sessions
  • 20+ LLM Providers — Anthropic (native HTTP+SSE with prompt caching), OpenAI, OpenRouter, Groq, DeepSeek, Gemini, Mistral, xAI, MiniMax, DashScope, Claude CLI, Codex, ACP, and any OpenAI-compatible endpoint
  • 7 Messaging Channels — Telegram, Discord, Slack, Zalo OA, Zalo Personal, Feishu/Lark, WhatsApp
  • Production Security — 5-layer permission system, rate limiting, prompt injection detection, SSRF protection, AES-256-GCM encryption
  • Single Binary — ~25 MB static Go binary, no Node.js runtime, <1s startup, runs on a $5 VPS
  • Observability — Built-in LLM call tracing with spans and prompt cache metrics, optional OpenTelemetry OTLP export

Desktop Edition (GoClaw Lite)

A native desktop app for local AI agents — no Docker, no PostgreSQL, no infrastructure.

macOS:

curl -fsSL https://raw.githubusercontent.com/nextlevelbuilder/goclaw/main/scripts/install-lite.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/nextlevelbuilder/goclaw/main/scripts/install-lite.ps1 | iex

What's Included

  • Single native app (Wails v2 + React), ~30 MB
  • SQLite database (zero setup)
  • Chat with agents (streaming, tools, media, file attachments)
  • Agent management (max 5), provider config, MCP servers, skills, cron
  • Team tasks with Kanban board and real-time updates
  • Auto-update from GitHub Releases

Lite vs Standard

FeatureLite (Desktop)Standard (Server)
AgentsMax 5Unlimited
TeamsMax 1 (5 members)Unlimited
DatabaseSQLite (local)PostgreSQL
MemoryFTS5 text searchpgvector semantic
ChannelsTelegram, Discord, Slack, Zalo, Feishu, WhatsApp
Knowledge GraphFull
RBAC / Multi-tenantFull
Auto-updateGitHub ReleasesDocker / binary

Building from Source

# Prerequisites: Go 1.26+, pnpm, Wails CLI (go install github.com/wailsapp/wails/v2/cmd/wails@latest)
make desktop-build                    # Build .app (macOS) or .exe (Windows)
make desktop-dmg VERSION=0.1.0        # Create .dmg installer (macOS only)
make desktop-dev                      # Dev mode with hot reload

Desktop Releases

Desktop uses independent versioning with lite-v* tags:

git tag lite-v0.1.0 && git push origin lite-v0.1.0
# → GitHub Actions builds macOS (.dmg + .tar.gz) + Windows (.zip)
# → Creates GitHub Release with all assets

Architecture

<p align="center"> <img src="_statics/Multi-Tenant Architecture.jpg" alt="Multi-Tenant Architecture" width="800" /> </p> <p align="center"> <img src="_statics/3-Tier Memory Architecture.jpg" alt="3-Tier Memory" width="800" /> </p> <p align="center"> <img src="_statics/8-Stage Agent Pipeline.jpg" alt="8-Stage Agent Pipeline" width="800" /> </p> <p align="center"> <img src="_statics/Mode Prompt System.jpg" alt="4-Mode Prompt System" width="800" /> </p>

Quick Start

Prerequisites: Go 1.26+, PostgreSQL 18 with pgvector, Docker (optional)

From Source

git clone -b main https://github.com/nextlevelbuilder/goclaw.git && cd goclaw
make build
./goclaw onboard        # Interactive setup wizard
source .env.local && ./goclaw

Note: The default branch is dev (active development). Use -b main to clone the stable release branch.

With Docker

# Generate .env with auto-generated secrets
chmod +x prepare-env.sh && ./prepare-env.sh

# Add at least one GOCLAW_*_API_KEY to .env, then:
make up

# Web Dashboard at http://localhost:18790 (built-in)
# Health check: curl http://localhost:18790/health

# Optional: separate nginx for custom SSL/reverse proxy
# make up WITH_WEB_NGINX=1  → Dashboard at http://localhost:3000

make up creates a Docker network, embeds the correct version from git tags, builds and starts all services, and runs database migrations automatically.

Common commands:

make up                # Start all services (build + migrate)
make down              # Stop all services
make logs              # Tail logs (goclaw service)
make reset             # Wipe volumes and rebuild from scratch

Optional services — enable with WITH_* flags:

FlagServiceWhat it does
WITH_BROWSER=1Headless ChromeEnables browser tool for web scraping, screenshots, automation
WITH_OTEL=1JaegerOpenTelemetry tracing UI for debugging LLM calls and latency
WITH_SANDBOX=1Docker sandboxIsolated container for running untrusted code from agents
WITH_TAILSCALE=1TailscaleExpose gateway over Tailscale private network
WITH_REDIS=1RedisRedis-backed caching layer

Flags can be combined and work with all commands:

# Start with browser automation and tracing
make up WITH_BROWSER=1 WITH_OTEL=1

# Stop everything including optional services
make down WITH_BROWSER=1 WITH_OTEL=1

When GOCLAW_*_API_KEY environment variables are set, the gateway auto-onboards without interactive prompts — detects provider, runs migrations, and seeds default data.

Docker image variants:

ImageDescription
latestBackend + embedded web UI + Python (recommended)
latest-baseBackend API-only, no web UI, no runtimes
latest-fullAll runtimes + skill dependencies pre-installed
latest-otelLatest + OpenTelemetry tracing
goclaw-webStandalone nginx + React SPA (for custom reverse proxy)

For custom builds (Tailscale, Redis): docker build --build-arg ENABLE_TSNET=true ... See the Deployment Guide for details.

Updating

Docker

docker compose pull && docker compose up -d

Binary (with embedded web UI)

goclaw update --apply    # Downloads, verifies SHA256, swaps binary, restarts

Web Dashboard

Open About dialog → click Update Now (admin only). The update includes both backend and web dashboard when using the default latest image.

Multi-Agent Orchestration

<p align="center"> <img src="_statics/Agent Orchestration.jpg" alt="Agent Orchestration" width="800" /> </p>

Each agent runs with its own identity, tools, LLM provider, and context files. Three delegation modes — sync (wait), async (fire-and-forget), bidirectional — connected through explicit permission links with concurrency limits.

Details: Agent Teams docs

Knowledge Vault

<p align="center"> <img src="_statics/Knowledge Vault.jpg" alt="Knowledge Vault" width="800" /> </p>

Document registry with [[wikilinks]] for bidirectional linking. Hybrid search combines full-text (BM25) and semantic (pgvector) for precise retrieval. Filesystem sync keeps vault in sync with on-disk files.

Self-Evolution

<p align="center"> <img src="_statics/Self-Evolution System.jpg" alt="Self-Evolution" width="800" /> </p>

Agents improve themselves through a 3-stage guardrailed pipeline: metrics collection → suggestion analysis → auto-adaptation. Can refine communication style and domain expertise (CAPABILITIES.md) — but never change identity, name, or core purpose.

Provider Adapters

<p align="center"> <img src="_statics/Provider Adapter System.jpg" alt="Provider Adapters" width="800" /> </p>

20+ LLM providers unified through a single adapter interface. Capability-based routing, encrypted API keys (AES-256-GCM), extended thinking support per-provider, and prompt caching for Anthropic + OpenAI.

Event-Driven Architecture

<p align="center"> <img src="_statics/DomainEventBus.jpg" alt="DomainEventBus" width="800" /> </p>

Typed domain events power the consolidation pipeline — session summaries, knowledge graph extraction, and dreaming promotion all run asynchronously via worker pools with dedup and retry.

Built-in Tools

30+ tools across 8 categories:

CategoryToolsDescription
Filesystemread_file, write_file, edit_file, list_files, search, globFile operations with virtual FS routing
Runtimeexec, browserShell commands (approval workflow) + browser automation
Webweb_search, web_fetchSearch (Brave, DuckDuckGo) + content extraction
Memorymemory_search, memory_get, knowledge_graph_search3-tier memory + KG traversal
Mediacreate_image, create_audio, create_video, read_*, ttsGeneration + analysis (multi-provider)
Skillsskill_search, use_skill, skill_manageBM25 + semantic hybrid search
Teamsteam_tasks, spawn, delegate, messageTask board + orchestration + messaging
Automationcron, heartbeat, sessions_*Scheduling + session management

Full tool reference at docs.goclaw.sh

Documentation

Full documentation at docs.goclaw.sh — or browse the source in goclaw-docs/

SectionTopics
Getting StartedInstallation, Quick Start, Configuration, Web Dashboard Tour
Core ConceptsAgent Loop, Sessions, Tools, Memory, Multi-Tenancy
AgentsCreating Agents, Context Files, Personality, Sharing & Access
ProvidersAnthropic, OpenAI, OpenRouter, Gemini, DeepSeek, +15 more
ChannelsTelegram, Discord, Slack, Feishu, Zalo, WhatsApp, WebSocket
Agent TeamsTeams, Task Board, Messaging, Delegation & Handoff
AdvancedCustom Tools, MCP, Skills, Cron, Sandbox, Hooks, RBAC
DeploymentDocker Compose, Database, Security, Observability, Tailscale
ReferenceCLI Commands, REST API, WebSocket Protocol, Environment Variables

Testing

go test ./...                                    # Unit tests
go test -v ./tests/integration/ -timeout 120s    # Integration tests (requires running gateway)

Project Status

See CHANGELOG.md for detailed feature status including what's been tested in production and what's still in progress.

Acknowledgments

GoClaw was originally inspired by the OpenClaw project architecture.

License

CC BY-NC 4.0 — Creative Commons Attribution-NonCommercial 4.0 International

Star History

<a href="https://www.star-history.com/?repos=nextlevelbuilder%2Fgoclaw&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=nextlevelbuilder/goclaw&type=date&theme=dark&legend=top-left" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=nextlevelbuilder/goclaw&type=date&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/image?repos=nextlevelbuilder/goclaw&type=date&legend=top-left" /> </picture> </a>