An autonomous multi-agent AI system that runs on your VPS, manages your Cloudflare infrastructure through natural language, and gets smarter the more you use it. Talk to it via Telegram, Discord, or WhatsApp — it runs forever in the background until you stop it.
- Runs as a Daemon — Starts in background, survives terminal close, runs until machine shuts down
- Remembers Everything — Learns your name, preferences, projects, patterns from every interaction
- Multi-Agent System — 5 specialized skill agents (Coder, Deployer, Searcher, Scheduler, FileManager)
- Action-Oriented — Executes tasks instead of just talking about them
- Manages Cloudflare — Workers, KV, D1, R2, DNS, Domains via Wrangler
- Multi-Channel — Telegram, Discord, WhatsApp + CLI shell
- AI Powered — Text, image generation, audio transcription via Workers AI
- Scheduled Tasks — Cron-based heartbeat system for recurring automations
- Built-in Search — No API keys needed, uses DuckDuckGo
- Local Code Execution — Writes and runs code locally, deploys to Cloudflare
- Permission System — Asks before destructive operations
- Zero-Config Database — Embedded SQLite, no external server
- Node.js 18+
- Cloudflare account with API token
- At least one channel: Telegram bot token, Discord bot token, or WhatsApp Cloud API
git clone https://github.com/truehannan/cloudbrain.git
cd cloudbrain
npm install
npm link # Makes 'cloudbrain' command available globallycloudbrain setupThe wizard will:
- Automatically create an embedded SQLite database at
~/.cloudbrain/cloudbrain.db - Ask for Cloudflare Account ID + API Token
- Ask for channel credentials (Telegram/Discord/WhatsApp)
- Auto-provision D1 database and verify Workers AI access
No external database server needed — everything is self-contained.
cloudbrain startThis spawns a background process that runs forever until you stop it or the machine shuts down. Closing the terminal does NOT stop it.
cloudbrain stop # Stop the daemon
cloudbrain restart # Stop + startcloudbrain start --foregroundcloudbrain status # Show daemon status (running/stopped, PID)
cloudbrain logs # Show recent log output
cloudbrain logs -f # Follow logs in real-time
cloudbrain tasks # View scheduled tasks
cloudbrain channels # View configured channels
cloudbrain deploy # Deploy a worker
cloudbrain setup # Re-run setup wizard
cloudbrain shell # Interactive CLICloudBrain uses 5 specialized skill agents coordinated by a Planner:
| Agent | Skill | What It Does |
|---|---|---|
| Coder | Code & Commands | Writes code, runs shell commands, manages ~/.cloudbrain/workspace/ |
| Deployer | Cloudflare | Workers, KV, D1, R2, DNS — all via Wrangler |
| Searcher | Web & Local | DuckDuckGo search + local file grep |
| Scheduler | Cron Tasks | Creates/manages recurring automated tasks |
| FileManager | Files | Create, read, delete, move local files |
- Message arrives (Telegram/Discord/WhatsApp/CLI)
- Planner Agent analyzes intent, splits multi-step requests, assigns to skill agents
- Executor dispatches to the correct skill agent
- Skill Agent performs the action (runs code, deploys, searches, etc.)
- Result returned — concise, action-oriented (no fluff)
- Context stored — conversation, facts, preferences all persisted for next time
CloudBrain automatically learns from every interaction:
- Explicit memories — "remember that my server IP is 1.2.3.4"
- Auto-detected facts — name, timezone, projects mentioned
- Preferences — tools, languages, deployment patterns you use
- Usage patterns — what commands you run most often
Next time you interact, it already knows your context.
"list my workers"
"deploy worker my-api"
"create kv namespace cache"
"create database users"
"create bucket media"
"delete worker old-one"
"write a script that fetches weather data"
"run command: ls -la"
"npm install express"
"git clone https://github.com/user/repo"
"create file config.json"
"read file index.js"
"list files"
"delete file old-script.js"
"search for latest Node.js release"
"look up cloudflare workers pricing"
"send me news at 9am every day"
"run backup at midnight"
"check system status every hour"
"remember that my deploy branch is production"
"my name is Alex"
"I prefer TypeScript over JavaScript"
"what do you remember about me?"
"search for express.js docs then write a hello world server"
"create a worker called api then deploy it"
┌──────────────────────────────────────────────────┐
│ CLI + Daemon │
│ cloudbrain start | stop | restart | status │
└──────────────────────┬───────────────────────────┘
│
┌──────────────────────▼───────────────────────────┐
│ AGENT CORE (index.ts) │
│ Message → Context → Plan → Execute → Learn │
└─────┬──────────┬──────────┬──────────┬───────────┘
│ │ │ │
┌─────▼────┐┌───▼────┐┌────▼───┐┌─────▼──────┐
│ Channels ││Planner ││Context ││ Permission │
│Telegram ││ Agent ││Manager ││ Manager │
│Discord ││ ││Memory ││ │
│WhatsApp ││ ││Learning││ │
└─────┬────┘└───┬────┘└────┬───┘└────────────┘
│ │ │
┌─────▼─────────▼──────────▼────────────────────┐
│ SKILL REGISTRY │
│ ┌────────┐ ┌─────────┐ ┌──────────┐ │
│ │ Coder │ │Deployer │ │ Searcher │ │
│ │Code/Run│ │CF/Wrnglr│ │DuckDuckGo│ │
│ └────────┘ └─────────┘ └──────────┘ │
│ ┌──────────┐ ┌─────────────┐ │
│ │Scheduler │ │ FileManager │ │
│ │ Cron │ │ Local FS │ │
│ └──────────┘ └─────────────┘ │
└───────────────────────┬───────────────────────┘
│
┌───────────────────────▼───────────────────────┐
│ SQLite Database (embedded) │
│ credentials | conversations | memories │
│ user_preferences | user_facts | task_log │
│ scheduled_tasks | system_config | permissions│
└───────────────────────┬───────────────────────┘
│
┌─────────────▼─────────────┐
│ Cloudflare (Remote) │
│ Workers | KV | D1 | R2 │
│ DNS | Zones | AI | Pages │
└───────────────────────────┘
| Data | Where | Purpose |
|---|---|---|
| Credentials | ~/.cloudbrain/cloudbrain.db |
API tokens, never leaves machine |
| Conversations | SQLite | Context for AI responses |
| Memories | SQLite | Explicit "remember X" items |
| User Facts | SQLite | Auto-learned info about you |
| Preferences | SQLite | Your patterns and choices |
| Scheduled Tasks | SQLite | Survives restarts |
| Daemon PID | ~/.cloudbrain/cloudbrain.pid |
Process tracking |
| Daemon Logs | ~/.cloudbrain/cloudbrain.log |
Runtime output |
| Workspace | ~/.cloudbrain/workspace/ |
Code written by Coder agent |
npm run dev # Run with ts-node (no build)
npm run build # Compile TypeScript to dist/
cloudbrain start --foreground # Run in foreground for debuggingSee LICENSE file.

