Local-first knowledge system with sqlite-vec + ONNX embeddings. No cloud, no Docker, no PyTorch required.
Project description
Vault-for-LLM
Local-first memory for LLM agents.
Vault-for-LLM creates a portable SQLite knowledge vault for your projects and AI agents. Add Markdown notes, compile them into searchable structured memory, and let agents query the vault through the
vaultCLI or thevault-mcpserver.
Why this exists
LLM agents are powerful, but most of them forget project context between sessions. They lose decisions, repeated mistakes, user preferences, debugging history, and hard-won operational knowledge.
Vault-for-LLM gives an agent a simple local memory layer:
- You write knowledge as Markdown.
vault compilestores it in a local SQLite database.- Agents search it only when needed, instead of stuffing everything into every prompt.
- MCP-compatible agents can query the vault during a conversation.
The goal is not to replace your notes app. The goal is to make your notes usable by agents.
Core principles
- Local by default — SQLite is the source of truth. No cloud is required for core usage.
- Works without embeddings — keyword search works first; semantic search is optional.
- Agent-oriented memory — split always-needed facts from searchable deep knowledge.
- Bounded retrieval — Document Map tools help agents read the right section instead of dumping entire files into context.
- Optional sync — Supabase support is an optional sync/read target, not required infrastructure.
- Alpha, CLI-first — this is a developer-facing tool. Expect rough edges and evolving APIs.
What it can do
| Area | Capability |
|---|---|
| Knowledge storage | Markdown raw/ files compiled into local SQLite |
| Search | keyword search, optional vector search, hybrid search |
| Embeddings | optional ONNX Runtime or Ollama embeddings |
| Memory layers | L0 identity, L1 core facts, L2 recent context, L3 deep knowledge |
| Knowledge graph | inferred entities/edges and graph expansion |
| Document Map | section/claim navigation and bounded read_range citations |
| MCP | vault-mcp exposes search/add/stats/map/read tools to compatible agents |
| Quality tools | lint, freshness, convergence, cross-validation, dedup, Search QA snapshots |
| Optional remote sync | Supabase sync scripts for teams or remote read paths |
| Skill sharing | experimental skill marketplace commands under vault skill |
Architecture
L0 Identity → who the user/project is; loaded every session
L1 Core Facts → stable environment and project facts; loaded every session
L2 Recent Context → recent decisions, incidents, and working context
L3 Deep Knowledge → lessons, APIs, architecture, troubleshooting; searched on demand
Markdown raw/ → vault compile → SQLite database → vault search / MCP tools
This keeps the agent prompt small while still making deeper memory available when relevant.
Installation
Install from PyPI
python3 -m venv .venv
source .venv/bin/activate
pip install vault-for-llm
vault doctor
Optional semantic search
Keyword search works with the base install. For local ONNX embeddings:
pip install "vault-for-llm[semantic]"
vault install-embedding --model mix
Or use an existing Ollama embedding model:
vault config set embedding.provider ollama
vault config set embedding.model nomic-embed-text
Optional MCP server
pip install "vault-for-llm[mcp]"
vault-mcp --project-dir /path/to/your/project
Development install from source
git clone https://github.com/zycaskevin/Vault-for-LLM.git
cd Vault-for-LLM
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Quickstart
# 1. Create a vault in your project
vault init
# 2. Add a first knowledge entry
vault add "First lesson" --content "The bug was caused by X. The fix was Y."
# 3. Compile Markdown into the local SQLite vault
vault compile
# 4. Search it later
vault search "what caused the bug"
You can also add Markdown files directly under raw/ and run vault compile.
Example entry:
---
title: "Postgres migration pitfall"
category: "error"
layer: L3
tags: ["postgres", "migration"]
trust: 0.8
source: "project-notes"
created: "2026-05-16"
---
# Postgres migration pitfall
What broke, why it broke, and how to avoid it next time.
Directory structure
your-project/
├── L0-identity/ # user or project identity loaded every session
│ └── identity.md
├── L1-core-facts/ # stable facts loaded every session
│ └── current-projects.md
├── L2-context/ # recent context, decisions, incidents
│ └── recent-sessions/
├── L3-knowledge/ # deep knowledge organized for retrieval
├── raw/ # source Markdown knowledge entries
├── compiled/ # compiled / compressed knowledge artifacts
├── vault.db # local SQLite database generated by vault
└── templates/ # starter templates
CLI reference
| Command | Purpose |
|---|---|
vault init |
Initialize a project vault |
vault doctor |
Check local environment and optional dependencies |
vault add "Title" --content "..." |
Add one knowledge entry |
vault add "Title" --file note.md |
Add an entry from a Markdown file |
vault import long-doc.md |
Import and chunk a long document |
vault compile |
Compile raw/ into SQLite + compiled/ artifacts |
vault search "query" |
Search the vault |
vault search "query" --graph-expand 2 |
Search with graph expansion |
vault list |
List knowledge entries |
vault stats |
Show vault statistics |
vault lint |
Run quality checks |
vault map build |
Build/backfill Document Map rows |
vault map show <id> |
Show a knowledge entry's section map |
vault map read <id> --lines 10-30 |
Read a bounded source range |
vault graph build |
Build the inferred knowledge graph |
vault graph show |
Show graph statistics |
vault converge |
Experimental convergence/self-questioning check |
vault cross-validate |
Experimental cross-model validation |
vault freshness |
Experimental freshness/review scheduling |
vault dedup |
Detect or merge duplicate entries |
vault search-qa run |
Run Search QA metrics snapshot |
vault skill search "query" |
Search experimental skill marketplace entries |
Run vault <command> --help for command-specific options.
MCP integration
Install MCP extras and start the server:
pip install "vault-for-llm[mcp]"
vault-mcp --project-dir /path/to/your/project
Example MCP server config:
{
"mcpServers": {
"vault": {
"command": "vault-mcp",
"args": ["--project-dir", "/path/to/your/project"]
}
}
}
Current MCP tools include:
vault_searchvault_addvault_statsvault_map_showvault_read_rangevault_remote_map_show/vault_remote_read_rangewhen optional Supabase sync is configured
Optional Supabase sync
Core Vault-for-LLM usage is local-only. Supabase support is for teams or remote read paths that want a synced copy of local SQLite data.
The local SQLite database remains the source of truth. Supabase is a sync target.
# install manually while this is alpha
pip install supabase
# configure Supabase credentials in your environment, then run sync scripts as needed
python scripts/sync_to_supabase.py --document-map
Current maturity
Vault-for-LLM is alpha software:
- Internal package, module, database, and MCP tool names are Vault-branded.
- Advanced features such as convergence, cross-validation, Search QA, skills, and Supabase sync are evolving.
- The default install is available from PyPI; source installs are for development.
- APIs and schemas may change before a stable release.
If you want the most stable path, start with:
vault init
vault add
vault compile
vault search
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
python -m pytest -q
Some optional test paths require optional dependencies such as ONNX, MCP, or Supabase.
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 vault_for_llm-0.4.0.tar.gz.
File metadata
- Download URL: vault_for_llm-0.4.0.tar.gz
- Upload date:
- Size: 105.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a4ed50228c0552cbab9e6f3a0bfc99951ab407e00709f39aa5479a0af0c32a6
|
|
| MD5 |
3b3f1cd21169d829326711eadf1caa9f
|
|
| BLAKE2b-256 |
d3f3bf74b3a673bbac1cc0ebbfabc02b2cae6f7d05f3b84b8a8b1e5f2abcfb2c
|
File details
Details for the file vault_for_llm-0.4.0-py3-none-any.whl.
File metadata
- Download URL: vault_for_llm-0.4.0-py3-none-any.whl
- Upload date:
- Size: 85.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9277fb35a1c648629ed8c7e350a8760c3013ab58982ba0d72cd63a859ba8c76
|
|
| MD5 |
8d3f0cb99b97ffa82330c2fdb826e821
|
|
| BLAKE2b-256 |
2645f088912448b73a84fcd502b7cdd3c0ef4953e37ce655dc28088903f4a9b5
|