The workspace is split into layers. Edge crates talk to the outside world; core crates orchestrate; support crates provide utilities. Each crate has its own rustdoc β see API (rustdoc).
The agent loop, security-policy enforcement, SOP engine, cron scheduler, onboarding wizard, and TUI. Depends on every other core and edge crate.
Notable submodules:
agent/β the main request/response loop, streaming, tool-call orchestrationsecurity/β policy types, sandbox detection, OTP, emergency stopsop/β Standard Operating Procedure engine (see SOP β Overview)onboard/β the first-run wizard (wizard.rs)memory/β wrapszeroclaw-memorywith runtime-level caching and consolidation schedulesservice/β systemd / launchctl / Windows Service integration
TOML schema and its validation. Handles:
- Autonomy level enum (
ReadOnly/Supervised/Full) - Encrypted secrets store (local key file)
- Workspace resolution (env vars, Homebrew paths, XDG, container detection)
- Schema versioning and migration
All user-facing config keys are documented in Reference β Config, which is generated from this crate.
The kernel ABI. Defines three public traits:
Providerβ LLM client interface with streaming capability flagsChannelβ inbound/outbound messaging surfaceToolβ agent-callable capabilities
The runtime depends only on these traits, not on concrete implementations. This is what makes provider/channel/tool additions a matter of implementing a trait rather than patching the core.
All LLM client implementations plus the routing and fallback wrappers. See Model Providers β Overview for the list.
Structure:
traits.rsβ re-exports fromzeroclaw-apiplus provider-internal helpersanthropic.rs,openai.rs,ollama.rs, β¦ β one file per native providercompatible.rsβ a single OpenAI-compatible implementation reused by 20+ providers (Groq, Mistral, xAI, Venice, etc.)router.rsβ multi-provider router that routes by task hintreliable.rsβ fallback-chain wrapperstreaming.rsβ SSE parsing, token estimation, tool-call deltas
30+ messaging integrations. See Channels β Overview for the catalogue.
All channels implement the Channel trait from zeroclaw-api. Each is feature-gated β a minimal build includes only the channels you compile in.
The orchestrator/ submodule handles message streaming, draft updates, multi-message splits, and the ACP server.
HTTP/WebSocket gateway. Exposes the runtime over:
- REST API (sessions, memory, status, cron management)
- WebSocket for streaming responses
- Web dashboard (static assets + auth)
- Webhook endpoints (inbound from channels that push)
Pairing is required by default; [gateway.allow_public_bind = true] enables binding to 0.0.0.0.
Callable tools the agent invokes. Not to be confused with CLI zeroclaw subcommands.
Includes: browser, http, pdf_extract, web_search, shell, file_read, file_write, hardware_probe, and more. See Tools β Overview.
Each tool is registered via factory and described to the model via Fluent-localised strings.
Conversation memory and retrieval. SQLite is the default backend; PostgreSQL is available behind --features memory-postgres for multi-instance deployments that need a shared, concurrent-write store. Optional:
- Embedding backends (OpenAI, Ollama, local)
- Vector retrieval over stored conversations (pgvector when on PostgreSQL)
- Memory consolidation (summaries, fact extraction)
Model-side tool-call syntax parsing. Handles variations between providers:
- OpenAI-style
tool_callsJSON - Anthropic-style
<tool_use>blocks - Qwen/Ollama's function-call formats
- Native tool-call streaming deltas
Dynamic plugin loader for out-of-process tool implementations. See Developing β Plugin protocol.
Hardware abstraction β GPIO, I2C, SPI, USB. Platform-gated. See Hardware β Overview.
Tracing, metrics, structured logging. All crates emit events via this layer.
Derive macros for config schema, tool registration, and channel registration. Saves boilerplate across the workspace.
Terminal UI. Optional β compile with --features tui.
Specialised hardware support used by the hardware submodule. Out-of-scope unless you're bringing up specific peripherals.
The microkernel roadmap (RFC #5574) defines a feature-flag taxonomy. The practical upshot for a user:
defaultβ a sensible core buildci-allβ everything on, for CIchannel-<name>β opt-in per channel (e.g.channel-matrix,channel-discord)provider-<name>β opt-in per providerhardwareβ enable hardware subsystemtuiβ terminal UI
Run cargo metadata --format-version 1 | jq '.workspace_members' or read the top-level Cargo.toml for the full list.