Cersei is a Rust software development kit for building coding agents. It exposes the parts a coding agent needs — tool execution, model streaming, sub-agent orchestration, persistent memory, skills, and MCP integration — as composable library functions, so an agent can be embedded in an application rather than shelled out to as a command-line program. The stated target is a drop-in replacement for a coding CLI such as Claude Code or OpenCode built as a library call.
The workspace is split into crates: types, providers, tools, an agent loop, memory, hooks, and an MCP client, behind a cersei facade. A provider is any model backend, with Anthropic (including OAuth) and OpenAI built in, and the OpenAI provider also covering Ollama, Azure, and vLLM endpoints. Over 30 tools ship in named sets for filesystem, shell, web, planning, scheduling, and orchestration, and custom tools are added with an impl Tool implementation or a #[derive(Tool)] macro.
Memory has three tiers: flat markdown files with frontmatter, a merged CLAUDE.md hierarchy, and an optional Grafeo graph layer for storing, tagging, and recalling facts. Sessions persist as append-only JSONL compatible with Claude Code. Orchestration covers sub-agents spawned by the model, a coordinator mode for parallel workers with recursion-preventing tool filtering, and a task system with create, update, get, list, stop, and output operations. Runs can be observed through a callback, a broadcast channel with multiple consumers, or a bidirectional stream that can answer permission requests mid-run.
Context handling includes auto-compaction at a configurable share of the context window, a tool-result byte budget, thinking budgets, and Low, Medium, High, and Max effort levels. Skills are discovered in both .claude/commands/.md and .claude/skills//SKILL.md layouts. MCP servers connect over stdio or SSE, including remote Streamable HTTP servers through a bridge.
Abstract is the reference command-line agent built on the SDK: a single binary with 34 built-in tools, graph memory on by default, session persistence, interactive permissions, 12 slash commands, TOML configuration, and a JSON output mode. Measured on Apple Silicon, its warm startup is 32 ms against 266 ms for Claude Code, its binary is 6.0 MB against 174 MB, resident memory is 4.9 MB against 333 MB, and graph memory recall takes 98 µs where an LLM-ranked recall took 7,545 ms. Benchmark suites cover general agent frameworks, Terminal Bench 2.0 in Daytona sandboxes, LongMemEval long-term memory, compression against real models, and CLI-to-CLI comparisons.
Features
- Composable crates: types, provider, tools, agent, memory, hooks, and MCP crates work standalone or through the cersei facade
- Multi-provider: Anthropic with OAuth and OpenAI built in, with the OpenAI provider covering Ollama, Azure, and vLLM endpoints
- 30+ tools: filesystem, shell, web, planning, scheduling, and orchestration sets, plus custom tools via impl Tool or #[derive(Tool)]
- Sub-agent orchestration: model-spawned sub-agents, a coordinator mode for parallel workers, and a six-operation task system
- Three-tier memory: flat memory files, a merged CLAUDE.md hierarchy, and an optional Grafeo graph with tagging and recall
- Session persistence: append-only JSONL sessions with tombstone soft-delete, compatible with Claude Code
- Skills: discovery of both .claude/commands/.md and .claude/skills//SKILL.md layouts, plus bundled skills
- Event observation: callback, multi-consumer broadcast, and bidirectional stream with in-flight permission responses
- Context management: auto-compaction, tool-result budgets, thinking budgets, and four effort levels
- MCP client: stdio and SSE transports, with remote Streamable HTTP servers reached through a bridge
- Permission policies: AllowAll, AllowReadOnly, DenyAll, rule-based, and interactive policies, or your own implementation


