memgit 0.6.2__tar.gz → 0.8.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 (55) hide show
  1. {memgit-0.6.2 → memgit-0.8.0}/PKG-INFO +60 -27
  2. {memgit-0.6.2 → memgit-0.8.0}/README.md +59 -26
  3. {memgit-0.6.2 → memgit-0.8.0}/memgit/__init__.py +1 -1
  4. {memgit-0.6.2 → memgit-0.8.0}/memgit/cli.py +872 -122
  5. {memgit-0.6.2 → memgit-0.8.0}/memgit/delivery.py +133 -23
  6. memgit-0.8.0/memgit/evaluate.py +344 -0
  7. {memgit-0.6.2 → memgit-0.8.0}/memgit/hooks.py +90 -44
  8. {memgit-0.6.2 → memgit-0.8.0}/memgit/http_server.py +47 -4
  9. {memgit-0.6.2 → memgit-0.8.0}/memgit/links.py +97 -3
  10. {memgit-0.6.2 → memgit-0.8.0}/memgit/mcp_server.py +218 -21
  11. memgit-0.8.0/memgit/metrics.py +197 -0
  12. {memgit-0.6.2 → memgit-0.8.0}/memgit/models.py +8 -0
  13. memgit-0.8.0/memgit/project.py +215 -0
  14. {memgit-0.6.2 → memgit-0.8.0}/memgit/repo.py +219 -44
  15. memgit-0.8.0/memgit/sanitize.py +60 -0
  16. memgit-0.8.0/memgit/scorer.py +351 -0
  17. {memgit-0.6.2 → memgit-0.8.0}/memgit/toon.py +8 -0
  18. {memgit-0.6.2 → memgit-0.8.0}/memgit/usage.py +16 -0
  19. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/PKG-INFO +60 -27
  20. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/SOURCES.txt +7 -1
  21. {memgit-0.6.2 → memgit-0.8.0}/pyproject.toml +1 -1
  22. {memgit-0.6.2 → memgit-0.8.0}/tests/test_advanced.py +14 -6
  23. {memgit-0.6.2 → memgit-0.8.0}/tests/test_delivery.py +1 -1
  24. {memgit-0.6.2 → memgit-0.8.0}/tests/test_v060.py +19 -3
  25. memgit-0.8.0/tests/test_v070.py +652 -0
  26. memgit-0.8.0/tests/test_v080.py +301 -0
  27. memgit-0.8.0/tests/test_v081.py +472 -0
  28. memgit-0.6.2/memgit/project.py +0 -90
  29. memgit-0.6.2/memgit/scorer.py +0 -148
  30. {memgit-0.6.2 → memgit-0.8.0}/LICENSE +0 -0
  31. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/__init__.py +0 -0
  32. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/client.py +0 -0
  33. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/commands.py +0 -0
  34. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/crypto.py +0 -0
  35. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/state.py +0 -0
  36. {memgit-0.6.2 → memgit-0.8.0}/memgit/cloud/sync.py +0 -0
  37. {memgit-0.6.2 → memgit-0.8.0}/memgit/gitdigest.py +0 -0
  38. {memgit-0.6.2 → memgit-0.8.0}/memgit/graph.py +0 -0
  39. {memgit-0.6.2 → memgit-0.8.0}/memgit/importer.py +0 -0
  40. {memgit-0.6.2 → memgit-0.8.0}/memgit/store.py +0 -0
  41. {memgit-0.6.2 → memgit-0.8.0}/memgit/tokens.py +0 -0
  42. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/dependency_links.txt +0 -0
  43. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/entry_points.txt +0 -0
  44. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/requires.txt +0 -0
  45. {memgit-0.6.2 → memgit-0.8.0}/memgit.egg-info/top_level.txt +0 -0
  46. {memgit-0.6.2 → memgit-0.8.0}/setup.cfg +0 -0
  47. {memgit-0.6.2 → memgit-0.8.0}/tests/test_accrue.py +0 -0
  48. {memgit-0.6.2 → memgit-0.8.0}/tests/test_aliases.py +0 -0
  49. {memgit-0.6.2 → memgit-0.8.0}/tests/test_core.py +0 -0
  50. {memgit-0.6.2 → memgit-0.8.0}/tests/test_setup.py +0 -0
  51. {memgit-0.6.2 → memgit-0.8.0}/tests/test_store_repo.py +0 -0
  52. {memgit-0.6.2 → memgit-0.8.0}/tests/test_toon.py +0 -0
  53. {memgit-0.6.2 → memgit-0.8.0}/tests/test_v020.py +0 -0
  54. {memgit-0.6.2 → memgit-0.8.0}/tests/test_v030.py +0 -0
  55. {memgit-0.6.2 → memgit-0.8.0}/tests/test_v040.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memgit
