Cersei

Cersei vs Other Agent SDKs

How Cersei compares to other agent SDKs for building coding agents.

Cersei vs Other Agent SDKs

Looking for the general-purpose agent framework comparison (Agno, LangGraph, CrewAI, PydanticAI)? The five-axis showdown — instantiation, per-agent memory, max concurrent agents, graph memory recall under load, semantic search under load — is at Cersei vs Agno / LangGraph / CrewAI / PydanticAI. This page covers the coding-agent-focused comparison against Claude Code and Codex.

Cersei vs Claude Code SDK

Claude Code's Agent SDK (part of the @anthropic-ai/claude-code package) provides a way to embed Claude Code's agent capabilities in your application. Here's how it compares to Cersei:

DimensionCersei SDKClaude Code SDK
LanguageRust (native binary)TypeScript/Node.js
Provider Lock-in15+ providers (Anthropic, OpenAI, Google, Groq, etc.)Anthropic only
Tool System35 built-in + custom Tool trait + MCPInherited from Claude Code
MemoryGraph DB (Grafeo) + flat files + CLAUDE.mdFlat file CLAUDE.md only
ControlFull: custom system prompt, tools, hooks, everythingLimited: prompt injection, some config
Streaming26-variant event system with broadcast channelsCallback-based events
Binary SizeSingle static binary (~15MB)Requires Node.js runtime (~100MB+)
Startup Time~50ms~2s (Node.js cold start)
Tool Dispatch0.02ms (Edit) to 17ms (Bash)Depends on Node.js event loop
Memory Recall98us (graph indexed)File scan (varies)
LSP IntegrationBuilt-in cersei-lsp crate (13 servers)Via MCP servers
Tree-sitterBuilt-in (5 languages + bash safety)Not available
Sub-agentsAgentTool with independent loopsTask tool
Auto-compactLLM summarization + snip fallbackAutomatic
Session PersistenceJSONL with auto-fork at 50MBManaged internally
HooksPre/Post ToolUse, ModelTurn, Stop, ErrorLimited lifecycle hooks
Permission System6 levels + 5 TUI modesInteractive/auto
Cost TrackingPer-message with model pricingBasic token counting
TUIratatui with side panel, themes, graph vizBuilt-in (not customizable)

When to Choose Cersei

  • You need provider flexibility (switch between GPT-5, Claude, Gemini, local models)
  • You want full control over every aspect: system prompt, tools, memory, permissions
  • You're building a Rust application and want native performance
  • You need graph-based memory with relationship tracking and confidence decay
  • You want tree-sitter code intelligence built into your agent
  • You're building a custom CLI tool or embedding an agent in a desktop app

When to Choose Claude Code SDK

  • You're already using Claude Code and want to extend it
  • You want the quickest path to a working agent with minimal configuration
  • Your application is TypeScript/Node.js based
  • You only need Anthropic models
  • You want Claude Code's existing UX and polish out of the box

Code Comparison

Cersei — Full control:

let agent = Agent::builder()
    .provider(cersei_provider::from_model_string("openai/gpt-5.3-chat-latest")?.0)
    .tools(cersei_tools::all())
    .system_prompt("You are a Rust expert. Focus on performance.")
    .max_turns(30)
    .thinking_budget(8000)
    .temperature(0.3)
    .auto_compact(true)
    .hook(MyCustomHook)
    .mcp_server(McpServerConfig::stdio("db", "my-db-server", &[]))
    .memory(MemoryManager::new(".").with_graph(&graph_path)?)
    .permission_policy(MyCustomPolicy)
    .working_dir(".")
    .build()?;

Claude Code SDK — Quick start:

import { createAgent } from "@anthropic-ai/claude-code";

const agent = createAgent({
  prompt: "You are a Rust expert",
  allowedTools: ["read", "write", "bash"],
});

Cersei requires more setup but gives you control over every aspect. Claude Code SDK is simpler but constrains you to its architecture.


Cersei vs Pydantic AI / LangChain

