Context layer for the AI agents in a product (a SaaS, a consumer app, an internal tool): domain events in, a per-tenant bitemporal context graph out, shared by every agent through five MCP tools.
pip install keel-context==0.35.0 Copy PIP instructions
Stop rebuilding the pipeline for every agent.
Live demo · Docs · Hosted console (beta) · Why: We built four agents and four copies of our customer context
Keel is a context layer for the AI agents inside a product: a vertical SaaS, a consumer app, an internal tool. Domain events from your product go in; a bitemporal context graph per tenant comes out, whatever your unit is (an end-customer, a household, a team); every agent you build reads and writes it through the same five tools, over MCP, HTTP or a typed SDK.
You describe your vertical once, in a cartridge (ontology, event catalog, semantic rules, memory policies). Keel's core knows nothing about your domain. Your second agent connects in a day instead of weeks, because there is no second pipeline to write.
Try it in a minute, with an example cartridge and its events:
pip install keel-context keel init fleet --example fleet # also crm, clinics, finance keel context fleet fleet/events.jsonl unit:MXK-4821 Status: 0.35.0, alpha. Container: ghcr.io/angelkurten/keel. The five tools (plus query, an optional read-only SQL sixth, off by default) over MCP and an HTTP JSON API (/v1), Postgres, webhook, Kafka and SQS adapters, semantic search, consolidation, an agent registry and SDKs for TypeScript, Python, Go and PHP, on the in-memory store, SQLite (--db keel.db, stdlib, no server to run) or MySQL (--db mysql://...).
Every new agent in a product repeats the same work: extract the customer's data, normalize it, decide what "critical" means, keep its own memory, expose its own tools to the model. Four agents, four copies of the customer's context, four definitions of "critical", four memories that never talk.
Existing memory layers (Zep, Mem0, AgentCore Memory, Neo4j's MKG) ingest text and documents and model memory per user or per agent. None of them start from domain events, and none model the tenant your product already has: the end-customer of a B2B SaaS, the household of a consumer app, the team of an internal tool.
Every parameter is in the specification. query never sees another tenant, agent or task memory, or proposals, whatever SQL the agent writes (how).
search(mode="semantic") finds subjects by meaning: ids in the query first, then a dense and a lexical leg fused, then an optional reranker. Where vectors live and which model makes them are adapters you choose: in memory, Chroma, Weaviate, any OpenAI-compatible embeddings endpoint, or your own vector database and model (how, example).
Expose them over MCP (keel serve) and point any agent framework at them. Declare agents: in the cartridge and keel serve --agent binds a server to one of them: what it may read and write is enforced by the layer, not by the agent.
uv sync --extra dev uv run keel validate examples/fleet --events examples/fleet/events.jsonl uv run keel ingest examples/fleet examples/fleet/events.jsonl uv run keel context examples/fleet examples/fleet/events.jsonl unit:MXK-4821 Then write your own cartridge: see docs/first-cartridge.md (20 minutes). Settings (database, secret, embeddings keys) go in a .env: copy .env.example (reference).
In your own product it is a library: uv add keel-context (or pip install keel-context); the import is import keel. From another language, generate a typed client from your cartridge: keel sdk typescript|python|go|php examples/fleet -o , with a small runtime per language (see docs/sdks.md).
Run Keel on your product's events with your agents, with our help: your first pilot in a day is the path, with a time budget per step. Open a pilot request, book 30 minutes at calendar.app.google/3oKUSqXTQPYmjya56, or write to angel@angelkurten.com.
uv sync --extra mcp uv run keel serve examples/fleet --tenant acme-logistics --events examples/fleet/events.jsonl With Claude Code, one command registers it and the agent sees exactly five tools:
claude mcp add keel -- uv run --directory $PWD keel serve examples/fleet --tenant acme-logistics --events examples/fleet/events.jsonl Codex CLI (OpenAI) works the same way from ~/.codex/config.toml; the four read tools are annotated read-only, so it runs them without prompting. Both clients answered the same questions through the same five tools: see serve the tools. A backend, or many tenants from one process, use the same five as a JSON API: keel serve --transport http (/v1/context, /v1/events, ... with OpenAPI; tenant and agent per request).
Send your product's events from wherever they already are (how, for each):
keel export --db keel.db writes one tenant's whole audit trail as JSONL, closed facts and provenance included; keel import restores it, as it was, into an empty tenant of any store.
Every box, the options for each and when to pick which: docs/architecture.md.
keel/ core: envelope, handlers, store, scopes, cartridge loader, ingest, tools, cli cartridges/ your own cartridges (empty here) examples/ fleet (reference), crm, finance and clinics: four domains, one core, no core change between them; each a cartridge, its events and its test; fleet also has a minimal agent and a multi-agent workflow sdk/ SDK runtimes: typescript, go, php (the Python client ships in keel) evals/ the semantic-search eval bench docs/ site sources (mkdocs.yml at the root): architecture, first-cartridge, ingest, serve, sdks, operate, SPEC tests/ Roadmap A summary; the full plan, with what each release shipped, is in ROADMAP.md.
Keel: one deterministic context layer for product agents (PDF on Zenodo, source in docs/paper/). On 387 questions over three real Jira projects, with three agents, Keel leads the product's own API by 21 to 32 points on tenant-wide questions and is cheapest per correct answer; the harness and every result row are in evals/jira/.
@misc{kurten2026keel, author = {K{\"u}rten, Angel}, title = {Keel: one deterministic context layer for product agents}, year = {2026}, publisher = {Zenodo}, doi = {10.5281/zenodo.23571090}, url = {https://doi.org/10.5281/zenodo.23571090} } License Apache 2.0. The event envelope, the cartridge format and the five tools are the standard; they will always be free.
All 2 files in this release have provenance metadata.
chroma dev docs duckdb http http2 kafka mcp mysql postgres sqs weaviate webhook
agents bitemporal context event-driven knowledge-graph mcp
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
All 2 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




