Lightweight self-hosted AI agent. Open-source OpenClaw alternative in Go.
Lightweight self-hosted AI agent. Open-source OpenClaw alternative in Go.
A lightweight, extensible, and secure open-source AI agent that lives on your server. It runs shell commands, edits files, browses the web, manages persistent memory, and schedules tasks — a self-hosted alternative to OpenClaw (Claude Code) in ~9,000 lines of core Go.
docker run commandAdapter, Channel, Tool) make it trivial to add providers, transports, or custom toolsTELEGRAM_BOT_TOKEN by creating a new bot via @BotFather on Telegram.TELEGRAM_OWNER_ID (your personal Telegram user ID) using a bot like @userinfobot. This is critical for security — it ensures only you can communicate with your agent.No git clone needed — the image is published on Docker Hub:
docker run -d --restart unless-stopped \
--name gogogot \
-e TELEGRAM_BOT_TOKEN=... \
-e TELEGRAM_OWNER_ID=... \
-e GOGOGOT_PROVIDER=anthropic \
-e ANTHROPIC_API_KEY=... \
-e GOGOGOT_MODEL=claude-sonnet-4-6 \
-v ./data:/data \
-v ./work:/work \
octagonlab/gogogot:latestThe image supports linux/amd64 and linux/arm64 and ships with a full Ubuntu environment (bash, git, Python, Node.js, ripgrep, sqlite, postgresql-client, and more).
Alternative: Docker Compose
curl -O https://raw.githubusercontent.com/aspasskiy/GoGogot/main/deploy/docker-compose.yml
# Create .env with your keys
cat > .env
Local development (without Docker)
Requires Go 1.25+:
```bash
make generate # fetch OpenRouter model catalog
go run ./cmd/gogogot
…
go
func (a *Agent) Run(ctx context.Context, input []ContentBlock) error {
a.messages = append(a.messages, userMessage(input))
for {
resp, err := a.llm.Call(ctx, a.messages, a.tools)
if err != nil {
return err
}
a.messages = append(a.messages, resp)
if len(resp.ToolCalls) == 0 {
break
}
results := a.executeTools(resp.ToolCalls)
a.messages = append(a.messages, results)
}
return nil
}Everything else — memory, scheduling, compaction, identity — is just tools the LLM can call inside this loop.
GoGogot is designed to be extended without frameworks or plugin registries:
Adapter interface)Channel + Replier — 3 + 5 methods)llm/catalog/MIT
No open issues yet, or sync has not completed.