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.
Master this topic with hands-on labs
Go beyond reading ā build real projects in sandboxed environments with expert video guidance.
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 hands-on labs in real sandboxed environments.
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.