yggdrasil-memory 0.1.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.
Files changed (40) hide show
  1. yggdrasil_memory-0.1.0/.gitignore +34 -0
  2. yggdrasil_memory-0.1.0/CHANGELOG.md +39 -0
  3. yggdrasil_memory-0.1.0/LICENSE +99 -0
  4. yggdrasil_memory-0.1.0/PKG-INFO +389 -0
  5. yggdrasil_memory-0.1.0/README.md +272 -0
  6. yggdrasil_memory-0.1.0/clients/npm/README.md +35 -0
  7. yggdrasil_memory-0.1.0/docs/backend-boundary.md +69 -0
  8. yggdrasil_memory-0.1.0/docs/mcp-facade.md +38 -0
  9. yggdrasil_memory-0.1.0/docs/memory-review-queue.md +41 -0
  10. yggdrasil_memory-0.1.0/docs/reproducible-demo.md +106 -0
  11. yggdrasil_memory-0.1.0/docs/review-actions.md +87 -0
  12. yggdrasil_memory-0.1.0/docs/ygg-cli.md +58 -0
  13. yggdrasil_memory-0.1.0/eval/ygg_eval.py +187 -0
  14. yggdrasil_memory-0.1.0/integrations/autoresearch/README.md +37 -0
  15. yggdrasil_memory-0.1.0/pyproject.toml +34 -0
  16. yggdrasil_memory-0.1.0/scripts/run_gates.sh +60 -0
  17. yggdrasil_memory-0.1.0/tests/test_ygg_core.py +50 -0
  18. yggdrasil_memory-0.1.0/tests/test_ygg_memory_server.py +183 -0
  19. yggdrasil_memory-0.1.0/yggdrasil/__init__.py +3 -0
  20. yggdrasil_memory-0.1.0/yggdrasil/cli.py +198 -0
  21. yggdrasil_memory-0.1.0/yggdrasil/hooks/__init__.py +1 -0
  22. yggdrasil_memory-0.1.0/yggdrasil/hooks/ygg_session_start.py +157 -0
  23. yggdrasil_memory-0.1.0/yggdrasil/install.sh +230 -0
  24. yggdrasil_memory-0.1.0/yggdrasil/materialize_memory.py +77 -0
  25. yggdrasil_memory-0.1.0/yggdrasil/ygg.py +384 -0
  26. yggdrasil_memory-0.1.0/yggdrasil/ygg_core.py +161 -0
  27. yggdrasil_memory-0.1.0/yggdrasil/ygg_cross_agent_demo.py +116 -0
  28. yggdrasil_memory-0.1.0/yggdrasil/ygg_dense_gate.py +226 -0
  29. yggdrasil_memory-0.1.0/yggdrasil/ygg_embeddings.py +75 -0
  30. yggdrasil_memory-0.1.0/yggdrasil/ygg_governance_gate.py +204 -0
  31. yggdrasil_memory-0.1.0/yggdrasil/ygg_import_claude_memory.py +141 -0
  32. yggdrasil_memory-0.1.0/yggdrasil/ygg_mcp_server.py +245 -0
  33. yggdrasil_memory-0.1.0/yggdrasil/ygg_memory_server.py +605 -0
  34. yggdrasil_memory-0.1.0/yggdrasil/ygg_quality_gate.py +251 -0
  35. yggdrasil_memory-0.1.0/yggdrasil/ygg_review_actions.py +408 -0
  36. yggdrasil_memory-0.1.0/yggdrasil/ygg_review_apply_gate.py +291 -0
  37. yggdrasil_memory-0.1.0/yggdrasil/ygg_review_queue.py +223 -0
  38. yggdrasil_memory-0.1.0/yggdrasil/ygg_seed_demo.py +131 -0
  39. yggdrasil_memory-0.1.0/yggdrasil/ygg_setup.py +175 -0
  40. yggdrasil_memory-0.1.0/yggdrasil/ygg_writepath.py +166 -0
