# KAOS — Kelvin Agentic Operating System > Open-source Python platform for legal AI. MCP-native runtime + 18 packages + agent runtime + typed document AST with provenance. License: Apache-2.0 across all 18 packages. Built at 273 Ventures. ## Why KAOS - [Why KAOS](https://kelvin.legal/why-kaos): the seven architectural differences from proprietary legal-AI platforms and from generic OSS agentic frameworks. - [Compare](https://kelvin.legal/compare): named-competitor comparison — Harvey, CoCounsel, Lexis+, Westlaw, Everlaw, Luminance, Ironclad Jurist (proprietary); DSPy, LangChain, LangGraph, Pydantic-AI, Mirascope, Instructor (OSS agent frameworks); Mike OSS, OpenContracts, LQ.AI, doc.haus (open-source legal-AI apps — KAOS is the composable substrate beneath them). - [Security & supply chain](https://kelvin.legal/security): public kaos-compliance dashboard — SBOMs, PEP 740 + sigstore build attestations, license posture (0 GPL/AGPL), security scans; every claim links to reproducible evidence. Live: https://273v.github.io/kaos-compliance/ ## Surfaces - [Runtime](https://kelvin.legal/runtime): kaos-core + kaos-content + kaos-mcp — the MCP-native runtime every package builds on. - [Extraction](https://kelvin.legal/extraction): kaos-pdf, kaos-web, kaos-office, kaos-tabular, kaos-source — every document → ContentDocument AST. - [LLM](https://kelvin.legal/llm): kaos-llm-client + kaos-llm-core — typed LLM programs across seven providers. - [Agentic](https://kelvin.legal/agentic): kaos-agents — agent runtime, 15-section memory, and recipes for legal work. - [Legal Intelligence](https://kelvin.legal/legal-intelligence): kaos-citations + kaos-source — extract, resolve, verify legal citations end-to-end. - [Search & Retrieval](https://kelvin.legal/search-and-retrieval): kaos-nlp-core + kaos-nlp-transformers — Rust-powered BM25 + dense embeddings. ## Packages (18) The 18 public packages, matching the kaos-compliance tracked set. ~289 MCP tools across the suite; re-count via `kaos status --json | jq '.tools | length'` before pinning a number. - [kaos-core](https://273v.github.io/learn-kaos/reference/packages/) [Core]: The MCP-native runtime every other KAOS package builds on — types, tools, VFS, artifacts, and settings. (10 MCP tools) — `pip install kaos-core` - [kaos-content](https://273v.github.io/learn-kaos/reference/packages/) [Core]: The canonical document AST every extractor produces and every consumer reads — 34 Block/Inline node classes, all carrying provenance. (17 MCP tools) — `pip install kaos-content` - [kaos-mcp](https://273v.github.io/learn-kaos/reference/packages/) [Bridge]: FastMCP bridge for the platform — expose any KAOS runtime over MCP. Ships the unified `kaos` CLI. — `pip install kaos-mcp` - [kaos-nlp-core](https://273v.github.io/learn-kaos/reference/packages/) [Primitives]: Rust-powered NLP primitives — BM25, Punkt segmentation, string distances, Aho-Corasick, MinHash/LSH. (17 MCP tools) — `pip install kaos-nlp-core` - [kaos-graph](https://273v.github.io/learn-kaos/reference/packages/) [Primitives]: Rust-powered graph engine — 42 algorithms, first-class RDF/SPARQL, knowledge graphs. (17 MCP tools) — `pip install kaos-graph` - [kaos-pdf](https://273v.github.io/learn-kaos/reference/packages/) [Extraction]: PDF extraction with provenance on every paragraph, table, and OCR line — plus auto re-OCR of garbled scans, via Tesseract or a local ONNX engine. (7 MCP tools) — `pip install kaos-pdf` - [kaos-web](https://273v.github.io/learn-kaos/reference/packages/) [Extraction]: Web extraction, browser automation, search, and domain intelligence — for agents. (45 MCP tools) — `pip install kaos-web` - [kaos-office](https://273v.github.io/learn-kaos/reference/packages/) [Extraction]: DOCX, PPTX, XLSX — read, write, and redline into the same document AST, with embedded images inlined as data URIs. (18 MCP tools) — `pip install kaos-office` - [kaos-tabular](https://273v.github.io/learn-kaos/reference/packages/) [Extraction]: DuckDB-powered SQL over CSV, Parquet, JSON, XLSX, and SQLite — agent-ready analytics on legal data. (17 MCP tools) — `pip install kaos-tabular` - [kaos-source](https://273v.github.io/learn-kaos/reference/packages/) [Data]: Government, financial, and forensic data sources — Federal Register, eCFR, EDGAR, GovInfo, GLEIF, PACER. (30 MCP tools) — `pip install kaos-source` - [kaos-llm-client](https://273v.github.io/learn-kaos/reference/packages/) [LLM]: One LLM client, many providers — async-first, streaming, retries, structured output, per-call cost estimates. (7 MCP tools) — `pip install kaos-llm-client` - [kaos-llm-core](https://273v.github.io/learn-kaos/reference/packages/) [LLM]: Typed, composable, optimizable LLM programs — signatures, codecs, optimizers, plus vision tools that OCR, describe, and classify page images. A DSPy descendant. (35 MCP tools) — `pip install kaos-llm-core` - [kaos-ml-core](https://273v.github.io/learn-kaos/reference/packages/) [ML]: Classical ML on the document AST — corpus, clustering, labeling, logistic regression, calibrated thresholds. (11 MCP tools) — `pip install kaos-ml-core` - [kaos-nlp-transformers](https://273v.github.io/learn-kaos/reference/packages/) [ML]: Dense embeddings, reranking, NLI, NER, and PII detection — Rust ONNX backend, no runtime PyTorch. — `pip install kaos-nlp-transformers` - [kaos-citations](https://273v.github.io/learn-kaos/reference/packages/) [Legal]: Extract, resolve, and verify legal, financial, and accounting citations — ~60 kinds, deterministic, AST-grounded. (3 MCP tools) — `pip install kaos-citations` - [kaos-agents](https://273v.github.io/learn-kaos/reference/packages/) [Agentic]: Agent runtime for legal work — session memory, patterns, recipes, cost accounting, grounded findings, and tiered OCR that escalates hard scans to a vision model. (14 MCP tools) — `pip install kaos-agents` - [kaos-ui](https://273v.github.io/learn-kaos/reference/packages/) [Tooling]: Scaffold KAOS apps and build agent chat UIs — six Python project templates plus a React 19 component library. (4 MCP tools) — `pip install kaos-ui` - [kaos-names](https://273v.github.io/learn-kaos/reference/packages/) [Tooling]: Friendly, legal-flavored handles for sessions, agents, and traces — zero dependencies, deterministic when seeded. — `pip install kaos-names` ## Concepts - [MCP-native architecture](https://kelvin.legal/concepts/mcp-native) - [The ContentDocument AST](https://kelvin.legal/concepts/document-ast) - [Provenance and grounding](https://kelvin.legal/concepts/provenance) - [Planning + extraction recipes](https://kelvin.legal/concepts/recipes) - [SessionMemory model](https://kelvin.legal/concepts/memory) - [Dependency layering](https://kelvin.legal/concepts/dependency-layering) ## Quickstart and examples - [Quickstart](https://kelvin.legal/quickstart): five steps from install to first real workflow. - [Contract extraction](https://kelvin.legal/examples/contract-extract) - [Deal-room research](https://kelvin.legal/examples/deal-room-research) - [EPA enforcement tracker](https://kelvin.legal/examples/epa-tracker) - [Cost dashboard](https://kelvin.legal/examples/cost-dashboard) - [Publishable MCP server](https://kelvin.legal/examples/publishable-mcp) ## Audience - [For developers](https://kelvin.legal/for-developers): Python developers building grounded, verifiable, cost-aware apps. - [For legal teams](https://kelvin.legal/for-legal-teams): lawyers, paralegals, analysts vibe-coding with Claude Code. ## Publications - [Vibe Coding with KAOS](https://kelvin.legal/publications/vibe-coding-with-kaos): book for legal/finance professionals (Q3 2026). - [Building AI Applications with KAOS](https://kelvin.legal/publications/building-with-kaos): practitioner guide for developers (Q3 2026). - [LLM Essentials for Law and Finance](https://ai4lf.com/): conceptual canon (print). - [Agentic AI in Law and Finance](https://ai4lf.com/): conceptual canon (print). ## Project - [About](https://kelvin.legal/about): team, license, ALEA Institute relationship. - [Community](https://kelvin.legal/community): GitHub Discussions for Q&A, ideas, recipes. - [Blog](https://kelvin.legal/blog): release notes, deep dives, retros. - [Source code](https://github.com/273v): the canonical repo. - [Privacy](https://kelvin.legal/privacy) · [Terms](https://kelvin.legal/terms)