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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file korn-0.3.0.tar.gz.
File metadata
- Download URL: korn-0.3.0.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ffad2e45e0c462f539db7c233e649e510a540f3af5308e22ea56ade7c28c26
|
|
| MD5 |
2955476bb3b786549d4e5e4b276b000b
|
|
| BLAKE2b-256 |
da321d3236b4394de5f2571ba29b55483198ab990649fff820bfaf825e2d49e7
|
File details
Details for the file korn-0.3.0-py3-none-any.whl.
File metadata
- Download URL: korn-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24e644d48177fe4bd6258cd5f0f7cb6ef393aa392a5dfb660be098648e482044
|
|
| MD5 |
f252eefa6d887d91d3e3d3231910ac86
|
|
| BLAKE2b-256 |
1c50af85b09bdf6c5e3a5f721661ce3f904ef4773c9d0af6ef5f1734f5d490a8
|