How mahdertesf/openclaw works
OpenClaw is a self-hosted personal AI assistant whose Gateway coordinates messaging, agent sessions, tools, and events. A typical workflow starts with onboarding and configuration, receives a message through a channel, routes it to an agent, and returns a reply; companion apps also connect as nodes for voice and device capabilities. The README documents the major product branches, while the sampled source confirms selected agent, tool-policy, browser-storage, voice, and Android service relationships. Several subsystems are represented at directory level because their implementation was not sampled.
Main entry points: server.impl.ts Gateway control plane · agent.ts Agent execution · bot-handlers.ts Channel adapters · commands Onboarding wizard
Components 21
Setup and control
- Onboarding wizard
src/commands - Configuration
src/config - Gateway control plane
src/gateway/server.impl.ts
Assistant runtime
- Agent execution
src/commands/agent.ts - Session routing
src/routing/session-key.ts - Tool policy
src/agents/tool-policy-pipeline.ts - Memory search
src/memory - Model providers
src/agents
Messaging channels
- Channel adapters
src/telegram/bot-handlers.ts - Discord voice
src/discord/voice/manager.ts - Channel extensions
extensions
Tools and capabilities
- Browser tools
src/browser - Live Canvas
src/canvas-host/server.ts - Cron and sessions
src
Companion clients
- Android node
apps/android/app/src/main/java/ai/openclaw/android/NodeRuntime.kt - iOS node
apps/ios/Sources/Model/NodeAppModel.swift - macOS companion
apps/macos/Sources/OpenClaw/AppState.swift - Shared node protocol
apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayNodeSession.swift
Other components
- Operator
- Assistant user
- AI model services
Connections 23
- Operator → Onboarding wizard: configures
README.md - Onboarding wizard → Configuration: sets up
README.md - Operator → Gateway control plane: starts
README.md - Gateway control plane → Configuration: uses
- Assistant user → Channel adapters: sends message
README.md - Channel adapters → Gateway control plane: delivers events
- Gateway control plane → Session routing: routes sessions
README.md - Session routing → Agent execution: selects agent
README.md - Agent execution → Model providers: requests inference
- Model providers → AI model services: calls
- Agent execution → Tool policy: filters tools
src/agents/tool-policy-pipeline.ts - Agent execution → Memory search: uses memory
- Agent execution → Browser tools: invokes browser
- Agent execution → Live Canvas: controls canvas
README.md - Gateway control plane → Cron and sessions: coordinates
README.md - Gateway control plane → Android node: connects nodes
README.md - Gateway control plane → iOS node: connects nodes
README.md - Gateway control plane → macOS companion: connects companion
README.md - Android node → Shared node protocol: uses protocol
- iOS node → Shared node protocol: uses protocol
- Channel adapters → Channel extensions: extends channels
README.md - Discord voice → Agent execution: runs agent
src/discord/voice/manager.ts - Gateway control plane → Assistant user: returns replies