DimensionCerseiPydantic AILangChain
LanguageRustPythonPython/JS
FocusCoding agentsStructured AI appsGeneral AI chains
Tool SystemTrait-based, async, permission levelsFunction decoratorsTool classes
MemoryGraph DB + flat filesExternal (Redis, etc.)VectorStore abstractions
PerformanceNative binary, sub-ms dispatchPython overheadPython overhead
Type SafetyCompile-time (Rust)Runtime (Pydantic)Runtime
Agent LoopBuilt-in agentic loop with eventsManual or via agentsAgentExecutor
StreamingNative SSE parsing, 26 event typesVia callbacksVia callbacks
Code IntelligenceLSP + tree-sitter built-inNot availableNot available
Binary DistributionSingle static binaryRequires Python + depsRequires Python + deps

When to Choose Cersei

  • Performance matters (sub-millisecond tool dispatch)
  • You want a single binary with no runtime dependencies
  • You need built-in code intelligence (LSP, tree-sitter)
  • You're building a CLI tool or desktop application
  • Type safety and compile-time guarantees are important

When to Choose Python SDKs

  • Your team is Python-first
  • You need access to Python ML libraries (numpy, pandas, transformers)
  • You're prototyping and want maximum iteration speed
  • You need the Python ecosystem (thousands of LangChain integrations)

Feature Matrix

FeatureCerseiClaude Code SDKPydantic AILangChain
Multi-provider15+1 (Anthropic)MultipleMultiple
Native binaryYesNoNoNo
Graph memoryYesNoNoNo
Tree-sitterYesNoNoNo
LSP integrationYesVia MCPNoNo
Sub-agentsYesYesNoYes
Auto-compactYesYesNoNo
Hooks/middlewareYesLimitedYesYes
MCP supportYesYesNoNo
Permission system6 levels2 levelsNoNo
Session persistenceJSONL + auto-forkInternalExternalExternal
TUI frameworkratatuiBuilt-inNoNo
Cost trackingPer-model pricingBasicNoVia callbacks
Bash safetytree-sitter ASTNoNoNo
File undo/snapshotsYesYesNoNo

Cersei vs General Agent Frameworks (Agno, PydanticAI, LangGraph, CrewAI)

Every number here is measured end-to-end on Apple M1 Pro via bench/general-agents/. See bench-vs-agents for methodology, caveats, and reproduction steps.

Instantiation — μs per Agent.build()

Per-Agent Memory

Capacity — RSS vs concurrent live agents

At a glance

CerseiAgnoPydanticAILangGraphCrewAI
Version0.1.6-patch.22.5.171.22.01.1.81.14.2
Instantiation p507.12 μs6.50 μs219 μs5 536 μs28 509 μs
Per-agent memory704 B5.8 KiB8.7 KiB30.2 KiB17.7 KiB
Wall to build 5004.4 ms13.5 ms125 ms2 246 ms50 697 ms
RSS @ 500 agents8.5 MB82 MB123 MB193 MB1 739 MB
Graph memory in-processYes (Grafeo)NoNoNoNo
Semantic search in-processYes (usearch)NoNoNoNo

When to choose Cersei over the Python stack

  • You need to run thousands of concurrent agents on one host. Memory per agent decides your ceiling. Cersei is 8–44× tighter than anything in Python.
  • You want graph memory or semantic search in-process. The Python frameworks do not ship either. Bolting on a vector DB means network hops, serialization, and a second runtime to operate.
  • You are paying for the GIL. Any real concurrency story in Python either runs multiple processes (big memory tax) or wraps blocking work in asyncio (CPU-bound sections still serialize). Cersei + tokio uses every core natively.
  • You want a single static binary at the edge. Abstract is a 15 MB Rust binary. Agno/PydanticAI/LangGraph/CrewAI ship ~50+ Python deps and a runtime.

When to prefer Agno or PydanticAI

  • You're already deep in a Python ML stack and the 8–12× memory hit is acceptable for your fleet size.
  • You need type-driven structured output with Pydantic validators at the core — PydanticAI is purpose-built for that.
  • Your team can't take on Rust. Cersei exposes a C-ABI-free SDK that must be linked from Rust or called via a bin; there is no first-class Python binding yet.

On this page