Architecture
Platform Architecture
How goClaw's six pillars fit together — from agent runtime to multi-channel delivery.
goClaw is built from six interlocking components. Each pillar can be used independently, but they're designed to reinforce each other. The result is a platform where every interaction makes the agent smarter.
System diagram
How a request flows through the platform
- Inbound message arrives — Email, SMS, Telegram, or WhatsApp
- Channel listener normalizes the raw message to a standard format
- CRM lookup — find or create a contact record, attach the message to their thread
- Agent is invoked with full context: message, thread history, contact details, agent persona, relevant knowledge
- Agent reasons using Claude (Sonnet for primary reasoning, Haiku for classification)
- Agent uses MCP tools as needed: knowledge search, CRM operations, web research
- Agent generates response and dispatches through the appropriate channel
- CRM updated — response logged, follow-up scheduled if needed
- Curiosity items filed if the agent encountered any knowledge gaps
Tech stack
| Layer | Technology |
|---|---|
| Runtime | Node.js 22+, pnpm monorepo |
| Primary LLM | Anthropic Claude (Sonnet + Haiku + Opus) |
| Research LLM | OpenAI GPT-4o-mini (web search synthesis) |
| Database | SQLite (CRM, FTS5 knowledge index, task scheduler, curiosity queue) |
| Admin UI | Next.js 15 |
| Deployment | Docker (local) or EC2 + Vercel (cloud) |
| Resend (outbound) + IMAP (inbound) | |
| SMS | Twilio |
| Twilio + Meta | |
| Telegram | Grammy |
Package structure
goClaw is a pnpm monorepo. Each pillar is a separate package:
| Package | Purpose |
|---|---|
@clawrm/core | Agent orchestration, task scheduling, container runtime |
@clawrm/crm | Contact management, threads, MCP tool integration |
@clawrm/channels | Multi-channel messaging (pluggable interface) |
@clawrm/knowledge | Knowledge base, research pipeline, curiosity queue, FTS5 |
@clawrm/admin | Next.js admin dashboard |
@clawrm/cli | Setup wizard and deployment CLI |
@clawrm/shared | Shared types and utilities |
See Package Reference for full API documentation.
Data storage
goClaw uses SQLite exclusively — no external databases required.
| Database file | Contents |
|---|---|
data/crm.db | Contacts, threads, messages, notes, tags |
data/knowledge.db | Knowledge file index with FTS5 full-text search |
data/tasks.db | Task scheduler queue (scheduled follow-ups, research runs) |
data/curiosity.db | Curiosity item queue and research history |
data/billing.db | Tenant billing state, usage snapshots |
SQLite WAL mode is enabled for all databases. Backups run nightly to S3 or local disk depending on configuration.
Scalability model
goClaw is designed for single-tenant or small multi-tenant deployments on modest infrastructure:
- 1–3 agents, light usage: t3.small EC2 (2 vCPU, 2GB RAM)
- 3–10 agents, medium usage: t3.medium (2 vCPU, 4GB RAM)
- 10+ agents or heavy usage: t3.large or horizontal scaling with dedicated instances per high-load tenant
The SQLite architecture means vertical scaling (more RAM/CPU) is the natural path. Horizontal distribution would require migrating to PostgreSQL — a planned option on the roadmap but not in scope for v1.
