Skip to main content

LLM-Kasten: Agentic Knowledge Management

https://github.com/user-attachments/assets/2a77c8d9-bf8d-447f-b9a9-cc367981721b

PyPI CI Python 3.11+ License: MIT

A CLI Zettelkasten for LLM coding agents. Markdown notes with [[wiki-links]], full-text search, a knowledge graph, and structured JSON output on every command.

Inspired by Andrej Karpathy's approach to building LLM-maintained personal knowledge bases from markdown.

pip install llm-kasten
kasten init .
kasten search "auth" -j   # structured JSON with full note bodies

How it works

kasten init adds a knowledge/ directory and a .kasten/ engine to your repo. It auto-injects usage docs into CLAUDE.md so agents discover the tool immediately.

your-repo/
  .kasten/             # Hidden: config, SQLite index
  knowledge/
    notes/             # Markdown notes (source of truth)
    index/             # Auto-generated wiki pages
  CLAUDE.md            # Agent docs (auto-injected)

Notes are plain markdown with YAML frontmatter. Kasten indexes them with SQLite FTS5, computes [[wiki-link]] backlinks, and rebuilds the index from files at any time (kasten sync --force). Files outlast tools.

Essential commands

kasten search "query" -j              # Full-text search, returns bodies
kasten note show <id> -j              # Read a note (or pass multiple IDs)
kasten note new "Title" --tag t \
  --body-file content.md \
  --summary "one-liner" -j            # Create with content from file
kasten note update <id> \
  --status evergreen --add-tag ml -j  # Update metadata
kasten repair -j                      # Fix links, promote notes, rebuild indexes

Every command returns {"ok": true, "data": {...}}. Append -j for JSON.

Full command reference

Agent integration

Kasten auto-injects a usage guide into agent config files at kasten init:

Flag File Agents
--agents claude (default) CLAUDE.md Claude Code
--agents agents AGENTS.md Cursor, Codex, Copilot, Windsurf, Amp, Devin
--agents gemini GEMINI.md Gemini CLI
--agents copilot .github/copilot-instructions.md GitHub Copilot

For agents that use MCP (Claude Desktop, Cursor inline):

pip install llm-kasten[mcp]
{"mcpServers": {"kasten": {"command": "kasten", "args": ["mcp"]}}}

8 read-only tools: search_notes, read_note, read_many, list_notes, get_backlinks, get_hubs, vault_status, lint_vault.

Knowledge graph

Notes link to each other with [[wiki-links]]. Kasten tracks backlinks, finds broken links, detects orphan notes, and ranks hub notes by inbound link count. kasten serve renders an interactive force-directed graph in the browser.

Note lifecycle

draft --> review --> evergreen --> stale --> deprecated --> archive

kasten repair auto-promotes notes that have a summary, tags, and 50+ words (draft to review), plus links and 100+ words (review to evergreen). It also auto-fills missing tags and summaries from note content.

Requirements

  • Python 3.11+
  • Works on Windows, macOS, Linux
  • SQLite with FTS5 (included in Python's bundled SQLite)

Contributing

See CONTRIBUTING.md.

License

MIT

Metadata

Release files for llm-kasten 0.2.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 llm-kasten 0.2.0
File Size Uploaded
llm_kasten-0.2.0.tar.gz 68.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-kasten 0.2.0
File Interpreter ABI Platform
llm_kasten-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 148.7 kB

Release files / llm_kasten-0.2.0.tar.gz

Download URL llm_kasten-0.2.0.tar.gz
Size 68.0 kB
Tags Source
SHA-256 checksum
How to use checksums
860d9950999a52c1ce2d34ff013e503d63e8a9d26ba49c26927bbbfbccaa0b54
BLAKE2b-256 checksum
How to use checksums
8c3f828ee8e67a385794ddb02df88f3151b809c282f25ab537acb5282abe5d15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

Release files / llm_kasten-0.2.0-py3-none-any.whl

Download URL llm_kasten-0.2.0-py3-none-any.whl
Size 80.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75f1492dde76d1ede7d4e35708b93908ee57cb562872c5f51210d626473aa315
BLAKE2b-256 checksum
How to use checksums
bebd4d1df73b2d97d9cb2b31cd760e8b4da0f8b774889933a2822c87ba7c735e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

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