For developers

Build legal-AI you can put your name on.

A typed document AST with span-level provenance, an MCP-native runtime, and a clean dependency graph across the Python and Rust modules. If you came from DSPy, LangChain, Pydantic-AI, Mirascope, or Instructor, the next few sections show what overlaps, where KAOS diverges, and what the platform makes easy when the work in front of you is a deal room or a brief, not a chatbot demo.

Terminal window
pip install 'kaos[mcp,llm]'

From install to a callable MCP tool

Four commands from a clean checkout to a tool an agent can call.

The same KaosTool subclass that an associate uses from Claude Code is the one your CI tests against. No wrapper layer, no rewrite to "expose for agents."

Install pip install 'kaos[mcp,llm]' Subclass class MyTool (KaosTool): Register runtime.register (MyTool) Serve kaos serve stdio · HTTP · SSE

What the platform makes easy

The plumbing most teams end up building from scratch.

Answer a question about a corpus with checkable citations, expose a firm-internal lookup as an MCP tool, and run a long agent across a real deal room with a hard spend cap. Every team building legal AI on top of LLMs writes some version of these three. KAOS gives you the typed, observable, auditable version on day one.

Pick your entry

Which surface should you read first?

Each leaf is a clickable surface page. The full package list is at /packages. Prefer a guided route? Pick your path on learn-kaos, or start the tutorial spine at first-tool.

Familiar terrain

If you came from…

DSPy

Signature and Program work the way you remember. The optimizers (BootstrapOptimizer, InstructionOptimizer, MIPROv2) are ported. What is new: programs serialize as schema-validated JSON instead of pickles, batch jobs survive a crash via a SQLite workspace, every program can be served as an MCP tool, and every step keeps Cited[T] provenance. Full head-to-head in the kaos-llm-core repository.

LangChain / LangGraph

Closer to LangGraph in spirit (typed, plan-execute) than to LangChain's strings-in, strings-out chains. Recipes are JSON. Agent state is typed memory sections. Tools subclass KaosTool. There is no **kwargs shrug at the edges.

Pydantic-AI / Mirascope / Instructor

Same typed-output instinct. KAOS fills in what those libraries leave out: a transport layer (kaos-llm-client), a document AST (kaos-content), retrieval (kaos-nlp-core), and an agent runtime with memory and recipes (kaos-agents). Install one package or install the whole set.

Raw provider SDKs

kaos-llm-client keeps the provider-native escape hatch when you need it, and takes the per-provider retry, streaming, structured-output, and tool-calling boilerplate off your plate. create_client("anthropic:claude-haiku-4-5") and you are done.

Open-source proof

You can check every claim against the source.

The numbers on this site come from the same code you would run. kaos status --json | jq '.tools | length' on a fresh install prints the canonical tool count.

The supply chain is checkable too: every package ships a PEP 740 build attestation and a CycloneDX SBOM, tracked on a public dashboard that signs its own snapshot. Verify a wheel with cosign, or ingest the schema'd JSON directly — see security & supply chain.

Sized for assembly

Eighteen Python packages with a strict dependency order. kaos-core sits underneath kaos-content; extraction modules sit on top. Siblings never import siblings, so installing one package never drags the rest in.

Agent-ready out of the box

Every installed module exposes its tools as MCP servers. Run kaos serve once and Claude Code, Codex, Cursor, Gemini CLI, and VS Code see the whole tool surface — not a wrapper bolted on top.

Modern Python, typed end to end

Python 3.13 minimum, validated on 3.13 and 3.14. Pydantic v2 throughout. The Rust hot paths cross the boundary through PyO3 and maturin, with no C-extension build dance.

Redistribution-clean

pypdfium2 instead of PyMuPDF. The embedding registry refuses to load model families with non-commercial or ambiguous licenses. A vendor or law firm can ship a KAOS-built product to clients without an AGPL audit blowing up the deal.

Built at 273 Ventures.