A self-hosted, multi-tier Telegram AI assistant.
Routes every query through the cheapest viable model tier โ semantic cache, live web lookups, headless scraping, and deep synthesis โ all on a single 4 GB VPS.
๐ BEO (Bureau of Ethereal Operations) is a self-hosted multi-model routing layer built for OpenClaw. Instead of sending every query to one model through a provider with an incentive to maximize your spend, BEO routes each query to the cheapest model that can handle it.
BEO operates via a distinct roster of specialized agents:
- ๐ฌ The Director (OpenClaw): The primary orchestration daemon that sits on the local node and autonomously determines operational Tiers.
- ๐ The Gatekeeper (LiteLLM): The API proxy that enforces rate limits, failover logic, and manages promotional keys.
- ๐ The MC (Gemini 3 Flash Preview): The sassy front-end voice that processes logic and formats the final broadcast.
- ๐ The Librarian (Redis): The keeper of the semantic cache that serves identical previous queries instantly.
- ๐ผ The Broker (Brave Search API): A programmatic search index that trades real-time web snippets for fractions of a cent.
- ๐ The Minions (Gemini 3.1 Flash-Lite): High-concurrency grunts that execute local parallel scraping and strip CSS/JS.
- ๐ฎ The Oracle (Gemini 1.5 Pro): A cloud-based model with a 2M-token vision used for deep synthesis of massive payloads.
- ๐๏ธ The Board (Claude 4.6 Opus): The ultimate authority summoned exclusively via strict keyword rituals for existential overrides.
Every inbound message passes through a pre-flight pipeline that enforces a strict escalation ladder:
| Tier | Name | Action | Target Cost |
|---|---|---|---|
| 0 | ๐ง The Brain | Pure Logic: Handled by The MC directly from internal neural weights. | ~$0.00007 |
| 1 | ๐๏ธ The Cabinet | Redis Cache: Instant bypass of LLM generation for identical semantic queries. | $0.00 |
| 2 | ๐๏ธ The Desk | Quick Facts: Bypasses scraping, pays The Broker directly for a JSON snippet. | ~$0.0005 |
| 3 | ๐บ๏ธ The Field | General Browsing: Deploys Minions to locally scrape and strip HTML from specific URLs. | ~$0.01 |
| 4 | ๐ The Extraction | Deep Research: Massive data payloads hoisted to The Oracle for deep synthesis. | ~$0.10 |
| 5 | ๐ The VIP | The Board: Bypasses The Director entirely via the /opus trigger. |
$0.50+ |
Built on OpenClaw + LiteLLM + Redis + Telegram long-polling. Designed to run on a single lower-tier VPS (2 vCPU, 4 GB RAM).
See docs/BLUEPRINT.md for the full engineering spec (BLU-01 โ BLU-33).
Telegram
โ
โผ
Pre-flight
โโโ Language detect (lingua, ~1ms, no API call)
โโโ TLD validation (IANA cache)
โโโ URL extraction (1โ5 โ Tier 3, 5+ โ Tier 4)
โโโ Slash commands (/opus โ Tier 5)
โโโ Attachment / char count triggers (โ Tier 4)
โโโ Desk keyword match (โ Tier 2, no_store=true)
โโโ Nano-classifier fallback (Flash Lite โ Tier 1 or 2)
โ
โผ
Redis Semantic Cache โโ Tier 0
โโโ Embedding: text-embedding-004
โโโ Similarity threshold: 0.92
โโโ Cache HIT โโโบ return immediately (no LLM call, no cost)
โโโ Cache MISS โโโบ continue
โ
โผ
LiteLLM Gateway
โโโ Budget enforcement (per-key max_budget, SQLite)
โโโ Key rotation (Gemini promo pool, simple-shuffle / least-busy)
โโโ Per-tier timeouts
โโโ Semantic cache write (no_store flag from pre-flight)
โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โผ โผ โผ โผ โผ
Tier 1 Tier 2 Tier 3 Tier 4 Tier 5
The Brain The Desk The Field The Extraction The VIP
โโโโโโโโโ โโโโโโโโ โโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโ
Flash Pro Flash Pro Flash Lite Flash Pro Opus / top
+ The Broker + The Minions + The Oracle capability
โ (mcp-search (1 sub-agent (multi-source model
โ live lookup) per URL, synthesis,
โ mcp-firecrawl structured โ
โ โ JS fallback) memo output) โ
โ โ โ โ โ
โ โ token overflow? โ โ
โ โ (>8k tokens) โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
The MC
โโโโโโโโโโโโโโโโโโโโโ
โ Tier 1: generate โ
โ Tier 2โ5: railblockโ
โ (format + deliver โ
โ only, no re- โ
โ synthesis) โ
โโโโโโโโโโโโโโโโโโโโโ
โ
Runtime Redirection (if needed)
โโโ live fact detected โ Tier 2
โโโ URLs found mid-turn โ Tier 3
โโโ massive payload โ Tier 4
โ
โผ
Telegram
(response delivered)
- A VPS with 4 GB RAM minimum (Hetzner CAX11 or equivalent)
- Docker + Docker Compose installed
- A Openclaw
- A Telegram bot token from @BotFather
- At least one of, but n keys capable:
- Google AI Studio API key (free tier works)
- OpenRouter API key
# 1. Clone
git clone https://github.com/YOUR_USERNAME/beo.git && cd beo
# 2. Bootstrap โ creates required host dirs and copies .env.example
./setup.sh
# 3. Fill in your keys
nano .env
# 4. Copy and adjust OpenClaw config
cp openclaw.json.example openclaw.json
# 5. Launch
docker compose up -d
# 6. Check logs
docker compose logs -fWhy
setup.sh? Git cannot track empty directories.data/redis/must exist on the host before Docker mounts it โ otherwise Docker creates it as root and Redis fails to write.setup.shcreates it with correct ownership. Run it once after every fresh clone.
All configuration lives in three files:
| File | Purpose |
|---|---|
.env |
API keys and operational thresholds (never committed) |
litellm_config.yaml |
Model aliases, budgets, router strategy, semantic cache |
openclaw.json |
Agent definitions, approval policy, compaction settings |
See .env.example for all required variables with inline documentation.
BEO is designed for a single-node VPS. The deploy workflow is:
# On your VPS โ after git clone and .env setup
docker compose up -d
# To update after a git push
git pull origin main && docker compose up -d --no-buildSee docs/DEPLOY.md for the full VPS setup walkthrough.
See docs/ROADMAP.md for the phased deployment roadmap (Phase 0 โ Phase 6).
MIT โ see LICENSE.