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 # or: pip install pykorn
capsule init # or: korn init / pykorn 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 pykorn 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pykorn-0.3.0.tar.gz | 29.4 kB | Without provenance | Details for pykorn-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pykorn-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for pykorn-0.3.0-py3-none-any.whl |
Total release size: 58.6 kB
Release files / pykorn-0.3.0.tar.gz
| Download URL | pykorn-0.3.0.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d96144bffb069ce634b89a873516d53edec456a78c9e341e354244d5e07792a
|
|
BLAKE2b-256 checksum How to use checksums |
7f4ac6be9fed628334308030b898378b65b53cba8150ad17a52e2605f2dff00d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Release files / pykorn-0.3.0-py3-none-any.whl
| Download URL | pykorn-0.3.0-py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0df2f72c7f19ffbee14f70223704bf1be7a63e5099d255fc6c6bcc653a04d09c
|
|
BLAKE2b-256 checksum How to use checksums |
6b77bd0e2a7dd78c916767bc334ec13781c4b19ddf3399fe256ef6e7c35fe056
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for pykorn 0.3.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.