@@ -0,0 +1,34 @@
1
+ # --- Runtime / data (never commit) ---
2
+ data/
3
+ reports/
4
+ *.sqlite
5
+ *.sqlite-wal
6
+ *.sqlite-shm
7
+ *.db
8
+ *.log
9
+ *.pid
10
+
11
+ # --- Generated vault notes (runtime output; may contain private memory) ---
12
+ # Keep the folder structure (.gitkeep), ignore generated notes.
13
+ vault/04-learnings/*.md
14
+ vault/99-review/*.md
15
+
16
+ # --- Stray runtime artifacts ---
17
+ debugging_lesson_record.json
18
+
19
+ # --- Python / tooling / OS ---
20
+ __pycache__/
21
+ *.pyc
22
+ *.pyo
23
+ *.egg-info/
24
+ dist/
25
+ build/
26
+ # npm launcher bundles LICENSE only at publish time (copied from repo root)
27
+ clients/npm/LICENSE
28
+ clients/npm/*.tgz
29
+ node_modules/
30
+ .venv/
31
+ venv/
32
+ node_modules/
33
+ .DS_Store
34
+ .pytest_cache/
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. Format loosely follows
4
+ [Keep a Changelog](https://keepachangelog.com/); versioning is [SemVer](https://semver.org/).
5
+
6
+ ## [0.1.0] — 2026-06-18
7
+
8
+ First public release. An alpha but honest one: the happy path and the full
9
+ governance loop are covered by passing gates (`scripts/run_gates.sh`).
10
+
11
+ ### Added
12
+ - **Own memory engine** — stdlib-only HTTP server over SQLite + FTS5, zero
13
+ dependencies (~21 MB RAM), behind a swappable `MemoryBackend` contract.
14
+ - **Agent integration** — MCP facade (`ygg_health`, `ygg_bootstrap`,
15
+ `ygg_search`, `ygg_recall`, `ygg_remember`, `ygg_materialize`) + CLI (`ygg.py`).
16
+ - **Hybrid retrieval** — BM25 + optional local dense embeddings (via Ollama),
17
+ cross-lingual (EN↔RU), score-normalized fusion.
18
+ - **Cross-project recall** + a proactive "you solved this before" contract.
19
+ - **Always-on service** — launchd daemon (auto-start, auto-restart) + an
20
+ interactive installer with hardware-aware model recommendations.
21
+ - **SessionStart hook** — injects identity/persona, project memory, and open
22
+ follow-ups/status into every session.
23
+ - **Background smart write-path** — a small local model finds semantic
24
+ duplicates/contradictions the lexical layer misses (propose-safe by default).
25
+ - **Governance loop** — review queue + non-destructive archive / merge /
26
+ verify-or-archive actions.
27
+ - **Obsidian materialization** + a Claude-memory importer.
28
+ - **Eval harness** (recall@k / MRR by query class) + 4 integration gates +
29
+ engine unit tests.
30
+ - **Docs** — README in English / Русский / 简体中文 / Español / Français.
31
+ - **License** — Elastic License 2.0 (source-available: free to use, modify,
32
+ self-host, and redistribute; no resale as a product and no offering it to
33
+ others as a hosted/managed service).
34
+
35
+ ### Notes
36
+ - The engine is swappable: any REST service satisfying the `MemoryBackend`
37
+ contract is a drop-in (point `YGG_ENGINE_URL` at it). Yggdrasil ships its own.
38
+ - Auto-applying background consolidation is opt-in; the safe default only
39
+ proposes (a small local model can mislabel distinct-but-similar lessons).
@@ -0,0 +1,99 @@
1
+ Yggdrasil is licensed under the Elastic License 2.0.
2
+
3
+ Copyright (c) 2026 Yggdrasil contributors (the "Licensor").
4
+
5
+ Canonical text: https://www.elastic.co/licensing/elastic-license
6
+
7
+ -------------------------------------------------------------------------------
8
+
9
+ Elastic License 2.0
10
+
11
+ ## Acceptance
12
+
13
+ By using the software, you agree to all of the terms and conditions below.
14
+
15
+ ## Copyright License
16
+
17
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
18
+ non-sublicensable, non-transferable license to use, copy, distribute, make
19
+ available, and prepare derivative works of the software, in each case subject to
20
+ the limitations and conditions below.
21
+
22
+ ## Limitations
23
+
24
+ You may not provide the software to third parties as a hosted or managed
25
+ service, where the service provides users with access to any substantial set of
26
+ the features or functionality of the software.
27
+
28
+ You may not move, change, disable, or circumvent the license key functionality
29
+ in the software, and you may not remove or obscure any functionality in the
30
+ software that is protected by the license key.
31
+
32
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
33
+ of the licensor in the software. Any use of the licensor's trademarks is subject
34
+ to applicable law.
35
+
36
+ ## Patents
37
+
38
+ The licensor grants you a license, under any patent claims the licensor can
39
+ license, or becomes able to license, to make, have made, use, sell, offer for
40
+ sale, import and have imported the software, in each case subject to the
41
+ limitations and conditions in this license. This license does not cover any
42
+ patent claims that you cause to be infringed by modifications or additions to
43
+ the software. If you or your company make any written claim that the software
44
+ infringes or contributes to infringement of any patent, your patent license for
45
+ the software granted under these terms ends immediately. If your company makes
46
+ such a claim, your patent license ends immediately for work on behalf of your
47
+ company.
48
+
49
+ ## Notices
50
+
51
+ You must ensure that anyone who gets a copy of any part of the software from you
52
+ also gets a copy of these terms.
53
+
54
+ If you modify the software, you must include in any modified copies of the
55
+ software prominent notices stating that you have modified the software.
56
+
57
+ ## No Other Rights
58
+
59
+ These terms do not imply any licenses other than those expressly granted in
60
+ these terms.
61
+
62
+ ## Termination
63
+
64
+ If you use the software in violation of these terms, such use is not licensed,
65
+ and your licenses will automatically terminate. If the licensor provides you
66
+ with a notice of your violation, and you cease all violation of this license no
67
+ later than 30 days after you receive that notice, your licenses will be
68
+ reinstated retroactively. However, if you violate these terms after such
69
+ reinstatement, any additional violation of these terms will cause your licenses
70
+ to terminate automatically and permanently.
71
+
72
+ ## No Liability
73
+
74
+ *As far as the law allows, the software comes as is, without any warranty or
75
+ condition, and the licensor will not be liable to you for any damages arising
76
+ out of these terms or the use or nature of the software, under any kind of legal
77
+ claim.*
78
+
79
+ ## Definitions
80
+
81
+ The **licensor** is the entity offering these terms, and the **software** is the
82
+ software the licensor makes available under these terms, including any portion of
83
+ it.
84
+
85
+ **you** refers to the individual or entity agreeing to these terms.
86
+
87
+ **your company** is any legal entity, sole proprietorship, or other kind of
88
+ organization that you work for, plus all organizations that have control over,
89
+ are under the control of, or are under common control with that organization.
90
+ **control** means ownership of substantially all the assets of an entity, or the
91
+ power to direct its management and policies by vote, contract, or otherwise.
92
+ Control can be direct or indirect.
93
+
94
+ **your licenses** are all the licenses granted to you for the software under
95
+ these terms.
96
+
97
+ **use** means anything you do with the software requiring one of your licenses.
98
+
99
+ **trademark** means trademarks, service marks, and similar rights.
@@ -0,0 +1,389 @@
1
+ Metadata-Version: 2.4
2
+ Name: yggdrasil-memory
3
+ Version: 0.1.0
4
+ Summary: One shared, durable memory for all your AI coding agents — MCP, local-first, zero-dependency.
5
+ Project-URL: Homepage, https://github.com/VonderVuflya/yggdrasil
6
+ Project-URL: Repository, https://github.com/VonderVuflya/yggdrasil
7
+ Project-URL: Issues, https://github.com/VonderVuflya/yggdrasil/issues
8
+ Author: Yggdrasil contributors
9
+ License: Yggdrasil is licensed under the Elastic License 2.0.
10
+
11
+ Copyright (c) 2026 Yggdrasil contributors (the "Licensor").
12
+
13
+ Canonical text: https://www.elastic.co/licensing/elastic-license
14
+
15
+ -------------------------------------------------------------------------------
16
+
17
+ Elastic License 2.0
18
+
19
+ ## Acceptance
20
+
21
+ By using the software, you agree to all of the terms and conditions below.
22
+
23
+ ## Copyright License
24
+
25
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
26
+ non-sublicensable, non-transferable license to use, copy, distribute, make
27
+ available, and prepare derivative works of the software, in each case subject to
28
+ the limitations and conditions below.
29
+
30
+ ## Limitations
31
+
32
+ You may not provide the software to third parties as a hosted or managed
33
+ service, where the service provides users with access to any substantial set of
34
+ the features or functionality of the software.
35
+
36
+ You may not move, change, disable, or circumvent the license key functionality
37
+ in the software, and you may not remove or obscure any functionality in the
38
+ software that is protected by the license key.
39
+
40
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
41
+ of the licensor in the software. Any use of the licensor's trademarks is subject
42
+ to applicable law.
43
+
44
+ ## Patents
45
+
46
+ The licensor grants you a license, under any patent claims the licensor can
47
+ license, or becomes able to license, to make, have made, use, sell, offer for
48
+ sale, import and have imported the software, in each case subject to the
49
+ limitations and conditions in this license. This license does not cover any
50
+ patent claims that you cause to be infringed by modifications or additions to
51
+ the software. If you or your company make any written claim that the software
52
+ infringes or contributes to infringement of any patent, your patent license for
53
+ the software granted under these terms ends immediately. If your company makes
54
+ such a claim, your patent license ends immediately for work on behalf of your
55
+ company.
56
+
57
+ ## Notices
58
+
59
+ You must ensure that anyone who gets a copy of any part of the software from you
60
+ also gets a copy of these terms.
61
+
62
+ If you modify the software, you must include in any modified copies of the
63
+ software prominent notices stating that you have modified the software.
64
+
65
+ ## No Other Rights
66
+
67
+ These terms do not imply any licenses other than those expressly granted in
68
+ these terms.
69
+
70
+ ## Termination
71
+
72
+ If you use the software in violation of these terms, such use is not licensed,
73
+ and your licenses will automatically terminate. If the licensor provides you
74
+ with a notice of your violation, and you cease all violation of this license no
75
+ later than 30 days after you receive that notice, your licenses will be
76
+ reinstated retroactively. However, if you violate these terms after such
77
+ reinstatement, any additional violation of these terms will cause your licenses
78
+ to terminate automatically and permanently.
79
+
80
+ ## No Liability
81
+
82
+ *As far as the law allows, the software comes as is, without any warranty or
83
+ condition, and the licensor will not be liable to you for any damages arising
84
+ out of these terms or the use or nature of the software, under any kind of legal
85
+ claim.*
86
+
87
+ ## Definitions
88
+
89
+ The **licensor** is the entity offering these terms, and the **software** is the
90
+ software the licensor makes available under these terms, including any portion of
91
+ it.
92
+
93
+ **you** refers to the individual or entity agreeing to these terms.
94
+
95
+ **your company** is any legal entity, sole proprietorship, or other kind of
96
+ organization that you work for, plus all organizations that have control over,
97
+ are under the control of, or are under common control with that organization.
98
+ **control** means ownership of substantially all the assets of an entity, or the
99
+ power to direct its management and policies by vote, contract, or otherwise.
100
+ Control can be direct or indirect.
101
+
102
+ **your licenses** are all the licenses granted to you for the software under
103
+ these terms.
104
+
105
+ **use** means anything you do with the software requiring one of your licenses.
106
+
107
+ **trademark** means trademarks, service marks, and similar rights.
108
+ License-File: LICENSE
109
+ Keywords: ai-agents,claude,codex,local-first,mcp,memory,obsidian,rag
110
+ Classifier: Development Status :: 3 - Alpha
111
+ Classifier: Environment :: Console
112
+ Classifier: Intended Audience :: Developers
113
+ Classifier: Programming Language :: Python :: 3 :: Only
114
+ Classifier: Topic :: Software Development :: Libraries
115
+ Requires-Python: >=3.10
116
+ Description-Content-Type: text/markdown
117
+
118
+ <h1 align="center">🌳 Yggdrasil</h1>
119
+
120
+ <p align="center"><b>One shared, durable memory for all your AI coding agents.</b><br/>
121
+ Claude Code, Codex, and any MCP host remember your projects — decisions, lessons, status — across sessions, tools, and projects.</p>
122
+
123
+ <p align="center">
124
+ <img src="https://img.shields.io/badge/License-Elastic%202.0-blue.svg" alt="Elastic License 2.0">
125
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+">
126
+ <img src="https://img.shields.io/badge/deps-zero%20(stdlib)-brightgreen" alt="zero deps">
127
+ <img src="https://img.shields.io/badge/MCP-Claude%20·%20Codex%20·%20any%20host-purple" alt="MCP">
128
+ <img src="https://img.shields.io/badge/local--first-100%25%20private-success" alt="local-first">
129
+ <img src="https://img.shields.io/badge/status-alpha-orange" alt="alpha">
130
+ </p>
131
+
132
+ <p align="center">
133
+ <a href="#-quickstart">Quickstart</a> ·
134
+ <a href="#-how-it-works">How it works</a> ·
135
+ <a href="#%EF%B8%8F-commands">Commands</a> ·
136
+ <a href="#-faq">FAQ</a> ·
137
+ <a href="#-yggdrasil-vs-alternatives">Comparison</a>
138
+ </p>
139
+
140
+ <p align="center">
141
+ <a href="./README.md"><img src="https://img.shields.io/badge/README-English-blue" alt="English"></a>
142
+ <a href="./i18n/README.ru.md"><img src="https://img.shields.io/badge/docs-Русский-darkblue" alt="Русский"></a>
143
+ <a href="./i18n/README.zh.md"><img src="https://img.shields.io/badge/docs-简体中文-red" alt="简体中文"></a>
144
+ <a href="./i18n/README.es.md"><img src="https://img.shields.io/badge/docs-Español-orange" alt="Español"></a>
145
+ <a href="./i18n/README.fr.md"><img src="https://img.shields.io/badge/docs-Français-blue" alt="Français"></a>
146
+ </p>
147
+
148
+ ---
149
+
150
+ Every new chat, your AI forgets. You re-explain the project, the decisions, the gotchas — every time, in every tool. **Yggdrasil is a tiny always-on memory brain that any agent plugs into.** Open a new session in any project, with any AI, and it already knows what you decided, what broke, and what's still open — and it quietly learns from your work in the background.
151
+
152
+ ```text
153
+ $ cd ~/projects/checkout-api && claude # a brand-new session
154
+
155
+ 🌳 Yggdrasil (injected automatically at session start)
156
+ You are Yggdrasil — your persistent assistant across tools and projects.
157
+ Open follow-ups & status:
158
+ • [project_status] payments refactor: idempotency keys added; open: e2e tests
159
+ Durable memory for `checkout-api`:
160
+ • [debugging_lesson] webhook 401 → signing secret rotated; update env + redeploy
161
+
162
+ > "have I solved a flaky websocket reconnect anywhere before?"
163
+
164
+ 🌳 recall → found in project `realtime-dash`:
165
+ refresh the token *before* opening the socket, then retry with capped backoff.
166
+ ```
167
+
168
+ No "let me remind you what we did yesterday." It's just there.
169
+
170
+ ## ❌ Without Yggdrasil
171
+
172
+ - 🔁 You re-explain project context to the AI in every new chat.
173
+ - 🧩 Lessons learned in one project never reach the next one.
174
+ - 🤖 Switch from Claude Code to Codex → the new tool knows nothing.
175
+ - 🗑️ Hard-won debugging insights vanish when the session ends.
176
+
177
+ ## ✅ With Yggdrasil
178
+
179
+ - 🧠 **Persistent memory** — decisions, lessons, and status survive across sessions.
180
+ - 🔌 **Any agent, one brain** — Claude Code, Codex, any MCP host share the same memory.
181
+ - 🌐 **Cross-project recall** — *"this looks like what you did in project B — reuse it?"*
182
+ - 🌱 **Self-learning** — a local model consolidates memory in the background (zero API tokens).
183
+ - 🪪 **A soul** — give it a name and personality; it shows up the same in every tool.
184
+ - 🔒 **100% local & private** — your memory lives on your machine. No cloud, no account.
185
+
186
+ ## 🚀 Quickstart
187
+
188
+ > **Requirements:** macOS, Python 3.10+ *(or let `uv`/`npx` fetch Python for you)*. Optional (for semantic search): [Ollama](https://ollama.com).
189
+
190
+ Install with whatever you already use — **every channel installs the same engine:**
191
+
192
+ | Tool | Command |
193
+ | --- | --- |
194
+ | **uv** _(recommended)_ | `uvx --from yggdrasil-memory ygg install` |
195
+ | **npm / npx** | `npx yggdrasil-memory install` |
196
+ | **pipx** | `pipx install yggdrasil-memory && ygg install` |
197
+ | **pip** | `pip install yggdrasil-memory && ygg install` |
198
+ | **Homebrew** _(macOS)_ | `brew install VonderVuflya/tap/yggdrasil && ygg install` |
199
+ | **from source** | `uvx --from git+https://github.com/VonderVuflya/yggdrasil.git ygg install` |
200
+
201
+ > Registry channels go live as each is published (see [RELEASING.md](./RELEASING.md)); the **from source** line works against this repo today. `npx` and `uvx` can fetch Python for you.
202
+
203
+ That's it. `ygg install`:
204
+ 1. 🔍 detects your CPU/RAM/GPU and **recommends models that fit your machine** (or choose `none` for a zero-config, lexical-only setup),
205
+ 2. 🔑 generates a private auth token (never hardcoded),
206
+ 3. 🛎️ installs an always-on background service (auto-starts at login, restarts on crash),
207
+ 4. 🤝 registers the memory tools with **Claude Code and Codex**,
208
+ 5. 🪝 (optional) enables a session-start hook that auto-injects your project memory.
209
+
210
+ Check the install any time with `ygg doctor`; upgrade later with `ygg update`.
211
+
212
+ Prefer to just try the engine first, without installing a service?
213
+
214
+ ```bash
215
+ uvx --from git+https://github.com/VonderVuflya/yggdrasil.git ygg serve --reset --db /tmp/ygg.sqlite # runs on :42069
216
+ ```
217
+
218
+ ## 🧠 How it works
219
+
220
+ Yggdrasil is **memory + tools** — the *intelligence* is your LLM. It just makes sure the right memory is in front of the right agent at the right moment.
221
+
222
+ ```text
223
+ Claude Code / Codex / any MCP host
224
+ │ (MCP tools: ygg_search, ygg_recall, ygg_remember … )
225
+
226
+ ┌─────────────────────┐ SessionStart hook injects
227
+ │ Yggdrasil engine │◀──── identity + project memory + open follow-ups
228
+ │ (always-on daemon) │
229
+ │ SQLite + FTS5 │ background local model (optional)
230
+ │ + optional vectors │────▶ dedupes / links / consolidates memory
231
+ └─────────────────────┘
232
+ │ materializes to
233
+
234
+ 📓 Obsidian vault (human-readable, editable)
235
+ ```
236
+
237
+ - **Engine** — a stdlib-only HTTP server over SQLite + FTS5. Zero dependencies, ~21 MB RAM.
238
+ - **Retrieval** — lexical by default; add a local embedding model for semantic + cross-lingual search.
239
+ - **Governance** — duplicates / stale / conflicting memories are surfaced for review; changes are non-destructive (archive, never delete).
240
+ - **Obsidian** — every memory is also a Markdown note you can read and edit.
241
+
242
+ ## ⭐ Features
243
+
244
+ - 🧠 **Durable cross-session memory** for any MCP-compatible agent.
245
+ - 🌐 **Cross-project recall** + a proactive "you solved this before" contract.
246
+ - 🔎 **Hybrid retrieval** — BM25 + optional dense embeddings, fused; cross-lingual (e.g. EN↔RU).
247
+ - 🪪 **Identity / persona** injected every session (the "Jarvis feel").
248
+ - 📌 **Status & follow-ups** surfaced at session start — *"what's the status of X?"* answers instantly.
249
+ - 🌱 **Background self-learning** — a small local model consolidates memory (propose-safe by default).
250
+ - 🧹 **Governance loop** — review queue + non-destructive archive/merge.
251
+ - 📓 **Obsidian materialization** — readable, editable, portable.
252
+ - 🔒 **Local-first & private** — no cloud, no account, your data stays put.
253
+ - 🪶 **Zero hard dependencies** — pure Python stdlib; optional local models via Ollama.
254
+
255
+ ## 🛠️ Commands
256
+
257
+ **Memory ops — `ygg <command>`** (agent-facing)
258
+
259
+ | Command | What it does |
260
+ | --- | --- |
261
+ | `health` | Check the engine is alive |
262
+ | `bootstrap --project P` | Pull a project's memory before starting work |
263
+ | `search --project P --query "…"` | Project-scoped search (`--type`, `--limit`, `--json`) |
264
+ | `recall --query "…"` | **Cross-project** search — "have I done this anywhere?" |
265
+ | `remember --project P --type debugging_lesson --content "…"` | Save a durable memory (secret-guarded, deduped) |
266
+ | `materialize --id ID --project P` | Export one memory to an Obsidian note |
267
+
268
+ **Service & setup — `ygg <command>`** (lifecycle)
269
+
270
+ | Command | What it does |
271
+ | --- | --- |
272
+ | `install` | Guided wizard → background service + MCP registration |
273
+ | `recommend` | Show the hardware-aware model catalog |
274
+ | `status` · `start` · `stop` · `restart` · `logs` | Manage the always-on daemon |
275
+ | `hooks` · `unhooks` | Enable/disable the SessionStart auto-bootstrap hook |
276
+ | `consolidate` · `unconsolidate` | Schedule/remove background memory consolidation |
277
+ | `token` · `uninstall` | Print the auth token · remove service + registration |
278
+
279
+ **MCP tools** (what agents see): `ygg_health`, `ygg_bootstrap`, `ygg_search`, `ygg_recall`, `ygg_remember`, `ygg_materialize`.
280
+
281
+ ## 🔌 Use it with your agent
282
+
283
+ - **Claude Code** — after `ygg install`, the tools are registered (`/mcp` shows `yggdrasil`) and the SessionStart hook auto-injects memory. Just open a project and work.
284
+ - **Codex** — registered too; approve the `ygg_*` tool call once per session.
285
+ - **Any MCP host** — point it at `ygg mcp` (stdio) with `YGG_ENGINE_URL` + `YGG_ENGINE_TOKEN`.
286
+
287
+ Give it a personality — edit `~/.yggdrasil/identity.json`:
288
+
289
+ ```json
290
+ { "name": "Jarvis", "persona": "concise, proactive, dry wit", "user_facts": ["prefers TypeScript", "ships small PRs"] }
291
+ ```
292
+
293
+ ## 📊 Footprint & quality
294
+
295
+ **Footprint** (measured, 13 memories): **~21 MB RAM**, **~0% idle CPU**, **zero dependencies** (Python 3.10+ stdlib). Disk ≈ tens of KB per memory. Dense search is optional and adds a local Ollama model (e.g. `all-minilm`, 45 MB).
296
+
297
+ **Retrieval quality** (`eval/ygg_eval.py`, recall@1):
298
+
299
+ | Mode | recall@1 | paraphrase | crosslingual (EN→RU) |
300
+ | --- | --- | --- | --- |
301
+ | lexical (default) | 0.63 | 0.00 | 0.00 |
302
+ | dense · `all-minilm` (45 MB, EN) | 0.75 | 0.67 | 0.00 |
303
+ | dense · `paraphrase-multilingual` (~560 MB) | **0.94** | 0.67 | **1.00** |
304
+
305
+ `keyword` and `identifier` queries are 1.0 in every mode. Run it yourself: `python3 eval/ygg_eval.py`.
306
+
307
+ ## ❓ FAQ
308
+
309
+ <details>
310
+ <summary><b>Does it send my code or memory to the cloud?</b></summary>
311
+
312
+ No. The engine, the database, and the optional models all run locally. No account, no telemetry. Your memory never leaves your machine.
313
+ </details>
314
+
315
+ <details>
316
+ <summary><b>How is this different from Context7 / RAG over docs?</b></summary>
317
+
318
+ Context7 fetches up-to-date <i>public library docs</i> (the latest React/Next.js API). Yggdrasil remembers <i>your own work</i> — your decisions, lessons, and project status. They're complementary; run both. See <a href="#-yggdrasil-vs-alternatives">comparison</a>.
319
+ </details>
320
+
321
+ <details>
322
+ <summary><b>Does it automatically remember everything?</b></summary>
323
+
324
+ No — by design. Retrieval is automatic; <i>writing</i> is deliberate (the agent calls <code>ygg_remember</code> for durable lessons). Auto-capturing everything pollutes memory, so we don't. A background model consolidates what's already saved (propose-only by default).
325
+ </details>
326
+
327
+ <details>
328
+ <summary><b>Do I need a GPU or an API key?</b></summary>
329
+
330
+ No. The default is pure lexical search — zero dependencies, instant. Semantic search is opt-in and uses a <i>local</i> model via Ollama (no API key). The installer recommends a model that fits your hardware.
331
+ </details>
332
+
333
+ <details>
334
+ <summary><b>How many tokens does it cost my agent?</b></summary>
335
+
336
+ Very few. Session start injects ~300 tokens of memory; each tool call returns a small snippet. All the heavy work (indexing, embeddings, consolidation) runs off-LLM on your machine.
337
+ </details>
338
+
339
+ <details>
340
+ <summary><b>Can I edit or delete memories by hand?</b></summary>
341
+
342
+ Yes. Memories materialize to Markdown notes in an Obsidian vault — read, edit, or remove them like any file. The engine never hard-deletes; it archives (reversible).
343
+ </details>
344
+
345
+ <details>
346
+ <summary><b>Is it production-ready?</b></summary>
347
+
348
+ It's an honest <b>alpha</b>: the happy path and the full governance loop are covered by passing gates (<code>scripts/run_gates.sh</code>). Not yet hardened for multi-user/production.
349
+ </details>
350
+
351
+ ## 🆚 Yggdrasil vs alternatives
352
+
353
+ Most "AI memory/context" tools own a **different layer** of the stack. The one nobody filled — **durable, cross-session, cross-agent memory of _your own_ work** — is exactly where Yggdrasil sits. It doesn't compete with these; it's the memory they all plug into.
354
+
355
+ | Tool | The layer it owns | Overlap with Yggdrasil | Better together |
356
+ | --- | --- | --- | --- |
357
+ | **[Context7](https://github.com/upstash/context7)** | fresh public **library docs** (read-only) | none | Context7 gives a library's current API; Yggdrasil recalls *your* decisions & lessons |
358
+ | **[autoresearch](https://github.com/karpathy/autoresearch)** | autonomous **experiment loop** (edit → train → measure → keep/revert) | none — it's the *loop*, not memory | Yggdrasil is the long-term memory the loop lacks: recall what you already tried, remember each result across nights & forks → [integration](./integrations/autoresearch/) |
359
+ | **context-mode** & in-context compressors | **in-session** context compaction / sandboxed analysis | none — per session | Yggdrasil persists the *conclusions* across sessions, tools & machines |
360
+ | **plain LLM memory** | per-session scratch | partial | Yggdrasil is durable, cross-project, governed & local |
361
+
362
+ Capability matrix:
363
+
364
+ | | **Yggdrasil** | Context7 | Plain LLM memory |
365
+ | --- | --- | --- | --- |
366
+ | Knows **your** decisions/lessons | ✅ | ❌ | ⚠️ within one session |
367
+ | Up-to-date public library docs | ❌ (use Context7) | ✅ | ❌ |
368
+ | Cross-session & cross-**agent** | ✅ | ✅ | ❌ |
369
+ | Cross-**project** recall | ✅ | — | ❌ |
370
+ | Writes/accumulates your memory | ✅ | ❌ (read-only) | ⚠️ |
371
+ | Local & private | ✅ | ☁️ hosted | depends |
372
+ | Self-consolidating | ✅ | ❌ | ❌ |
373
+
374
+ **TL;DR:** these tools fetch docs, run experiments, or compress one session. **Yggdrasil is the durable memory of _your own_ work that they were all missing — use it *with* them and you only win.**
375
+
376
+ ## 🗺️ Roadmap
377
+
378
+ - 🔗 Relation graph (`SOLVES` / `SUPERSEDES` / `CONTRADICTS`) for richer reasoning.
379
+ - 🛰️ Multi-device sync — continue literally from any machine.
380
+ - 🧪 Stronger optional models for safe autonomous consolidation.
381
+ - 🐧 Linux/Windows service installers (currently macOS launchd).
382
+
383
+ ## 🤝 Contributing
384
+
385
+ Issues and PRs welcome. Run `scripts/run_gates.sh` and `python3 -m unittest discover -s tests` before submitting — all gates must stay green.
386
+
387
+ ## 📜 License
388
+
389
+ **Elastic License 2.0** — see [LICENSE](./LICENSE). You may freely use, modify, self-host, and redistribute Yggdrasil. You may **not** sell it as a product or offer it to others as a hosted/managed service. It is source-available — not OSI open source.