Syscity is a Rust-based personal AI assistant platform. It routes messages from multiple inbound channels through an agent core to LLM providers, with persistent memory, tool execution, security controls, and physical/desktop automation.
┌─────────────────────────────────────────────────────────────────────────────┐
│ User Interfaces │
│ CLI · TUI · Telegram · Discord · Slack · WebSocket · Webhook · Browser │
└───────────────────────────────────┬─────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Gateway (Control Plane) │
│ ── HTTP/WebSocket API · channel registry · agent spawning · auth · hooks │
└───────────────────────┬───────────────────────────────────────┬─────────────┘
│ │
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ Inbound Pipeline │ │ Outbound Pipeline │
│ debounce → enrich │ │ format → SSE → │
│ → route → enqueue │ │ dispatch → side fx │
└───────────┬───────────┘ └───────────┬───────────┘
│ │
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ Agent Core │ │ Channels / Users │
│ context · memory │ │ │
│ · tool calls · ACP │ │ │
└───────┬───────────────┘ └───────────────────────┘
│
┌───────────┼───────────┬───────────────┬───────────────┐
▼ ▼ ▼ ▼ ▼
┌───────┐ ┌───────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐
│Memory │ │ Tools │ │Providers │ │ Computer │ │ Planner │
│Store │ │Registry│ │ Router │ │ Adapter │ │ Goal DAG │
└───────┘ └───────┘ └──────────┘ └──────────┘ └──────────────┘
| Layer | Responsibility | Key Module |
|---|---|---|
| Interface | CLI, TUI, chat channels, webhooks | cli, channels, tui |
| Control Plane | HTTP/WebSocket server, lifecycle, auth | gateway, security |
| Conversation | Session management, message routing, context | agent, channels, inbound, outbound |
| Reasoning | Tool selection, planning, desktop/server automation | tools, planner, computer, capabilities |
| Memory | Conversations, semantic search, tiered storage, dreaming | memory |
| Providers | LLM routing, fallbacks, streaming, cost guard | providers, model_router |
| Extensions | Plugins, skills, MCP, browser automation | plugins, skills, mcp, browser |
| Operations | Cron, heartbeat, standing orders, export | cron, heartbeat, standing_orders, export |
Channel event
│
▼
InboundPipeline::receive()
│
├──▶ Debounce / media download / identity resolution
│
▼
ConversationResolver ──▶ agent_id + session_id
│
▼
Agent::process_message()
│
├──▶ MemoryManager::retrieve() ──▶ context memories
├──▶ ToolRegistry::available() ──▶ tool schemas
└──▶ Provider::complete() ──▶ LLM response
│
├──▶ Tool call ──▶ ToolRegistry::execute()
│ │
│ ├──▶ Security / sandbox validation
│ ├──▶ Approval queue (if required)
│ └──▶ Content filter on output
│
└──▶ Final text ──▶ OutboundPipeline
│
▼
Channel response
LLM tool call
│
▼
ToolRegistry::execute()
│
├──▶ Command / path / sandbox validation
├──▶ Approval check (human-in-the-loop)
├──▶ Capability scope check (os_control)
├──▶ Execute tool
├──▶ Secret / PII scan on output
└──▶ Return result to LLM
User goal
│
▼
GoalPlanner::achieve()
│
├──▶ GoalDecomposer ──▶ Task DAG
├──▶ DagScheduler ──▶ parallel execution
│ │
│ └──▶ TaskExecutor
│ │
│ ├──▶ ComputerAdapter (desktop/server)
│ ├──▶ VerificationEngine
│ └──▶ RollbackManager (on failure)
│
└──▶ Record experience to memory
- Trait-based abstractions —
Channel,Provider,MemoryStore,Tool,ComputerAdapter,CapabilitySetare traits, enabling pluggable implementations. Arc<dyn ...>for shared state — Runtime backend selection (unified SQLite vs. tiered memory, multiple LLM providers).- Feature-gated channels and tools — Cargo features keep binaries small; optional vision, pgvector, with sqlite-vec enabled by default.
- Tiered memory — Working (in-memory), ShortTerm/LongTerm (SQLite), Archival (compressed JSONL) with
TierEvaluatorpromotion/demotion. - CapabilitySet + ToolRegistry — OS-specific tools are grouped by platform/environment, runtime-detected, and exported individually into
ToolRegistry. - Security-first execution — Path/command validation, sandboxed resource limits, approval levels, RBAC, content filtering, audit logging.
- Planner + ComputerAdapter — High-level goals decompose into task DAGs executed against a unified desktop/server abstraction.
- Runtime invariant registry — Modules own the data invariants they uphold and register checks with
core::invariants;syscity invariantsruns them all against live local state. Astatic-analysis.sh --fullrule requires every top-level module to register checks or carry an explicitINVARIANTS-NONE:marker — nothing is silently unchecked.
modules/acp.md— Agent Control Plane (subagents, sessions, execution control)modules/agent.md— Agent orchestration, context, turns, artifactsmodules/browser.md— Browser automation, CDP, ARIA snapshots, browser poolmodules/canvas.md— A2UI component system for rich assistant UImodules/capabilities.md— Platform capability sets and OS control scopesmodules/channels.md— Channel interfaces, resolver, thread bindingmodules/cli.md— Command-line interfacemodules/computer.md— Cross-platform desktop/server automationmodules/config.md— Configuration loading, validation, hot reloadmodules/core.md— Domain models and shared typesmodules/cron.md— Scheduled task executionmodules/export.md— Conversation and memory exportmodules/gateway.md— Gateway control planemodules/heartbeat.md— Periodic wake/heartbeatmodules/inbound.md— Inbound message pipelinemodules/mcp.md— Model Context Protocolmodules/memory.md— Memory and storage systemmodules/model_router.md— LLM provider routingmodules/outbound.md— Outbound response pipelinemodules/planner.md— Goal planning and task executionmodules/plugins.md— Plugin systemmodules/providers.md— LLM provider implementationsmodules/security.md— Security layermodules/skills.md— Skill systemmodules/standing_orders.md— Standing background agent programsmodules/tools.md— Tool systemmodules/tui.md— Terminal UI clientmodules/utils.md— Utilities (batch, logging, pool, profiling)os.md— Operating-system control architecture and roadmap
- Language: Rust (tokio async runtime)
- Web framework: Axum
- CLI: clap
- TUI: ratatui + crossterm
- Serialization: serde + toml + json
- Database: SQLite (sqlx), optional Postgres (pgvector)
- Observability: tracing + Prometheus metrics
- Plugins: WASM + wapm-style registry