Skip to content

FayAndXan/Diji

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

106 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Diji β€” AI Companion Platform

The engine behind all Diji companions. One platform, multiple personalities.

Architecture

[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]

Components

  • 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.

Creating a New Companion

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

Scaling

  • 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

License

Private. Β© Diji Corp.

About

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 65.2%
  • Python 10.8%
  • JavaScript 10.2%
  • HTML 5.7%
  • Shell 5.2%
  • PLpgSQL 2.8%
  • Dockerfile 0.1%