The engine behind all Diji companions. One platform, multiple personalities.
[Users on Telegram/WhatsApp/WeChat]
β
βΌ
[nginx β SSL termination, webhook routing]
β
βΌ
[diji-router β Redis-backed userβinstance mapping]
β
βββββΌββββββββ
βΌ βΌ βΌ βΌ
[OC1] [OC2] [OC3] [OCn] β OpenClaw instances (500 users each)
β β β β
βββββΌββββββββ
βΌ
[Companion Server β auth, registration, health API]
β
βΌ
[Redis β session state, user mapping, pub/sub]
[Postgres+pgvector β memory, user data] (future)
[LLM API β Anthropic/Together/Fireworks]
- gateway/router/ β Node.js webhook router. Reads user ID from incoming messages, assigns to least-loaded OpenClaw instance via Redis.
- extensions/auth-gate/ β Channel-level allowlist. Blocks unregistered users before LLM runs. Zero cost for freeloaders.
- extensions/rule-injector/ β Per-user identity, rules, and health data injection. The brain of multi-tenant personalization.
- hooks/user-bootstrap/ β Creates per-user workspace (USER.md, MEMORY.md) on first message.
- server/ β Companion API server. Auth, registration, channel linking, health data.
- templates/ β Companion personality templates. Swap SOUL.md + AGENTS.md + rule-injector templates to create a new companion product.
- docker/ β Docker Compose for full platform deployment.
- scripts/ β Instance lifecycle, cron wrappers.
cp -r templates/companion templates/my-new-companion
# Edit templates/my-new-companion/.openclaw/workspace/SOUL.md
# Edit templates/my-new-companion/.openclaw/workspace/AGENTS.md
# Update rule-injector templates for your domain
# Deploy with: docker compose up --scale openclaw=3- Each OpenClaw instance handles ~500 concurrent users
- Router auto-assigns new users to least-loaded instance
- Add capacity:
docker compose up --scale openclaw=N - Redis handles userβinstance mapping and state coordination
- Supports 1M+ users with enough instances
Private. Β© Diji Corp.