Ch 2 — Architecture: The Three-Layer Design

Gateway, Channel, and LLM layers — plus the six-stage message flow pipeline
Chapter 2
-
Click play or press Space to begin...
Step- / 8
AGateway LayerThe central coordination hub
1
dns
Node.js Daemon
Port 18789
manages
2
sync_alt
Sessions
Routing & queuing
3
swap_horizChannel adapters normalize messages from 13+ platforms
BChannel LayerPlatform adapters for messaging apps
3
chat
Telegram
Bot API
3
forum
WhatsApp
Web bridge
3
tag
Discord
Bot token
4
more_horiz
10+ More
Slack, Signal...
CLLM LayerUnified interface for multiple AI providers
5
psychology
Multi-Provider
14 built-in
tools
5
hub
MCP Servers
Tool calling
stream
5
swap_vert
Failover
Auto-fallback
6
routeSix-stage message flow: intake \u2192 gateway \u2192 agent \u2192 LLM \u2192 tools \u2192 response
DMessage Flow PipelineSix stages from message to action
6
input
Intake
Normalize msg
6
memory
Context
Assemble prompt
7
neurology
Inference
LLM call
7
build
Tool Loop
Execute actions
EPi Agent FrameworkThe internal engine powering OpenClaw
8
package_2
pi-agent-core
Base interfaces
8
code
pi-coding-agent
Session manager
8
smart_toy
pi-ai
Model interaction
1
Title