High-Level Architecture
OpenClaw has four main components:
Channels (Discord, Telegram, etc.)
↕
Gateway (message routing)
↕
Sessions (conversation state)
↕
Tools (actions: files, web, exec)The Gateway
The gateway is the central daemon. It: - Manages connections to messaging platforms - Routes inbound messages to the right session - Handles heartbeats and cron jobs - Serves the web interface
openclaw gateway start # Start
openclaw gateway stop # Stop
openclaw gateway status # Check healthSessions
Each conversation lives in a session:
- Main session — direct chat with the user
- Sub-agent sessions — spawned for isolated tasks
- Channel sessions — per-channel in group chats
Sessions maintain their own message history and can spawn child sessions for parallel work.
Learn this topic with guided video lessons
Go beyond reading — follow expert video guidance and try the examples in your own environment.
Browse Courses →The Tool System
OpenClaw provides tools that the LLM can invoke:
File Operations
read— read file contents (text and images)write— create or overwrite filesedit— surgical find-and-replace edits
System
exec— execute shell commandsprocess— manage background processes
Web
web_search— search via Brave APIweb_fetch— fetch and extract page contentbrowser— full browser automation
Communication
message— send messages across channelstts— text-to-speechnodes— control paired devices
Agent Orchestration
sessions_spawn— create sub-agentssessions_send— cross-session messagingsubagents— manage running sub-agents
Memory Layer
Memory is file-based, stored in the workspace:
workspace/
├── SOUL.md # Agent personality
├── USER.md # User profile
├── AGENTS.md # Operating rules
├── MEMORY.md # Long-term memory
├── HEARTBEAT.md # Periodic check config
└── memory/
├── 2026-02-15.md # Daily notes
└── heartbeat-state.jsonChannel Providers
Each messaging platform has a provider that: - Authenticates with the platform API - Receives and sends messages - Handles platform-specific features (reactions, threads, media)
Supported: Discord, Telegram, WhatsApp, Signal, Slack, IRC, Google Chat, iMessage.
Get weekly IT automation tips
Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.
Subscribe Free →Skills System
Skills extend agent capabilities:
skills/
├── weather/
│ └── SKILL.md
├── discord/
│ └── SKILL.md
└── healthcheck/
└── SKILL.mdThe agent reads SKILL.md when a task matches the skill's description.
Request Flow
- User sends message on Discord
- Discord provider receives it
- Gateway routes to the correct session
- Session adds message to context
- LLM generates response (may invoke tools)
- Tools execute and return results
- LLM formulates final response
- Response sent back via Discord provider
---
Ready to go deeper? Check out our hands-on course: OpenClaw Agent — practical exercises you can follow along on your own machine.
Further reading
To go deeper, agentic Ansible automation with OpenClaw expands on these patterns in production.
Ready to learn by doing?
Stop reading tutorials — start building. Expert video courses with practical examples you can follow at your own pace.
Related Articles
Understanding OpenClaw's Memory System
Learn how OpenClaw agents maintain memory across sessions using file-based persistence — daily notes, MEMORY.md, and workspace context.
OpenClaw Volume Permissions Fix
Fix OpenClaw Docker volume permission errors. Resolve EACCES issues for named volumes and bind mounts with troubleshooting steps.
Troubleshoot OpenClaw Gateway Errors
Fix OpenClaw gateway errors: 401 unauthorized, connection refused, origin not allowed, and WebSocket failures with resolution guides.
OpenClaw Browser Automation
Use OpenClaw's browser tool for web automation — scraping, testing, form filling, and monitoring. No Selenium or Puppeteer setup needed.
OpenClaw Reverse Proxy with Caddy
Set up HTTPS for OpenClaw using Caddy reverse proxy. Automatic TLS certificates, WebSocket support, and production config.
OpenClaw Cron Jobs: Scheduled AI Tasks
Schedule recurring tasks with OpenClaw cron — from daily summaries to weekly reports. Complete setup guide with practical examples.
Explore topics
Browse more articles on the topics covered here.