Skip to content

System Architecture

This document provides a high-level view of the AgentZero runtime architecture.

  1. Traits define boundaries. Core crate has zero infrastructure dependencies.
  2. Fail closed. Security defaults deny everything; capabilities require explicit opt-in.
  3. Single binary. One cargo install gives you CLI, gateway, daemon, and all tools.
  4. Crate isolation. Each subsystem lives in its own crate with minimal dependencies.

The workspace was consolidated from 46 to 16 crates. Each remaining crate corresponds to a real deployment or consumption boundary.

CratePurpose
bin/agentzeroThin binary entrypoint
agentzero-cliCommand parsing, dispatch, UX (absorbed 18 modules: daemon, doctor, health, hooks, service, etc.)
agentzero-coreAgent traits, orchestrator, domain types, security, delegation, routing
agentzero-configTyped config model and policy validation
agentzero-providersOpenAI-compatible provider implementation (Anthropic, OpenAI, OpenRouter, Ollama, etc.)
agentzero-authCredential management (OAuth, API keys, profiles)
agentzero-storageEncrypted KV store + conversation memory (SQLite, Turso, SQLCipher)
agentzero-tools50+ built-in tool implementations (includes autonomy, hardware, cron, skills)
agentzero-infraAgent orchestration, audit, runtime execution, tool wiring
agentzero-channelsPlatform integrations (Telegram, Discord, Slack) + leak guard
agentzero-pluginsWASM plugin host runtime (wasmi default, wasmtime optional)
agentzero-plugin-sdkPlugin SDK (ABI v2, WASI)
agentzero-gatewayHTTP/WebSocket server (Axum) with SSE streaming
agentzero-ffiFFI bindings (Swift/Kotlin/Python via UniFFI, Node via napi-rs)
agentzero-testkitTest doubles and mocks (dev-only)
agentzero-benchCriterion benchmark suite (dev-only)