How akarshanop/openclaw works
OpenClaw is a self-hosted AI assistant whose Gateway is the local control plane. The principal documented workflow is a user interacting through a Control UI or messaging channel, with the Gateway coordinating sessions, tools, events, and channel connections; companion apps and device nodes add local capabilities. The map also preserves model/provider configuration, extensibility, and memory. Several runtime relationships are documented only at a high level in the README, so those edges are dashed; sampled source confirms selected session, memory, and mobile-share behavior, not the full runtime.
Main entry points: gateway Gateway · agents Agent Runtime · session-controller.lifecycle.ts Session Lifecycle · channels Chat Channels
Components 18
Gateway Runtime
- Gateway
src/gateway - Session Lifecycle
src/sessions/session-controller.lifecycle.ts - Runtime Config
src/config/config.ts
Channels and Clients
- Control UI
ui/src - Android App
apps/android/app/src/main/java/ai/openclaw/app - iOS Share
apps/ios/ShareExtension/ShareViewController.swift - Chat Channels
src/channels
Agents and Capabilities
- Agent Runtime
src/agents - Context Engine
src/context-engine/registry.ts - Model Providers
src/agents - Tools and Skills
src/agents - Plugins
src/plugins/registry-types.ts - Device Nodes
apps/android/app/src/main/java/ai/openclaw/app/node
State and Memory
- Session Storage
src/config/sessions/session-cold-storage-worker.ts - Delivery Queue
src/infra/session-delivery-queue-storage.ts - Memory Engine
extensions/memory-core/src/memory/manager-embedding-ops.ts - Credential Storage
src/agents/sessions/auth-storage.ts
Other components
- User
Connections 21
- User → Control UI: uses
- User → Chat Channels: messages
- Control UI → Gateway: connects
- Chat Channels → Gateway: connects
- Android App → Gateway: connects
- iOS Share → Gateway: sends event
apps/ios/ShareExtension/ShareViewController.swift - Gateway → Session Lifecycle: coordinates
src/gateway/server.chat-goal-workers.test-support.ts - Gateway → Chat Channels: manages connections
- Gateway → Tools and Skills: coordinates tools
src/gateway/server.chat-goal-workers.test-support.ts - Gateway → Agent Runtime: runs assistant
src/gateway/server.chat-goal-workers.test-support.ts - Agent Runtime → Context Engine: assembles context
src/agents/harness/context-engine-lifecycle.ts - Agent Runtime → Model Providers: uses provider
- Agent Runtime → Tools and Skills: invokes
- Plugins → Model Providers: extends
src/agents/harness/registry.ts - Plugins → Tools and Skills: extends
src/agents/harness/registry.ts - Device Nodes → Gateway: adds capabilities
- Session Lifecycle → Session Storage: persists transcripts
- Session Lifecycle → Delivery Queue: queues delivery
src/infra/session-delivery-queue-storage.ts - Context Engine → Memory Engine: uses memory
- Agent Runtime → Credential Storage: loads credentials
src/agents/sessions/auth-storage.ts - Runtime Config → Gateway: configures
src/gateway/server.chat-goal-workers.test-support.ts