Introducing

OpenClaw

An agent framework that connects LLMs to the real world. Give AI a persistent identity, memory, and the ability to actually do things.

Explore Architecture How It Works

Core Architecture

The Gateway

A long-running daemon that orchestrates everything. It maintains connections to messaging platforms, routes messages to agents, and manages sessions.

GATEWAY Telegram WhatsApp Discord Signal Message Router Agent Runner (LLM + System Prompt) Tools, Skills Workspace ~/.openclaw/workspace SOUL.md, memory

Multi-Channel Presence

Connect to Telegram, WhatsApp, Discord, Signal, Matrix, and more. Same agent, consistent personality across all platforms.

Session Management

Maintains context within sessions. When context grows too large, it's compacted (summarized) to fit within the model's window.

Identity & Memory

The Workspace

Unlike stateless chatbots, OpenClaw agents have a workspace - a folder of Markdown files that define who they are and what they remember.

~/.openclaw/workspace SOUL.md "Who am I?" AGENTS.md "How should I behave?" USER.md Name, timezone, preferences IDENTITY.md Agent name, emoji, vibe MEMORY.md Long-term memory memory/2026-02-04.md Daily log Injected at session start System Prompt Base Instructions Tool Definitions Workspace Files (SOUL, AGENTS, USER...) Skills List Runtime Info Agent writes to persist

Key Insight

The LLM has no persistent memory on its own. These files are the memory. If the agent wants to remember something, it writes to disk. Next session, it reads the file and "remembers."

Step by Step

Message Flow

Follow a message from arrival to response. Click through each step to see how OpenClaw processes requests.

Message Arrives 1 Gateway Routes 2 Prompt Assembled 3 LLM Generates 4 Tools Execute 5 Response Delivered 6 State Persisted 7 Telegram, WhatsApp, etc. Message arrives through connected channel

Event-Driven

Hooks System

Hooks let you run code when things happen in OpenClaw. They're TypeScript functions triggered by events.

Event Bus OpenClaw Core User Command Gateway Start Session Event session-memory Save summary on /new command-logger Audit trail boot-md Startup checklist agent:bootstrap Mutate workspace files

Available Events

command:new User issues /new (new session)
command:reset User issues /reset
command:stop User issues /stop
gateway:startup Gateway starts
agent:bootstrap Before workspace files are injected (can mutate them)

The agent:bootstrap hook is powerful

It can intercept and modify workspace files before they're injected into the system prompt. Inject different personas based on time of day, who's messaging, or any other condition.

For Organizations

Enterprise Relevance

For cyber security and enterprise contexts, this architecture enables powerful capabilities.

Persistent Operational Memory

SOC procedures, past incidents, known configurations - always available to the agent.

Multi-Channel Presence

Same agent across Slack, Teams, email triggers - unified experience.

Event-Driven Automation

Hooks can trigger on session events, integrate with SIEM/SOAR.

Audit Trail

Command logging, session transcripts - full accountability.

Controlled Tool Access

Sandboxing, exec policies, tool allowlists - enterprise-grade security.

Customizable Persona

Tailor communication style per channel or audience.