3
- Version: 0.6.2
3
+ Version: 0.8.0
4
4
  Summary: Git for AI memory — version-controlled context persistence across Claude, GPT, Gemini, Cursor, Windsurf, and more
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://memgit.dev
@@ -44,7 +44,7 @@ Version-controlled, cross-AI context that persists, diffs, rolls back, and syncs
44
44
 
45
45
  [![PyPI](https://img.shields.io/pypi/v/memgit)](https://pypi.org/project/memgit/)
46
46
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
47
- [![Tests](https://img.shields.io/badge/tests-245%20passing-brightgreen)](tests/)
47
+ [![Tests](https://img.shields.io/badge/tests-404%20passing-brightgreen)](tests/)
48
48
 
49
49
  ---
50
50
 
@@ -68,9 +68,9 @@ You've probably already tried both. Here's why they hit a ceiling:
68
68
 
69
69
  ---
70
70
 
71
- ## Proof — token savings you can measure
71
+ ## Proof — context costs you can measure
72
72
 
73
- Run this on your own store to see the actual numbers:
73
+ Run this on your own store to see the actual numbers (measured where possible; estimates labeled):
74
74
 
75
75
  ```
76
76
  $ memgit stats
@@ -78,20 +78,17 @@ $ memgit stats
78
78
  Total memories: 108 (41 feedback · 23 user · 19 project · 12 reference · 8 convention · 5 lesson)
79
79
  Priority: 3 critical · 67 medium · 38 low
80
80
 
81
- Token cost comparison:
82
- ┌─────────────────────────────────────┬──────────────────┬───────────────────┬─────────────────────┐
83
- │ Approach │ Tokens/session │ vs full load │ $/session (GPT-4o) │
84
- ├─────────────────────────────────────┼──────────────────┼───────────────────┼─────────────────────┤
85
- claude.md / dump all memories │ 12,840 │ 100% baseline │ $0.0321 │
86
- memgit search (BM25 top-8) │ 640 │ 5% (95% savings) │ $0.0016 │
87
- └─────────────────────────────────────┴──────────────────┴───────────────────┴─────────────────────┘
88
-
89
- Weekly savings (10 sessions/week):
90
- Tokens saved: 122,000/week
91
- Cost saved: $0.31/week → $15.86/year (at GPT-4o input pricing, $2.50/M)
81
+ Context footprint (measured where possible; estimates labeled)
82
+
83
+ Surface Tokens
84
+ Full store (every memory as context) 12,840
85
+ Resume digest (measured render) 540
86
+ Recall block (estimate: top-3 rules chars/4) ~60
87
+
88
+ per-session injected ≈ 600 tokens (estimate) vs 12,840 tokens if the full store were loaded
92
89
  ```
93
90
 
94
- **Why such a big difference?** claude.md loads *all* context every session. memgit uses BM25 relevance scoring it loads *only the 8 memories most relevant to the current session*, not everything you've ever recorded.
91
+ **Why such a big difference?** claude.md loads *all* context every session. memgit injects a bounded resume digest plus BM25-matched recall — *only what is relevant to this session*, not everything you've ever recorded. The digest is measured by actually rendering it, and the store total is the real corpus size; nothing here is a simulated benchmark.
95
92
 
96
93
  ---
97
94
 
@@ -155,9 +152,11 @@ brew tap code4161/tap && brew install memgit
155
152
 
156
153
  **Windows:**
157
154
  ```powershell
155
+ choco install memgit
156
+ # or
158
157
  pip install memgit
159
158
  ```
160
- (`choco install memgit` is not live yet — the Chocolatey package is not on community.chocolatey.org. Use pip until it lands.)
159
+ (The Chocolatey package is live on community.chocolatey.org; newly pushed versions can take a few days to clear moderation — `pip install memgit` always has the latest.)
161
160
 
162
161
  **Any AI tool config (no Python needed — npx auto-installs on first run):**
163
162
  ```json
@@ -198,7 +197,7 @@ memgit onboard # mines the repo, prints the bootstrap brief
198
197
 
199
198
  `onboard` first extracts a **repo digest** deterministically — git history (recent commit subjects, hot files/directories by churn, authors, branch, tags), detected stack from manifests, and the docs worth reading — using bounded, read-only probes that stay near-instant even on huge repositories. The brief then tells your AI agent exactly what to do with it: read only the listed files (no tree crawling), extract 10–20 durable facts (purpose, architecture, conventions, current state, gotchas), save each as a typed memory, and checkpoint the seed set. Paste it into a session — or don't: if the AI searches memory in a project that has none, the MCP server itself replies with the bootstrap instructions instead of a bare "no results."
200
199
 
201
- Memories are **project-scoped**: each carries the workspace it belongs to, searches boost the project you're standing in (global rules still surface), and the resume digest leads with *your current project's* recent worknot whatever repo you touched last night.
200
+ Memories are **project-scoped, filter-by-default** (v0.7.0): each carries the workspace it belongs to, and searches, recall injections, and the resume digest (recent memories, checkpoints, depth hints) are **filtered** to the current project's family plus explicitly-global memories — another project's content never leaks in. Widen deliberately with `memgit search --all-projects` / `all_projects: true` (every hit then carries its `project` label), or hard-filter one project with `--project`. A memory with no project is **explicitly global** (applies everywhere): save one with `memgit add --global` or `project: ""`. A save whose project *cannot be determined* is never silently global it's quarantined under `_unknown` (visible in `list` as `[?project]`, flagged by `lint`, surfaced nowhere) until you relabel it with `memgit doctor --relabel`.
202
201
 
203
202
  ---
204
203
 
@@ -289,10 +288,25 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
289
288
 
290
289
  A project's hardest onboarding problem isn't *what* it does — it's *how to work in it*: which skill to invoke, which command to run, which tool to reach for. That lives in a `CLAUDE.md` or a skills folder the AI host may or may not be configured to read. memgit carries it for you.
291
290
 
292
- `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/`, `.gemini/`, and a marker-block in Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
291
+ `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/` and marker-delimited blocks in the shared `GEMINI.md` (Gemini CLI auto-loads only that file) and Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
293
292
 
294
293
  And it **learns**: a sidecar usage ledger tracks which memories actually get recalled, and the most-used ones are auto-promoted as pointers into the guide over time (budget-capped, decaying, and always subordinate to the repo's own rules — it never restates or overrides them). Drifted? `memgit core heal` rebuilds it.
295
294
 
295
+ Since 0.8.0 it also **starts itself**: a project's first guide is created automatically once it holds a handful of memories, so the loop no longer waits on someone remembering to run `core seed`. The guide leads with what the project actually holds — "this project has N saved memories covering *topics*" — because a stated count of real prior work is evidence a model can act on, where an abstract instruction to check memory is something it can weigh against its own confidence and skip.
296
+
297
+ ---
298
+
299
+ ## Ranking you can prove
300
+
301
+ Retrieval quality used to be adjusted on intuition. `memgit eval` replaces that with a measurement, using two frozen sets mined from the store itself:
302
+
303
+ - **recall** — real prompts and the memories memgit actually surfaced for them. Measures *stability*: did a change break what used to work?
304
+ - **synthetic** — each memory queried by its own `why`, expecting itself back, with the slug's own words stripped out of the query. Measures *correctness*, independently of any past ranking. (The recall set alone is circular — its answers came from the ranking under test.)
305
+
306
+ Both report hit@1, recall@3/5/10 and MRR against a pinned baseline. There is deliberately no single blended score, and no fabricated "tokens saved" number.
307
+
308
+ It earns its keep immediately. Two changes built for 0.8.0 looked obviously right and were measured wrong: a recency multiplier (cut — real-prompt hit@1 −0.020, MRR −0.018) and destructive stemming, which fixed its motivating query while costing hit@1 −0.038 overall (rebuilt as an additive field, then +0.020/+0.041/+0.019). A BM25 normalisation bug introduced in the same release was caught the same way.
309
+
296
310
  ---
297
311
 
298
312
  ## Depth advertisement, trackers & supersession (v0.6.0)
@@ -313,14 +327,14 @@ Measured across 289 real sessions: injected recall reached ~59% of them, but onl
313
327
  # Core (git-like)
314
328
  memgit init # initialize store (auto-detects best path)
315
329
  memgit onboard # bootstrap brief for an existing codebase
316
- memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --supersedes old-slug)
330
+ memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --global everywhere, --supersedes old-slug)
317
331
  memgit commit -m "message" # checkpoint current state
318
332
  memgit log # history
319
333
  memgit diff [sha1] [sha2] # what changed
320
334
  memgit show <slug> # display a memory
321
335
  memgit remove <slug> # remove from active index (history preserved)
322
336
  memgit status # staged changes
323
- memgit search <query> # BM25 relevance search
337
+ memgit search <query> # BM25 search, scoped to this project + global (--all-projects to widen)
324
338
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
325
339
  memgit resume # where we left off — session-start digest
326
340
  memgit merge <thread> # three-way merge a thread into the current one
@@ -331,12 +345,23 @@ memgit core seed # draft a guide from this project's skills + r
331
345
  memgit core sync # deliver it into each AI host's own rules file (additive)
332
346
  memgit core show / edit # view / curate the guide
333
347
  memgit core heal # self-repair a guide that has drifted
348
+ # (a project's FIRST guide is created automatically
349
+ # once it holds 5+ memories — no command needed)
350
+
351
+ # Retrieval evaluation — prove a ranking change helped
352
+ memgit eval mine # freeze a regression set from real recall events
353
+ memgit eval mine --synthetic # non-circular set: query each memory by its own `why`
354
+ memgit eval run --set recall # hit@1 / recall@3,5,10 / MRR vs the pinned baseline
355
+ memgit eval run --baseline # pin the current result as the comparison point
356
+ memgit eval run --misses 10 # inspect the cases where nothing relevant surfaced
334
357
 
335
358
  # Scale & proof
336
359
  memgit squash # compress old history (archives what it collapses)
337
- memgit gc # reclaim disk: sweep unreachable objects
338
- memgit stats # token savings + disk usage
339
- memgit lint # validate all memories
360
+ memgit gc # reclaim disk: sweep unreachable objects + stale session caches
361
+ memgit stats # measured context costs + disk usage
362
+ memgit doctor # hygiene report: quarantined/_unknown memories, stale caches, orphaned usage
363
+ memgit doctor --relabel map.json # bulk re-project memories ({"slug": "Label" | ""}); one checkpoint
364
+ memgit lint # validate all memories (flags unknown provenance)
340
365
  memgit fsck # verify store integrity
341
366
 
342
367
  # Import / export
@@ -385,6 +410,9 @@ memgit thread list / switch / create
385
410
  | **Windsurf** | MCP stdio | `memgit setup windsurf` |
386
411
  | **Cline / Roo-Code** | MCP stdio | `memgit setup cline` |
387
412
  | **Continue.dev** | MCP stdio | `memgit setup continue` |
413
+ | **Codex** | MCP stdio (TOML) | `memgit setup codex` |
414
+ | **Antigravity** | MCP stdio | `memgit setup antigravity` |
415
+ | **Gemini CLI** | MCP stdio | `memgit setup gemini-cli` |
388
416
  | **ChatGPT (Custom Actions)** | HTTP + OpenAPI | `memgit serve --http` → import `http://localhost:7474/openapi.json` |
389
417
  | **Gemini API** | HTTP function calling | `memgit serve --http` + `llm-tool-definitions.json` |
390
418
  | **Any MCP tool** | MCP stdio | Add `{"command": "memgit", "args": ["serve"]}` to config |
@@ -445,7 +473,7 @@ git clone https://github.com/code4161/memgit.git
445
473
  cd memgit
446
474
  python -m venv .venv && source .venv/bin/activate
447
475
  pip install -e ".[dev]"
448
- pytest # 245 tests, all passing, < 5 seconds
476
+ pytest # 404 tests, all passing, < 5 seconds
449
477
  ```
450
478
 
451
479
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -470,14 +498,19 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
470
498
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
471
499
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
472
500
  - [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
473
- - [ ] Chocolatey (not yet live on community.chocolatey.org)
501
+ - [x] Chocolatey live on community.chocolatey.org (`choco install memgit`)
474
502
  - [x] Interactive setup wizard (`memgit setup`)
475
503
  - [x] Smart `memgit init` (auto-detects tool, no path needed)
476
504
  - [x] Lossless memories — full `body` alongside the compact rule (v0.3.0)
477
505
  - [x] Project-scoped memories + `memgit onboard` mid-project bootstrap (v0.3.0)
478
506
  - [x] VS Code extension (v0.1.5, Marketplace: code416-memgit.memgit)
507
+ - [x] Codex + Antigravity support — MCP registration + `AGENTS.md` core guide (v0.8.0)
508
+ - [x] `memgit eval` — measured retrieval quality, real + non-circular sets (v0.8.0)
509
+ - [x] Usage-aware ranking — the recall ledger feeds relevance, not just the guide (v0.8.0)
510
+ - [x] Automatic core-guide bootstrap — the self-improving loop starts itself (v0.8.0)
479
511
  - [ ] JetBrains plugin (Phase 3)
480
- - [ ] Semantic search via embeddings (Phase 4)
512
+ - [ ] Semantic search via embeddings — gated on `memgit eval` showing a real gain (Phase 4)
513
+ - [ ] Public benchmark numbers (LongMemEval, LoCoMo) (Phase 4)
481
514
  - [x] memgit.dev website (live)
482
515
  - [ ] Memory compression / auto-summarization (Phase 5)
483
516
  - [ ] Team access control + audit trail (Phase 5)
@@ -10,7 +10,7 @@ Version-controlled, cross-AI context that persists, diffs, rolls back, and syncs
10
10
 
11
11
  [![PyPI](https://img.shields.io/pypi/v/memgit)](https://pypi.org/project/memgit/)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
13
- [![Tests](https://img.shields.io/badge/tests-245%20passing-brightgreen)](tests/)
13
+ [![Tests](https://img.shields.io/badge/tests-404%20passing-brightgreen)](tests/)
14
14
 
15
15
  ---
16
16
 
@@ -34,9 +34,9 @@ You've probably already tried both. Here's why they hit a ceiling:
34
34
 
35
35
  ---
36
36
 
37
- ## Proof — token savings you can measure
37
+ ## Proof — context costs you can measure
38
38
 
39
- Run this on your own store to see the actual numbers:
39
+ Run this on your own store to see the actual numbers (measured where possible; estimates labeled):
40
40
 
41
41
  ```
42
42
  $ memgit stats
@@ -44,20 +44,17 @@ $ memgit stats
44
44
  Total memories: 108 (41 feedback · 23 user · 19 project · 12 reference · 8 convention · 5 lesson)
45
45
  Priority: 3 critical · 67 medium · 38 low
46
46
 
47
- Token cost comparison:
48
- ┌─────────────────────────────────────┬──────────────────┬───────────────────┬─────────────────────┐
49
- │ Approach │ Tokens/session │ vs full load │ $/session (GPT-4o) │
50
- ├─────────────────────────────────────┼──────────────────┼───────────────────┼─────────────────────┤
51
- claude.md / dump all memories │ 12,840 │ 100% baseline │ $0.0321 │
52
- memgit search (BM25 top-8) │ 640 │ 5% (95% savings) │ $0.0016 │
53
- └─────────────────────────────────────┴──────────────────┴───────────────────┴─────────────────────┘
54
-
55
- Weekly savings (10 sessions/week):
56
- Tokens saved: 122,000/week
57
- Cost saved: $0.31/week → $15.86/year (at GPT-4o input pricing, $2.50/M)
47
+ Context footprint (measured where possible; estimates labeled)
48
+
49
+ Surface Tokens
50
+ Full store (every memory as context) 12,840
51
+ Resume digest (measured render) 540
52
+ Recall block (estimate: top-3 rules chars/4) ~60
53
+
54
+ per-session injected ≈ 600 tokens (estimate) vs 12,840 tokens if the full store were loaded
58
55
  ```
59
56
 
60
- **Why such a big difference?** claude.md loads *all* context every session. memgit uses BM25 relevance scoring it loads *only the 8 memories most relevant to the current session*, not everything you've ever recorded.
57
+ **Why such a big difference?** claude.md loads *all* context every session. memgit injects a bounded resume digest plus BM25-matched recall — *only what is relevant to this session*, not everything you've ever recorded. The digest is measured by actually rendering it, and the store total is the real corpus size; nothing here is a simulated benchmark.
61
58
 
62
59
  ---
63
60
 
@@ -121,9 +118,11 @@ brew tap code4161/tap && brew install memgit
121
118
 
122
119
  **Windows:**
123
120
  ```powershell
121
+ choco install memgit
122
+ # or
124
123
  pip install memgit
125
124
  ```
126
- (`choco install memgit` is not live yet — the Chocolatey package is not on community.chocolatey.org. Use pip until it lands.)
125
+ (The Chocolatey package is live on community.chocolatey.org; newly pushed versions can take a few days to clear moderation — `pip install memgit` always has the latest.)
127
126
 
128
127
  **Any AI tool config (no Python needed — npx auto-installs on first run):**
129
128
  ```json
@@ -164,7 +163,7 @@ memgit onboard # mines the repo, prints the bootstrap brief
164
163
 
165
164
  `onboard` first extracts a **repo digest** deterministically — git history (recent commit subjects, hot files/directories by churn, authors, branch, tags), detected stack from manifests, and the docs worth reading — using bounded, read-only probes that stay near-instant even on huge repositories. The brief then tells your AI agent exactly what to do with it: read only the listed files (no tree crawling), extract 10–20 durable facts (purpose, architecture, conventions, current state, gotchas), save each as a typed memory, and checkpoint the seed set. Paste it into a session — or don't: if the AI searches memory in a project that has none, the MCP server itself replies with the bootstrap instructions instead of a bare "no results."
166
165
 
167
- Memories are **project-scoped**: each carries the workspace it belongs to, searches boost the project you're standing in (global rules still surface), and the resume digest leads with *your current project's* recent worknot whatever repo you touched last night.
166
+ Memories are **project-scoped, filter-by-default** (v0.7.0): each carries the workspace it belongs to, and searches, recall injections, and the resume digest (recent memories, checkpoints, depth hints) are **filtered** to the current project's family plus explicitly-global memories — another project's content never leaks in. Widen deliberately with `memgit search --all-projects` / `all_projects: true` (every hit then carries its `project` label), or hard-filter one project with `--project`. A memory with no project is **explicitly global** (applies everywhere): save one with `memgit add --global` or `project: ""`. A save whose project *cannot be determined* is never silently global it's quarantined under `_unknown` (visible in `list` as `[?project]`, flagged by `lint`, surfaced nowhere) until you relabel it with `memgit doctor --relabel`.
168
167
 
169
168
  ---
170
169
 
@@ -255,10 +254,25 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
255
254
 
256
255
  A project's hardest onboarding problem isn't *what* it does — it's *how to work in it*: which skill to invoke, which command to run, which tool to reach for. That lives in a `CLAUDE.md` or a skills folder the AI host may or may not be configured to read. memgit carries it for you.
257
256
 
258
- `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/`, `.gemini/`, and a marker-block in Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
257
+ `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/` and marker-delimited blocks in the shared `GEMINI.md` (Gemini CLI auto-loads only that file) and Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
259
258
 
260
259
  And it **learns**: a sidecar usage ledger tracks which memories actually get recalled, and the most-used ones are auto-promoted as pointers into the guide over time (budget-capped, decaying, and always subordinate to the repo's own rules — it never restates or overrides them). Drifted? `memgit core heal` rebuilds it.
261
260
 
261
+ Since 0.8.0 it also **starts itself**: a project's first guide is created automatically once it holds a handful of memories, so the loop no longer waits on someone remembering to run `core seed`. The guide leads with what the project actually holds — "this project has N saved memories covering *topics*" — because a stated count of real prior work is evidence a model can act on, where an abstract instruction to check memory is something it can weigh against its own confidence and skip.
262
+
263
+ ---
264
+
265
+ ## Ranking you can prove
266
+
267
+ Retrieval quality used to be adjusted on intuition. `memgit eval` replaces that with a measurement, using two frozen sets mined from the store itself:
268
+
269
+ - **recall** — real prompts and the memories memgit actually surfaced for them. Measures *stability*: did a change break what used to work?
270
+ - **synthetic** — each memory queried by its own `why`, expecting itself back, with the slug's own words stripped out of the query. Measures *correctness*, independently of any past ranking. (The recall set alone is circular — its answers came from the ranking under test.)
271
+
272
+ Both report hit@1, recall@3/5/10 and MRR against a pinned baseline. There is deliberately no single blended score, and no fabricated "tokens saved" number.
273
+
274
+ It earns its keep immediately. Two changes built for 0.8.0 looked obviously right and were measured wrong: a recency multiplier (cut — real-prompt hit@1 −0.020, MRR −0.018) and destructive stemming, which fixed its motivating query while costing hit@1 −0.038 overall (rebuilt as an additive field, then +0.020/+0.041/+0.019). A BM25 normalisation bug introduced in the same release was caught the same way.
275
+
262
276
  ---
263
277
 
264
278
  ## Depth advertisement, trackers & supersession (v0.6.0)
@@ -279,14 +293,14 @@ Measured across 289 real sessions: injected recall reached ~59% of them, but onl
279
293
  # Core (git-like)
280
294
  memgit init # initialize store (auto-detects best path)
281
295
  memgit onboard # bootstrap brief for an existing codebase
282
- memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --supersedes old-slug)
296
+ memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --global everywhere, --supersedes old-slug)
283
297
  memgit commit -m "message" # checkpoint current state
284
298
  memgit log # history
285
299
  memgit diff [sha1] [sha2] # what changed
286
300
  memgit show <slug> # display a memory
287
301
  memgit remove <slug> # remove from active index (history preserved)
288
302
  memgit status # staged changes
289
- memgit search <query> # BM25 relevance search
303
+ memgit search <query> # BM25 search, scoped to this project + global (--all-projects to widen)
290
304
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
291
305
  memgit resume # where we left off — session-start digest
292
306
  memgit merge <thread> # three-way merge a thread into the current one
@@ -297,12 +311,23 @@ memgit core seed # draft a guide from this project's skills + r
297
311
  memgit core sync # deliver it into each AI host's own rules file (additive)
298
312
  memgit core show / edit # view / curate the guide
299
313
  memgit core heal # self-repair a guide that has drifted
314
+ # (a project's FIRST guide is created automatically
315
+ # once it holds 5+ memories — no command needed)
316
+
317
+ # Retrieval evaluation — prove a ranking change helped
318
+ memgit eval mine # freeze a regression set from real recall events
319
+ memgit eval mine --synthetic # non-circular set: query each memory by its own `why`
320
+ memgit eval run --set recall # hit@1 / recall@3,5,10 / MRR vs the pinned baseline
321
+ memgit eval run --baseline # pin the current result as the comparison point
322
+ memgit eval run --misses 10 # inspect the cases where nothing relevant surfaced
300
323
 
301
324
  # Scale & proof
302
325
  memgit squash # compress old history (archives what it collapses)
303
- memgit gc # reclaim disk: sweep unreachable objects
304
- memgit stats # token savings + disk usage
305
- memgit lint # validate all memories
326
+ memgit gc # reclaim disk: sweep unreachable objects + stale session caches
327
+ memgit stats # measured context costs + disk usage
328
+ memgit doctor # hygiene report: quarantined/_unknown memories, stale caches, orphaned usage
329
+ memgit doctor --relabel map.json # bulk re-project memories ({"slug": "Label" | ""}); one checkpoint
330
+ memgit lint # validate all memories (flags unknown provenance)
306
331
  memgit fsck # verify store integrity
307
332
 
308
333
  # Import / export
@@ -351,6 +376,9 @@ memgit thread list / switch / create
351
376
  | **Windsurf** | MCP stdio | `memgit setup windsurf` |
352
377
  | **Cline / Roo-Code** | MCP stdio | `memgit setup cline` |
353
378
  | **Continue.dev** | MCP stdio | `memgit setup continue` |
379
+ | **Codex** | MCP stdio (TOML) | `memgit setup codex` |
380
+ | **Antigravity** | MCP stdio | `memgit setup antigravity` |
381
+ | **Gemini CLI** | MCP stdio | `memgit setup gemini-cli` |
354
382
  | **ChatGPT (Custom Actions)** | HTTP + OpenAPI | `memgit serve --http` → import `http://localhost:7474/openapi.json` |
355
383
  | **Gemini API** | HTTP function calling | `memgit serve --http` + `llm-tool-definitions.json` |
356
384
  | **Any MCP tool** | MCP stdio | Add `{"command": "memgit", "args": ["serve"]}` to config |
@@ -411,7 +439,7 @@ git clone https://github.com/code4161/memgit.git
411
439
  cd memgit
412
440
  python -m venv .venv && source .venv/bin/activate
413
441
  pip install -e ".[dev]"
414
- pytest # 245 tests, all passing, < 5 seconds
442
+ pytest # 404 tests, all passing, < 5 seconds
415
443
  ```
416
444
 
417
445
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -436,14 +464,19 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
436
464
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
437
465
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
438
466
  - [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
439
- - [ ] Chocolatey (not yet live on community.chocolatey.org)
467
+ - [x] Chocolatey live on community.chocolatey.org (`choco install memgit`)
440
468
  - [x] Interactive setup wizard (`memgit setup`)
441
469
  - [x] Smart `memgit init` (auto-detects tool, no path needed)
442
470
  - [x] Lossless memories — full `body` alongside the compact rule (v0.3.0)
443
471
  - [x] Project-scoped memories + `memgit onboard` mid-project bootstrap (v0.3.0)
444
472
  - [x] VS Code extension (v0.1.5, Marketplace: code416-memgit.memgit)
473
+ - [x] Codex + Antigravity support — MCP registration + `AGENTS.md` core guide (v0.8.0)
474
+ - [x] `memgit eval` — measured retrieval quality, real + non-circular sets (v0.8.0)
475
+ - [x] Usage-aware ranking — the recall ledger feeds relevance, not just the guide (v0.8.0)
476
+ - [x] Automatic core-guide bootstrap — the self-improving loop starts itself (v0.8.0)
445
477
  - [ ] JetBrains plugin (Phase 3)
446
- - [ ] Semantic search via embeddings (Phase 4)
478
+ - [ ] Semantic search via embeddings — gated on `memgit eval` showing a real gain (Phase 4)
479
+ - [ ] Public benchmark numbers (LongMemEval, LoCoMo) (Phase 4)
447
480
  - [x] memgit.dev website (live)
448
481
  - [ ] Memory compression / auto-summarization (Phase 5)
449
482
  - [ ] Team access control + audit trail (Phase 5)
@@ -1,3 +1,3 @@
1
1
  """memgit — git for AI memory."""
2
2
 
3
- __version__ = "0.6.2"
3
+ __version__ = "0.8.0"