vault-for-llm 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vault_for_llm-0.4.0/LICENSE +17 -0
- vault_for_llm-0.4.0/PKG-INFO +320 -0
- vault_for_llm-0.4.0/README.md +286 -0
- vault_for_llm-0.4.0/pyproject.toml +61 -0
- vault_for_llm-0.4.0/setup.cfg +4 -0
- vault_for_llm-0.4.0/tests/test_agent_behavior_policy.py +163 -0
- vault_for_llm-0.4.0/tests/test_document_map.py +638 -0
- vault_for_llm-0.4.0/tests/test_document_map_cli.py +283 -0
- vault_for_llm-0.4.0/tests/test_e2e.py +342 -0
- vault_for_llm-0.4.0/tests/test_lite.py +195 -0
- vault_for_llm-0.4.0/tests/test_new_features.py +170 -0
- vault_for_llm-0.4.0/tests/test_search_map_integration.py +124 -0
- vault_for_llm-0.4.0/tests/test_search_quality_metrics.py +305 -0
- vault_for_llm-0.4.0/tests/test_sprint4a_document_map_sync.py +249 -0
- vault_for_llm-0.4.0/tests/test_vault_health_metrics.py +300 -0
- vault_for_llm-0.4.0/tests/test_vault_mcp_map.py +500 -0
- vault_for_llm-0.4.0/vault/__init__.py +11 -0
- vault_for_llm-0.4.0/vault/agent_policy.py +231 -0
- vault_for_llm-0.4.0/vault/cli.py +1511 -0
- vault_for_llm-0.4.0/vault/compiler.py +727 -0
- vault_for_llm-0.4.0/vault/db.py +941 -0
- vault_for_llm-0.4.0/vault/docmap.py +293 -0
- vault_for_llm-0.4.0/vault/embed.py +329 -0
- vault_for_llm-0.4.0/vault/graph.py +506 -0
- vault_for_llm-0.4.0/vault/health.py +172 -0
- vault_for_llm-0.4.0/vault/importer.py +860 -0
- vault_for_llm-0.4.0/vault/llm.py +357 -0
- vault_for_llm-0.4.0/vault/log.py +50 -0
- vault_for_llm-0.4.0/vault/mcp.py +1309 -0
- vault_for_llm-0.4.0/vault/search.py +623 -0
- vault_for_llm-0.4.0/vault/search_qa.py +398 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/PKG-INFO +320 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/SOURCES.txt +35 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/dependency_links.txt +1 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/entry_points.txt +3 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/requires.txt +16 -0
- vault_for_llm-0.4.0/vault_for_llm.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2026 Vault Contributors
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all
|
|
10
|
+
copies or substantial portions of the Software.
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
12
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
13
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
14
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
15
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
16
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
17
|
+
SOFTWARE.
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vault-for-llm
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Local-first knowledge system with sqlite-vec + ONNX embeddings. No cloud, no Docker, no PyTorch required.
|
|
5
|
+
Author: Vault-for-LLM Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: knowledge-base,vector-search,sqlite,onnx,embeddings,local-first
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Database
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: pyyaml>=6.0
|
|
21
|
+
Requires-Dist: sqlite-vec<1.0,>=0.1.6
|
|
22
|
+
Provides-Extra: semantic
|
|
23
|
+
Requires-Dist: onnxruntime<2.0,>=1.16; extra == "semantic"
|
|
24
|
+
Requires-Dist: optimum[onnxruntime]<3.0,>=2.0; extra == "semantic"
|
|
25
|
+
Requires-Dist: transformers<5.0,>=4.35; extra == "semantic"
|
|
26
|
+
Requires-Dist: sentencepiece>=0.1; extra == "semantic"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: ruff>=0.1; extra == "dev"
|
|
30
|
+
Provides-Extra: mcp
|
|
31
|
+
Requires-Dist: mcp>=1.0; extra == "mcp"
|
|
32
|
+
Requires-Dist: anthropic<1.0,>=0.30; extra == "mcp"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# Vault-for-LLM
|
|
36
|
+
|
|
37
|
+
**English | [繁體中文](README.zh-Hant.md) | [简体中文](README.zh-CN.md)**
|
|
38
|
+
|
|
39
|
+
> Local-first memory for LLM agents.
|
|
40
|
+
>
|
|
41
|
+
> 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 `vault` CLI or the `vault-mcp` server.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Why this exists
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
Vault-for-LLM gives an agent a simple local memory layer:
|
|
50
|
+
|
|
51
|
+
1. You write knowledge as Markdown.
|
|
52
|
+
2. `vault compile` stores it in a local SQLite database.
|
|
53
|
+
3. Agents search it only when needed, instead of stuffing everything into every prompt.
|
|
54
|
+
4. MCP-compatible agents can query the vault during a conversation.
|
|
55
|
+
|
|
56
|
+
The goal is not to replace your notes app. The goal is to make your notes **usable by agents**.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Core principles
|
|
61
|
+
|
|
62
|
+
- **Local by default** — SQLite is the source of truth. No cloud is required for core usage.
|
|
63
|
+
- **Works without embeddings** — keyword search works first; semantic search is optional.
|
|
64
|
+
- **Agent-oriented memory** — split always-needed facts from searchable deep knowledge.
|
|
65
|
+
- **Bounded retrieval** — Document Map tools help agents read the right section instead of dumping entire files into context.
|
|
66
|
+
- **Optional sync** — Supabase support is an optional sync/read target, not required infrastructure.
|
|
67
|
+
- **Alpha, CLI-first** — this is a developer-facing tool. Expect rough edges and evolving APIs.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## What it can do
|
|
72
|
+
|
|
73
|
+
| Area | Capability |
|
|
74
|
+
|---|---|
|
|
75
|
+
| Knowledge storage | Markdown `raw/` files compiled into local SQLite |
|
|
76
|
+
| Search | keyword search, optional vector search, hybrid search |
|
|
77
|
+
| Embeddings | optional ONNX Runtime or Ollama embeddings |
|
|
78
|
+
| Memory layers | L0 identity, L1 core facts, L2 recent context, L3 deep knowledge |
|
|
79
|
+
| Knowledge graph | inferred entities/edges and graph expansion |
|
|
80
|
+
| Document Map | section/claim navigation and bounded `read_range` citations |
|
|
81
|
+
| MCP | `vault-mcp` exposes search/add/stats/map/read tools to compatible agents |
|
|
82
|
+
| Quality tools | lint, freshness, convergence, cross-validation, dedup, Search QA snapshots |
|
|
83
|
+
| Optional remote sync | Supabase sync scripts for teams or remote read paths |
|
|
84
|
+
| Skill sharing | experimental skill marketplace commands under `vault skill` |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Architecture
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
L0 Identity → who the user/project is; loaded every session
|
|
92
|
+
L1 Core Facts → stable environment and project facts; loaded every session
|
|
93
|
+
L2 Recent Context → recent decisions, incidents, and working context
|
|
94
|
+
L3 Deep Knowledge → lessons, APIs, architecture, troubleshooting; searched on demand
|
|
95
|
+
|
|
96
|
+
Markdown raw/ → vault compile → SQLite database → vault search / MCP tools
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This keeps the agent prompt small while still making deeper memory available when relevant.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Installation
|
|
104
|
+
|
|
105
|
+
### Install from PyPI
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
python3 -m venv .venv
|
|
109
|
+
source .venv/bin/activate
|
|
110
|
+
pip install vault-for-llm
|
|
111
|
+
|
|
112
|
+
vault doctor
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Optional semantic search
|
|
116
|
+
|
|
117
|
+
Keyword search works with the base install. For local ONNX embeddings:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pip install "vault-for-llm[semantic]"
|
|
121
|
+
vault install-embedding --model mix
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Or use an existing Ollama embedding model:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
vault config set embedding.provider ollama
|
|
128
|
+
vault config set embedding.model nomic-embed-text
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Optional MCP server
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pip install "vault-for-llm[mcp]"
|
|
135
|
+
vault-mcp --project-dir /path/to/your/project
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Development install from source
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/zycaskevin/Vault-for-LLM.git
|
|
142
|
+
cd Vault-for-LLM
|
|
143
|
+
python3 -m venv .venv
|
|
144
|
+
source .venv/bin/activate
|
|
145
|
+
pip install -e ".[dev]"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Quickstart
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. Create a vault in your project
|
|
154
|
+
vault init
|
|
155
|
+
|
|
156
|
+
# 2. Add a first knowledge entry
|
|
157
|
+
vault add "First lesson" --content "The bug was caused by X. The fix was Y."
|
|
158
|
+
|
|
159
|
+
# 3. Compile Markdown into the local SQLite vault
|
|
160
|
+
vault compile
|
|
161
|
+
|
|
162
|
+
# 4. Search it later
|
|
163
|
+
vault search "what caused the bug"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
You can also add Markdown files directly under `raw/` and run `vault compile`.
|
|
167
|
+
|
|
168
|
+
Example entry:
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
---
|
|
172
|
+
title: "Postgres migration pitfall"
|
|
173
|
+
category: "error"
|
|
174
|
+
layer: L3
|
|
175
|
+
tags: ["postgres", "migration"]
|
|
176
|
+
trust: 0.8
|
|
177
|
+
source: "project-notes"
|
|
178
|
+
created: "2026-05-16"
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
# Postgres migration pitfall
|
|
182
|
+
|
|
183
|
+
What broke, why it broke, and how to avoid it next time.
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Directory structure
|
|
189
|
+
|
|
190
|
+
```text
|
|
191
|
+
your-project/
|
|
192
|
+
├── L0-identity/ # user or project identity loaded every session
|
|
193
|
+
│ └── identity.md
|
|
194
|
+
├── L1-core-facts/ # stable facts loaded every session
|
|
195
|
+
│ └── current-projects.md
|
|
196
|
+
├── L2-context/ # recent context, decisions, incidents
|
|
197
|
+
│ └── recent-sessions/
|
|
198
|
+
├── L3-knowledge/ # deep knowledge organized for retrieval
|
|
199
|
+
├── raw/ # source Markdown knowledge entries
|
|
200
|
+
├── compiled/ # compiled / compressed knowledge artifacts
|
|
201
|
+
├── vault.db # local SQLite database generated by vault
|
|
202
|
+
└── templates/ # starter templates
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## CLI reference
|
|
206
|
+
|
|
207
|
+
| Command | Purpose |
|
|
208
|
+
|---|---|
|
|
209
|
+
| `vault init` | Initialize a project vault |
|
|
210
|
+
| `vault doctor` | Check local environment and optional dependencies |
|
|
211
|
+
| `vault add "Title" --content "..."` | Add one knowledge entry |
|
|
212
|
+
| `vault add "Title" --file note.md` | Add an entry from a Markdown file |
|
|
213
|
+
| `vault import long-doc.md` | Import and chunk a long document |
|
|
214
|
+
| `vault compile` | Compile `raw/` into SQLite + `compiled/` artifacts |
|
|
215
|
+
| `vault search "query"` | Search the vault |
|
|
216
|
+
| `vault search "query" --graph-expand 2` | Search with graph expansion |
|
|
217
|
+
| `vault list` | List knowledge entries |
|
|
218
|
+
| `vault stats` | Show vault statistics |
|
|
219
|
+
| `vault lint` | Run quality checks |
|
|
220
|
+
| `vault map build` | Build/backfill Document Map rows |
|
|
221
|
+
| `vault map show <id>` | Show a knowledge entry's section map |
|
|
222
|
+
| `vault map read <id> --lines 10-30` | Read a bounded source range |
|
|
223
|
+
| `vault graph build` | Build the inferred knowledge graph |
|
|
224
|
+
| `vault graph show` | Show graph statistics |
|
|
225
|
+
| `vault converge` | Experimental convergence/self-questioning check |
|
|
226
|
+
| `vault cross-validate` | Experimental cross-model validation |
|
|
227
|
+
| `vault freshness` | Experimental freshness/review scheduling |
|
|
228
|
+
| `vault dedup` | Detect or merge duplicate entries |
|
|
229
|
+
| `vault search-qa run` | Run Search QA metrics snapshot |
|
|
230
|
+
| `vault skill search "query"` | Search experimental skill marketplace entries |
|
|
231
|
+
|
|
232
|
+
Run `vault <command> --help` for command-specific options.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## MCP integration
|
|
237
|
+
|
|
238
|
+
Install MCP extras and start the server:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
pip install "vault-for-llm[mcp]"
|
|
242
|
+
vault-mcp --project-dir /path/to/your/project
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Example MCP server config:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"mcpServers": {
|
|
250
|
+
"vault": {
|
|
251
|
+
"command": "vault-mcp",
|
|
252
|
+
"args": ["--project-dir", "/path/to/your/project"]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Current MCP tools include:
|
|
259
|
+
|
|
260
|
+
- `vault_search`
|
|
261
|
+
- `vault_add`
|
|
262
|
+
- `vault_stats`
|
|
263
|
+
- `vault_map_show`
|
|
264
|
+
- `vault_read_range`
|
|
265
|
+
- `vault_remote_map_show` / `vault_remote_read_range` when optional Supabase sync is configured
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Optional Supabase sync
|
|
270
|
+
|
|
271
|
+
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.
|
|
272
|
+
|
|
273
|
+
The local SQLite database remains the source of truth. Supabase is a sync target.
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# install manually while this is alpha
|
|
277
|
+
pip install supabase
|
|
278
|
+
|
|
279
|
+
# configure Supabase credentials in your environment, then run sync scripts as needed
|
|
280
|
+
python scripts/sync_to_supabase.py --document-map
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Current maturity
|
|
286
|
+
|
|
287
|
+
Vault-for-LLM is alpha software:
|
|
288
|
+
|
|
289
|
+
- Internal package, module, database, and MCP tool names are Vault-branded.
|
|
290
|
+
- Advanced features such as convergence, cross-validation, Search QA, skills, and Supabase sync are evolving.
|
|
291
|
+
- The default install is available from PyPI; source installs are for development.
|
|
292
|
+
- APIs and schemas may change before a stable release.
|
|
293
|
+
|
|
294
|
+
If you want the most stable path, start with:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
vault init
|
|
298
|
+
vault add
|
|
299
|
+
vault compile
|
|
300
|
+
vault search
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Development
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
python3 -m venv .venv
|
|
309
|
+
source .venv/bin/activate
|
|
310
|
+
pip install -e ".[dev]"
|
|
311
|
+
python -m pytest -q
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Some optional test paths require optional dependencies such as ONNX, MCP, or Supabase.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## License
|
|
319
|
+
|
|
320
|
+
MIT
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# Vault-for-LLM
|
|
2
|
+
|
|
3
|
+
**English | [繁體中文](README.zh-Hant.md) | [简体中文](README.zh-CN.md)**
|
|
4
|
+
|
|
5
|
+
> Local-first memory for LLM agents.
|
|
6
|
+
>
|
|
7
|
+
> 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 `vault` CLI or the `vault-mcp` server.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why this exists
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
Vault-for-LLM gives an agent a simple local memory layer:
|
|
16
|
+
|
|
17
|
+
1. You write knowledge as Markdown.
|
|
18
|
+
2. `vault compile` stores it in a local SQLite database.
|
|
19
|
+
3. Agents search it only when needed, instead of stuffing everything into every prompt.
|
|
20
|
+
4. MCP-compatible agents can query the vault during a conversation.
|
|
21
|
+
|
|
22
|
+
The goal is not to replace your notes app. The goal is to make your notes **usable by agents**.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Core principles
|
|
27
|
+
|
|
28
|
+
- **Local by default** — SQLite is the source of truth. No cloud is required for core usage.
|
|
29
|
+
- **Works without embeddings** — keyword search works first; semantic search is optional.
|
|
30
|
+
- **Agent-oriented memory** — split always-needed facts from searchable deep knowledge.
|
|
31
|
+
- **Bounded retrieval** — Document Map tools help agents read the right section instead of dumping entire files into context.
|
|
32
|
+
- **Optional sync** — Supabase support is an optional sync/read target, not required infrastructure.
|
|
33
|
+
- **Alpha, CLI-first** — this is a developer-facing tool. Expect rough edges and evolving APIs.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## What it can do
|
|
38
|
+
|
|
39
|
+
| Area | Capability |
|
|
40
|
+
|---|---|
|
|
41
|
+
| Knowledge storage | Markdown `raw/` files compiled into local SQLite |
|
|
42
|
+
| Search | keyword search, optional vector search, hybrid search |
|
|
43
|
+
| Embeddings | optional ONNX Runtime or Ollama embeddings |
|
|
44
|
+
| Memory layers | L0 identity, L1 core facts, L2 recent context, L3 deep knowledge |
|
|
45
|
+
| Knowledge graph | inferred entities/edges and graph expansion |
|
|
46
|
+
| Document Map | section/claim navigation and bounded `read_range` citations |
|
|
47
|
+
| MCP | `vault-mcp` exposes search/add/stats/map/read tools to compatible agents |
|
|
48
|
+
| Quality tools | lint, freshness, convergence, cross-validation, dedup, Search QA snapshots |
|
|
49
|
+
| Optional remote sync | Supabase sync scripts for teams or remote read paths |
|
|
50
|
+
| Skill sharing | experimental skill marketplace commands under `vault skill` |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Architecture
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
L0 Identity → who the user/project is; loaded every session
|
|
58
|
+
L1 Core Facts → stable environment and project facts; loaded every session
|
|
59
|
+
L2 Recent Context → recent decisions, incidents, and working context
|
|
60
|
+
L3 Deep Knowledge → lessons, APIs, architecture, troubleshooting; searched on demand
|
|
61
|
+
|
|
62
|
+
Markdown raw/ → vault compile → SQLite database → vault search / MCP tools
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This keeps the agent prompt small while still making deeper memory available when relevant.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
|
|
71
|
+
### Install from PyPI
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python3 -m venv .venv
|
|
75
|
+
source .venv/bin/activate
|
|
76
|
+
pip install vault-for-llm
|
|
77
|
+
|
|
78
|
+
vault doctor
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Optional semantic search
|
|
82
|
+
|
|
83
|
+
Keyword search works with the base install. For local ONNX embeddings:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install "vault-for-llm[semantic]"
|
|
87
|
+
vault install-embedding --model mix
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or use an existing Ollama embedding model:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
vault config set embedding.provider ollama
|
|
94
|
+
vault config set embedding.model nomic-embed-text
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Optional MCP server
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install "vault-for-llm[mcp]"
|
|
101
|
+
vault-mcp --project-dir /path/to/your/project
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Development install from source
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/zycaskevin/Vault-for-LLM.git
|
|
108
|
+
cd Vault-for-LLM
|
|
109
|
+
python3 -m venv .venv
|
|
110
|
+
source .venv/bin/activate
|
|
111
|
+
pip install -e ".[dev]"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Quickstart
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# 1. Create a vault in your project
|
|
120
|
+
vault init
|
|
121
|
+
|
|
122
|
+
# 2. Add a first knowledge entry
|
|
123
|
+
vault add "First lesson" --content "The bug was caused by X. The fix was Y."
|
|
124
|
+
|
|
125
|
+
# 3. Compile Markdown into the local SQLite vault
|
|
126
|
+
vault compile
|
|
127
|
+
|
|
128
|
+
# 4. Search it later
|
|
129
|
+
vault search "what caused the bug"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
You can also add Markdown files directly under `raw/` and run `vault compile`.
|
|
133
|
+
|
|
134
|
+
Example entry:
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
---
|
|
138
|
+
title: "Postgres migration pitfall"
|
|
139
|
+
category: "error"
|
|
140
|
+
layer: L3
|
|
141
|
+
tags: ["postgres", "migration"]
|
|
142
|
+
trust: 0.8
|
|
143
|
+
source: "project-notes"
|
|
144
|
+
created: "2026-05-16"
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
# Postgres migration pitfall
|
|
148
|
+
|
|
149
|
+
What broke, why it broke, and how to avoid it next time.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Directory structure
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
your-project/
|
|
158
|
+
├── L0-identity/ # user or project identity loaded every session
|
|
159
|
+
│ └── identity.md
|
|
160
|
+
├── L1-core-facts/ # stable facts loaded every session
|
|
161
|
+
│ └── current-projects.md
|
|
162
|
+
├── L2-context/ # recent context, decisions, incidents
|
|
163
|
+
│ └── recent-sessions/
|
|
164
|
+
├── L3-knowledge/ # deep knowledge organized for retrieval
|
|
165
|
+
├── raw/ # source Markdown knowledge entries
|
|
166
|
+
├── compiled/ # compiled / compressed knowledge artifacts
|
|
167
|
+
├── vault.db # local SQLite database generated by vault
|
|
168
|
+
└── templates/ # starter templates
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## CLI reference
|
|
172
|
+
|
|
173
|
+
| Command | Purpose |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `vault init` | Initialize a project vault |
|
|
176
|
+
| `vault doctor` | Check local environment and optional dependencies |
|
|
177
|
+
| `vault add "Title" --content "..."` | Add one knowledge entry |
|
|
178
|
+
| `vault add "Title" --file note.md` | Add an entry from a Markdown file |
|
|
179
|
+
| `vault import long-doc.md` | Import and chunk a long document |
|
|
180
|
+
| `vault compile` | Compile `raw/` into SQLite + `compiled/` artifacts |
|
|
181
|
+
| `vault search "query"` | Search the vault |
|
|
182
|
+
| `vault search "query" --graph-expand 2` | Search with graph expansion |
|
|
183
|
+
| `vault list` | List knowledge entries |
|
|
184
|
+
| `vault stats` | Show vault statistics |
|
|
185
|
+
| `vault lint` | Run quality checks |
|
|
186
|
+
| `vault map build` | Build/backfill Document Map rows |
|
|
187
|
+
| `vault map show <id>` | Show a knowledge entry's section map |
|
|
188
|
+
| `vault map read <id> --lines 10-30` | Read a bounded source range |
|
|
189
|
+
| `vault graph build` | Build the inferred knowledge graph |
|
|
190
|
+
| `vault graph show` | Show graph statistics |
|
|
191
|
+
| `vault converge` | Experimental convergence/self-questioning check |
|
|
192
|
+
| `vault cross-validate` | Experimental cross-model validation |
|
|
193
|
+
| `vault freshness` | Experimental freshness/review scheduling |
|
|
194
|
+
| `vault dedup` | Detect or merge duplicate entries |
|
|
195
|
+
| `vault search-qa run` | Run Search QA metrics snapshot |
|
|
196
|
+
| `vault skill search "query"` | Search experimental skill marketplace entries |
|
|
197
|
+
|
|
198
|
+
Run `vault <command> --help` for command-specific options.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## MCP integration
|
|
203
|
+
|
|
204
|
+
Install MCP extras and start the server:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
pip install "vault-for-llm[mcp]"
|
|
208
|
+
vault-mcp --project-dir /path/to/your/project
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Example MCP server config:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"mcpServers": {
|
|
216
|
+
"vault": {
|
|
217
|
+
"command": "vault-mcp",
|
|
218
|
+
"args": ["--project-dir", "/path/to/your/project"]
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Current MCP tools include:
|
|
225
|
+
|
|
226
|
+
- `vault_search`
|
|
227
|
+
- `vault_add`
|
|
228
|
+
- `vault_stats`
|
|
229
|
+
- `vault_map_show`
|
|
230
|
+
- `vault_read_range`
|
|
231
|
+
- `vault_remote_map_show` / `vault_remote_read_range` when optional Supabase sync is configured
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Optional Supabase sync
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
|
|
239
|
+
The local SQLite database remains the source of truth. Supabase is a sync target.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# install manually while this is alpha
|
|
243
|
+
pip install supabase
|
|
244
|
+
|
|
245
|
+
# configure Supabase credentials in your environment, then run sync scripts as needed
|
|
246
|
+
python scripts/sync_to_supabase.py --document-map
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Current maturity
|
|
252
|
+
|
|
253
|
+
Vault-for-LLM is alpha software:
|
|
254
|
+
|
|
255
|
+
- Internal package, module, database, and MCP tool names are Vault-branded.
|
|
256
|
+
- Advanced features such as convergence, cross-validation, Search QA, skills, and Supabase sync are evolving.
|
|
257
|
+
- The default install is available from PyPI; source installs are for development.
|
|
258
|
+
- APIs and schemas may change before a stable release.
|
|
259
|
+
|
|
260
|
+
If you want the most stable path, start with:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
vault init
|
|
264
|
+
vault add
|
|
265
|
+
vault compile
|
|
266
|
+
vault search
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Development
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
python3 -m venv .venv
|
|
275
|
+
source .venv/bin/activate
|
|
276
|
+
pip install -e ".[dev]"
|
|
277
|
+
python -m pytest -q
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Some optional test paths require optional dependencies such as ONNX, MCP, or Supabase.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
MIT
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vault-for-llm"
|
|
7
|
+
version = "0.4.0"
|
|
8
|
+
description = "Local-first knowledge system with sqlite-vec + ONNX embeddings. No cloud, no Docker, no PyTorch required."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Vault-for-LLM Contributors"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["knowledge-base", "vector-search", "sqlite", "onnx", "embeddings", "local-first"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Topic :: Database",
|
|
20
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
dependencies = [
|
|
29
|
+
"pyyaml>=6.0",
|
|
30
|
+
"sqlite-vec>=0.1.6,<1.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
semantic = [
|
|
35
|
+
"onnxruntime>=1.16,<2.0",
|
|
36
|
+
"optimum[onnxruntime]>=2.0,<3.0",
|
|
37
|
+
"transformers>=4.35,<5.0",
|
|
38
|
+
"sentencepiece>=0.1",
|
|
39
|
+
]
|
|
40
|
+
dev = [
|
|
41
|
+
"pytest>=7.0",
|
|
42
|
+
"ruff>=0.1",
|
|
43
|
+
]
|
|
44
|
+
mcp = [
|
|
45
|
+
"mcp>=1.0",
|
|
46
|
+
"anthropic>=0.30,<1.0",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
vault = "vault.cli:main"
|
|
51
|
+
vault-mcp = "vault.mcp:main"
|
|
52
|
+
|
|
53
|
+
[tool.setuptools.packages.find]
|
|
54
|
+
include = ["vault*"]
|
|
55
|
+
|
|
56
|
+
[tool.ruff]
|
|
57
|
+
line-length = 100
|
|
58
|
+
target-version = "py310"
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|