Skip to main content

Capsule

Atomic knowledge for AI agents.

Capsule stores one fact per .capsule.md file. The search index is SQLite locally, or PostgreSQL when you run Docker.

Quick start

pip install korn
capsule init

From a clone:

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
capsule init
uvicorn services.api.main:app --host 127.0.0.1 --port 9100 --workers 1

In another terminal:

cd frontend
npm install
npm run dev
  • UI: http://localhost:5173
  • API: http://localhost:9100/api/v1
  • OpenAPI: http://localhost:9100/docs

Docker (Postgres + API + sync + UI):

./install.sh
  • UI: http://localhost:8080
  • API: http://localhost:9100

File format

---
id: 7c2a9f14-6b81-4d3e-9a0c-1f8e2b4d6c70
topic: "Auth middleware bypass in staging"
tags: [bug, auth, staging]
freshness: 2026-07-11T00:00:00
source: "incident-4482"
confidence: high
---

Staging skips JWT verification when `X-Debug-Override` is present.
This is intentional for E2E tests. Do not remove; mobile CI depends on it.

Creating a capsule via the UI, CLI, or API writes this file. Editing the file updates the index.

CLI

capsule new "Auth middleware bypass in staging" -t auth -t bug -c high
capsule search "JWT"
capsule compose -t auth -c medium -m 2000
capsule mcp    # stdio MCP server for agents

MCP

Point an MCP client at capsule mcp (stdio). Tools: search_capsules, compose_context, get_capsule, create_capsule, list_stale.

Architecture

One API process. It indexes CAPSULES_DIR on boot and watches for file changes. Do not run multiple uvicorn workers — SQLite plus the watcher assume a single writer.

See docs/ARCHITECTURE.md, docs/DEPLOY.md, and docs/API.md.

Tests

pytest

License

MIT

Metadata

Release files for korn 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for korn 0.3.0
File Size Uploaded
korn-0.3.0.tar.gz 29.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for korn 0.3.0
File Interpreter ABI Platform
korn-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.5 kB

Release files / korn-0.3.0.tar.gz

Download URL korn-0.3.0.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0ffad2e45e0c462f539db7c233e649e510a540f3af5308e22ea56ade7c28c26
BLAKE2b-256 checksum
How to use checksums
da321d3236b4394de5f2571ba29b55483198ab990649fff820bfaf825e2d49e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / korn-0.3.0-py3-none-any.whl

Download URL korn-0.3.0-py3-none-any.whl
Size 29.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24e644d48177fe4bd6258cd5f0f7cb6ef393aa392a5dfb660be098648e482044
BLAKE2b-256 checksum
How to use checksums
1c50af85b09bdf6c5e3a5f721661ce3f904ef4773c9d0af6ef5f1734f5d490a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page