Architecture
Think in layers:
- Channels bring messages in.
- The Gateway routes and manages sessions.
- The Agent executes via tools and memory.
- Providers run models.
The minimal data flow
- A message arrives (DM, group, webhook, or Control UI).
- The Gateway normalizes it and picks a session key.
- The Agent runs an agent turn (tool calls + model calls).
- Output streams back to the originating surface (Control UI / channel).
In practice, this means:
- “Messaging” is just an ingress surface.
- The Gateway is the long-lived process that owns state and routing.
- The model is a dependency behind a provider, not the system.
Where state lives (so you can debug)
- Config:
~/.openclaw/openclaw.json - Workspace (skills, memory, prompts):
~/.openclaw/workspace - Sessions: under
~/.openclaw/agents/<agentId>/sessions/ - Logs: typically under
/tmp/openclaw/(see gateway logging docs)
Next links
- Verify a working baseline: Getting Started
- Concepts: Gateway, Sessions, Tools