How garrytan/openclaw works
OpenClaw is a self-hosted personal AI assistant: users message it through supported channels or the CLI, the Gateway coordinates assistant sessions and tools, and replies can be delivered back through connected channels. The repository also includes browser and memory extensions, control-plane and task subsystems, and native mobile/desktop clients with voice, Canvas, and device capabilities. The README documents the product-level workflow and capabilities; source excerpts are selective, so links between unsampled subsystems are omitted rather than inferred.
Main entry points: gateway Gateway · agents Agent runtime · extensions Messaging channels · route.ts CLI
Components 20
User entry points
- CLI
src/cli/route.ts - Control UI storage
ui/src/ui/storage.ts
Assistant runtime
- Reply pipeline
src/auto-reply/reply/block-reply-pipeline.ts - Agent runtime
src/agents - Model authentication
src/agents/model-auth.ts - Tool policy
src/agents/tool-policy-pipeline.ts - Context engine
src/agents/pi-embedded-runner/run/attempt.context-engine-helpers.ts - Context maintenance
src/agents/pi-embedded-runner/context-engine-maintenance.ts - Embedding services
src/memory-host-sdk/engine-embeddings.ts
Channels and extensions
- Messaging channels
extensions - Memory extension
extensions/memory-core/src/memory/manager-embedding-ops.ts - Browser extension
extensions/browser/src/browser/server-context.ts
Native clients
- Mobile clients
apps/android/app/src/main/java/ai/openclaw/app/MainActivity.kt - iOS share
apps/ios/ShareExtension/ShareViewController.swift - Speech tools
Swabble/Sources/SwabbleCore/Speech/SpeechPipeline.swift
Control plane
- Gateway
src/gateway - Task executor
src/tasks/task-executor.ts - ACP control plane
src/acp/control-plane/manager.core.ts - Delivery queue
src/infra/outbound/delivery-queue-storage.ts
Other components
- User
Connections 20
- User → CLI: issues commands
README.md - User → Messaging channels: sends messages
README.md - CLI → Gateway: starts or addresses
README.md - Messaging channels → Gateway: connect to
README.md - Gateway → Agent runtime: coordinates sessions
README.md - Agent runtime → Reply pipeline: produces replies
- Reply pipeline → Messaging channels: delivers replies
README.md - Agent runtime → Model authentication: resolves credentials
src/agents/model-auth.ts - Agent runtime → Tool policy: applies tool policy
src/agents/tool-policy-pipeline.ts - Agent runtime → Context engine: assembles context
src/agents/pi-embedded-runner/run/attempt.context-engine-helpers.ts - Context maintenance → Task executor: schedules work
src/agents/pi-embedded-runner/context-engine-maintenance.ts - Gateway → ACP control plane: supports control plane
- Memory extension → Embedding services: uses embedding services
- User → Mobile clients: uses assistant apps
README.md - Mobile clients → Gateway: connects to
- iOS share → Gateway: sends node events
apps/ios/ShareExtension/ShareViewController.swift - User → Control UI storage: configures interface
- User → Speech tools: speaks or listens
README.md - Agent runtime → Browser extension: uses browser tools
- Delivery queue → Gateway: stores outbound delivery