CLI-first personal knowledge base for AI agents — structured, navigable, zero extra cost
Project description
kvault
Tell your AI agent to build you a knowledge base. That's it.
pip install knowledgevault
kvault gives your coding agent persistent, structured memory. It runs as a CLI tool that any agent can call via shell — Claude Code, OpenAI Codex, Cursor, or any tool that can execute commands. No extra API keys. No extra cost.
Your agent creates entities (people, projects, notes), navigates the hierarchy via parent summaries, and keeps everything in sync — all through simple CLI commands.
Who is this for?
Developers using Claude Code, OpenAI Codex, Cursor, VS Code + Copilot, or any AI coding tool who want their agent to remember things between sessions — contacts, projects, meeting notes, research — in a structured, navigable format.
What makes it different?
| kvault | Anthropic memory server | Notion AI / Mem.ai | obsidian-claude-pkm | |
|---|---|---|---|---|
| Structure | Hierarchical entities with navigable tree | Flat JSON | Rich docs, flat search | Obsidian vault |
| Agent-native | CLI commands, works in any subprocess | 4 MCP tools, basic | Chat sidebar | Template, not runtime |
| Cost | $0 (uses existing subscription) | $0 | $12-20/mo extra | $0 |
| Navigation | Parent summaries at every level | None | AI-generated | Manual |
| Search | Agent uses its own Grep/Glob/Read | Built-in | Built-in | Manual |
Quickstart (30 seconds)
1. Install
pip install knowledgevault
2. Initialize a knowledge base
kvault init ./my_kb --name "Your Name"
3. Tell your agent
"Use kvault CLI commands to manage my knowledge base at ./my_kb"
Your agent reads the generated CLAUDE.md for workflow instructions and starts working.
Try it: import your ChatGPT history
The best way to see kvault in action is to point it at data you already have. ChatGPT lets you export your entire conversation history — years of questions, people mentioned, projects discussed, decisions made — and your agent can turn it into a structured, navigable knowledge base in minutes.
1. Export your ChatGPT data
Go to ChatGPT → Settings → Data controls → Export data. You'll get an email with a zip file containing conversations.json.
2. Unzip it into your KB
unzip chatgpt-export.zip -d my_kb/sources/chatgpt
3. Tell your agent to process it
Read through my ChatGPT export in sources/chatgpt/conversations.json.
Extract the people, projects, and ideas I've discussed most frequently.
Create entities for each one in the knowledge base.
Your agent will use kvault CLI commands to create structured entries with frontmatter and propagate summaries.
The 2-call write workflow
# Call 1: Write entity (stdin = frontmatter + markdown body)
kvault write people/contacts/acme --create --reasoning "New customer" --json <<'EOF'
---
source: meeting_2026-02-25
aliases: [ACME Corp]
---
# ACME Corp
Key customer acquired at trade show...
EOF
# → {"success": true, "ancestors": [{path, current_content, has_meta}, ...]}
# Call 2: Agent reads ancestors, composes updated summaries
kvault update-summaries --json <<'EOF'
[
{"path": "people/contacts", "content": "# Contacts\n...updated..."},
{"path": "people", "content": "# People\n...updated..."}
]
EOF
# → {"success": true, "updated": ["people/contacts", "people"], "count": 2}
What an entity looks like
Each entity is a directory with a single _summary.md file containing YAML frontmatter:
---
created: 2026-02-06
updated: 2026-02-06
source: manual
aliases: [Sarah Chen, sarah@anthropic.com]
email: sarah@anthropic.com
---
# Sarah Chen
Research scientist at Anthropic working on causal discovery.
Required frontmatter: source, aliases (kvault sets created/updated automatically)
What a knowledge base looks like
my_kb/
├── _summary.md # Root: executive overview
├── CLAUDE.md # Agent workflow instructions
├── people/
│ ├── _summary.md # "12 contacts across 3 categories"
│ ├── family/
│ │ └── _summary.md
│ ├── friends/
│ │ ├── _summary.md
│ │ └── alex_rivera/
│ │ └── _summary.md
│ └── contacts/
│ ├── _summary.md
│ └── sarah_chen/
│ └── _summary.md
├── projects/
│ ├── _summary.md
│ └── cje_paper/
│ └── _summary.md
├── journal/
│ └── 2026-02/
│ └── log.md
└── .kvault/
└── logs.db # Observability
CLI commands
| Category | Commands |
|---|---|
| Entity | kvault read, kvault write, kvault list, kvault delete, kvault move |
| Summary | kvault read-summary, kvault write-summary, kvault update-summaries, kvault ancestors |
| Journal | kvault journal |
| Status | kvault status, kvault tree |
| Validation | kvault validate, kvault check |
| Init | kvault init |
All commands support --json for machine-readable output. --kb-root overrides auto-detection.
Optional root pinning (multi-tenant hardening)
For shared runtimes, pin allowed roots:
export KVAULT_ALLOWED_ROOTS="/Users/mossbot/personal_kb"
Python API
from pathlib import Path
from kvault.core import operations as ops
kg_root = Path("my_kb")
# Read/write entities
entity = ops.read_entity(kg_root, "people/contacts/sarah_chen")
result = ops.write_entity(kg_root, "people/contacts/new_person", "# Content", create=True)
# Scan and search
from kvault import scan_entities, EntityResearcher
entities = scan_entities(kg_root)
researcher = EntityResearcher(kg_root)
action, target, confidence = researcher.suggest_action("Sarah Chen")
Integrity hook
Catch stale summaries before each prompt:
{
"hooks": {
"UserPromptSubmit": [
{
"type": "command",
"command": "kvault check --kb-root /absolute/path/to/my_kb"
}
]
}
}
Development
pip install -e ".[dev]"
pytest
ruff check . && black . && mypy .
License
MIT
Project details
Release history Release notifications | RSS feed
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 knowledgevault-0.7.0.tar.gz.
File metadata
- Download URL: knowledgevault-0.7.0.tar.gz
- Upload date:
- Size: 49.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27115c2493526be3bc0f48b64be7cbf6605c2c197145a8da9f1a4bb99e779133
|
|
| MD5 |
622f0260ed35949ec205e16a54b4cb5e
|
|
| BLAKE2b-256 |
7ba386c37fcd130b4e40a2ef04546c85bf4ae1ae22de60f41ef0a4ae70cb3001
|
Provenance
The following attestation bundles were made for knowledgevault-0.7.0.tar.gz:
Publisher:
publish.yml on cimo-labs/kvault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knowledgevault-0.7.0.tar.gz -
Subject digest:
27115c2493526be3bc0f48b64be7cbf6605c2c197145a8da9f1a4bb99e779133 - Sigstore transparency entry: 995145286
- Sigstore integration time:
-
Permalink:
cimo-labs/kvault@21a8b9ae06100910f653cf8147311790c5d5d747 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/cimo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@21a8b9ae06100910f653cf8147311790c5d5d747 -
Trigger Event:
push
-
Statement type:
File details
Details for the file knowledgevault-0.7.0-py3-none-any.whl.
File metadata
- Download URL: knowledgevault-0.7.0-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76bb1c018c6c97f6de7cfd06fe3157b3d5c91f2ccd7df84d8c12eb52b6fb68df
|
|
| MD5 |
6919df9e4da483e4a868e08717e9ac27
|
|
| BLAKE2b-256 |
544b5ecb05233ac85fd60331403a06f1bc6c8ccf44eca7975e5029e814577d1d
|
Provenance
The following attestation bundles were made for knowledgevault-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on cimo-labs/kvault
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
knowledgevault-0.7.0-py3-none-any.whl -
Subject digest:
76bb1c018c6c97f6de7cfd06fe3157b3d5c91f2ccd7df84d8c12eb52b6fb68df - Sigstore transparency entry: 995145289
- Sigstore integration time:
-
Permalink:
cimo-labs/kvault@21a8b9ae06100910f653cf8147311790c5d5d747 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/cimo-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@21a8b9ae06100910f653cf8147311790c5d5d747 -
Trigger Event:
push
-
Statement type: