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      # 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykorn-0.3.0.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykorn-0.3.0-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file pykorn-0.3.0.tar.gz.

File metadata

  • Download URL: pykorn-0.3.0.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for pykorn-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9d96144bffb069ce634b89a873516d53edec456a78c9e341e354244d5e07792a
MD5 b17dc82d5cb32c4b07a032f40de25fdb
BLAKE2b-256 7f4ac6be9fed628334308030b898378b65b53cba8150ad17a52e2605f2dff00d

See more details on using hashes here.

File details

Details for the file pykorn-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pykorn-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

Hashes for pykorn-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0df2f72c7f19ffbee14f70223704bf1be7a63e5099d255fc6c6bcc653a04d09c
MD5 5570426fcc0cef8f8003d32bcaee4088
BLAKE2b-256 6b77bd0e2a7dd78c916767bc334ec13781c4b19ddf3399fe256ef6e7c35fe056

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 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