Architecture
architecture overview
trait-based pluggable subsystems
design
every subsystem is a trait. swap implementations with a config change, zero code changes.
| subsystem | trait | ships with | extend |
|---|---|---|---|
| AI models | Provider | 22+ providers | custom:https://your-api.com |
| channels | Channel | CLI, telegram, discord, slack, iMessage, matrix, whatsapp, webhook | any messaging API |
| memory | Memory | SQLite hybrid search + LZ4 | any persistence backend |
| tools | Tool | shell, file_read, file_write, memory_store, memory_recall, browser, composio | any capability |
| observability | Observer | noop, log, multi | prometheus, OTEL |
| security | SecurityPolicy | pairing, sandbox, allowlists, SSRF, encrypted secrets | - |
| tunnel | Tunnel | cloudflare, tailscale, ngrok, custom | any tunnel binary |
modules
src/
├── agent/ # conversation loop, tool dispatch
├── channels/ # channel trait + 8 implementations
├── config/ # toml config, env var overrides
├── cron/ # scheduled tasks
├── daemon/ # full runtime with JoinSet
├── doctor/ # system diagnostics
├── gateway/ # HTTP API server
├── health/ # health check endpoints
├── heartbeat/ # periodic task engine
├── integrations/ # 74 integration definitions
├── memory/ # SQLite hybrid search
├── migration/ # legacy format migration
├── observability/# logging, metrics
├── onboard/ # setup wizard
├── providers/ # AI provider trait + implementations
├── runtime/ # native runtime adapter
├── security/ # pairing, secrets, sandbox, policy
├── service/ # OS service management
├── skills/ # skill loader
├── tools/ # tool trait + implementations
└── tunnel/ # tunnel trait + implementations
tech stack
| layer | tech |
|---|---|
| language | rust, 100% |
| allocator | mimalloc |
| mutex | parking_lot (1 byte vs 40) |
| concurrency | tokio JoinSet |
| memory | SQLite + FTS5 + vector cosine + LZ4 |
| encryption | ChaCha20-Poly1305 AEAD + DPAPI |
| HTTP | axum + tower |
| caching | DashMap concurrent hashmap |
| build | opt-level=z, LTO, panic=abort |