Skip to main content

CLI knowledge base manager for markdown wikis, designed for both humans and LLM agents

Project description

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

Project details


Download files

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

Source Distribution

llm_kasten-0.2.0.tar.gz (68.0 kB view details)

Uploaded Source

Built Distribution

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

llm_kasten-0.2.0-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

Details for the file llm_kasten-0.2.0.tar.gz.

File metadata

  • Download URL: llm_kasten-0.2.0.tar.gz
  • Upload date:
  • Size: 68.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llm_kasten-0.2.0.tar.gz
Algorithm Hash digest
SHA256 860d9950999a52c1ce2d34ff013e503d63e8a9d26ba49c26927bbbfbccaa0b54
MD5 26cb942c1975faadb8a89c987a2f432d
BLAKE2b-256 8c3f828ee8e67a385794ddb02df88f3151b809c282f25ab537acb5282abe5d15

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kasten-0.2.0.tar.gz:

Publisher: publish.yml on jordan-gibbs/llm-kasten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_kasten-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: llm_kasten-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 80.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llm_kasten-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75f1492dde76d1ede7d4e35708b93908ee57cb562872c5f51210d626473aa315
MD5 c7a60751a57d3d3415ee30a29481d069
BLAKE2b-256 bebd4d1df73b2d97d9cb2b31cd760e8b4da0f8b774889933a2822c87ba7c735e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_kasten-0.2.0-py3-none-any.whl:

Publisher: publish.yml on jordan-gibbs/llm-kasten

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page