memgit 0.1.5__tar.gz → 0.3.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.
- {memgit-0.1.5 → memgit-0.3.0}/PKG-INFO +93 -17
- {memgit-0.1.5 → memgit-0.3.0}/README.md +89 -16
- {memgit-0.1.5 → memgit-0.3.0}/memgit/__init__.py +1 -1
- {memgit-0.1.5 → memgit-0.3.0}/memgit/cli.py +558 -42
- memgit-0.3.0/memgit/cloud/__init__.py +6 -0
- memgit-0.3.0/memgit/cloud/client.py +176 -0
- memgit-0.3.0/memgit/cloud/commands.py +379 -0
- memgit-0.3.0/memgit/cloud/crypto.py +129 -0
- memgit-0.3.0/memgit/cloud/state.py +81 -0
- memgit-0.3.0/memgit/cloud/sync.py +239 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit/http_server.py +16 -1
- {memgit-0.1.5 → memgit-0.3.0}/memgit/importer.py +71 -11
- {memgit-0.1.5 → memgit-0.3.0}/memgit/mcp_server.py +138 -10
- {memgit-0.1.5 → memgit-0.3.0}/memgit/models.py +3 -1
- {memgit-0.1.5 → memgit-0.3.0}/memgit/repo.py +641 -45
- {memgit-0.1.5 → memgit-0.3.0}/memgit/scorer.py +17 -1
- {memgit-0.1.5 → memgit-0.3.0}/memgit/toon.py +63 -19
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/PKG-INFO +93 -17
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/SOURCES.txt +9 -1
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/requires.txt +4 -0
- {memgit-0.1.5 → memgit-0.3.0}/pyproject.toml +2 -1
- memgit-0.3.0/tests/test_v020.py +385 -0
- memgit-0.3.0/tests/test_v030.py +297 -0
- {memgit-0.1.5 → memgit-0.3.0}/LICENSE +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit/graph.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit/store.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit/tokens.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/dependency_links.txt +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/entry_points.txt +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/memgit.egg-info/top_level.txt +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/setup.cfg +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/tests/test_advanced.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/tests/test_setup.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/tests/test_store_repo.py +0 -0
- {memgit-0.1.5 → memgit-0.3.0}/tests/test_toon.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memgit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.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
|
|
@@ -27,6 +27,9 @@ Requires-Dist: pytest>=8.0; extra == "dev"
|
|
|
27
27
|
Requires-Dist: pytest-anyio>=0.0.0; extra == "dev"
|
|
28
28
|
Provides-Extra: tokens
|
|
29
29
|
Requires-Dist: tiktoken>=0.7; extra == "tokens"
|
|
30
|
+
Provides-Extra: cloud
|
|
31
|
+
Requires-Dist: pynacl>=1.5; extra == "cloud"
|
|
32
|
+
Requires-Dist: httpx>=0.27; extra == "cloud"
|
|
30
33
|
Dynamic: license-file
|
|
31
34
|
|
|
32
35
|
<p align="center">
|
|
@@ -52,6 +55,8 @@ You've probably already tried both. Here's why they hit a ceiling:
|
|
|
52
55
|
| Capability | claude.md | mem-search plugin | **memgit** |
|
|
53
56
|
|---|---|---|---|
|
|
54
57
|
| Loads only relevant context | ❌ loads everything | ⚠️ loads recent observations | ✅ BM25 search — top-k per query |
|
|
58
|
+
| Project-aware across a multi-repo life | ❌ per-file | ❌ | ✅ memories carry a `project`; the current workspace ranks first |
|
|
59
|
+
| Adopt on an existing codebase | ❌ starts blank | ❌ starts blank | ✅ `memgit onboard` — seed the store from the repo in one pass |
|
|
55
60
|
| Version history | ❌ | ❌ | ✅ full commit log |
|
|
56
61
|
| Diff between sessions | ❌ | ❌ | ✅ `memgit diff` |
|
|
57
62
|
| Roll back a wrong memory | ❌ manual edit | ❌ | ✅ `memgit rollback` |
|
|
@@ -166,49 +171,107 @@ pip install memgit
|
|
|
166
171
|
```bash
|
|
167
172
|
# 1. Install and initialize
|
|
168
173
|
pip install memgit
|
|
169
|
-
memgit init # auto-detects best location
|
|
174
|
+
memgit init # auto-detects the best location, finds your existing
|
|
175
|
+
# Claude Code memories, and offers to import them
|
|
170
176
|
|
|
171
|
-
# 2.
|
|
172
|
-
memgit import claude-code ~/.claude/projects/
|
|
173
|
-
|
|
174
|
-
# 3. Register with your AI tools (interactive picker)
|
|
177
|
+
# 2. Register with your AI tools (interactive picker)
|
|
175
178
|
memgit setup
|
|
176
179
|
|
|
177
|
-
#
|
|
180
|
+
# 3. See your token savings
|
|
178
181
|
memgit stats
|
|
179
182
|
```
|
|
180
183
|
|
|
184
|
+
`init` walks you through it — no paths to hunt down. (Importing later is one command with no arguments: `memgit sync` auto-finds `~/.claude/projects/*/memory`.)
|
|
185
|
+
|
|
181
186
|
Restart your AI tool — it now searches your memory store at the start of every session.
|
|
182
187
|
|
|
183
188
|
---
|
|
184
189
|
|
|
190
|
+
## Adopting memgit mid-project
|
|
191
|
+
|
|
192
|
+
Memory tools have a cold-start problem: install one halfway through a project and it knows *nothing* — there's no initial point, and context only trickles in from future sessions. memgit solves this with a one-time seeding pass:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
cd your-project
|
|
196
|
+
memgit onboard # prints the bootstrap brief
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
The brief tells your AI agent exactly what to do: read the README/docs/manifests and recent git history, 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
|
+
|
|
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 work — not whatever repo you touched last night.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Resume where you left off
|
|
206
|
+
|
|
207
|
+
Ask an AI "can we proceed on the pending tasks?" in a fresh session and it will guess from whatever file happens to be open. `memgit resume` replaces the guess with the record:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
memgit resume # last checkpoints, work in flight, recent + critical memories
|
|
211
|
+
memgit resume --plain # plain text, for piping into an AI context
|
|
212
|
+
memgit resume --json # for tooling
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Wire it into Claude Code so every new session **starts** with this digest in context — no tool call, no judgment required:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
memgit setup hooks # installs a SessionStart hook (~/.claude/settings.json)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
185
225
|
## Scale to 10,000+ sessions
|
|
186
226
|
|
|
187
|
-
After months of use, your checkpoint history grows.
|
|
227
|
+
After months of use, your checkpoint history grows. Squash compresses it, gc reclaims the disk:
|
|
188
228
|
|
|
189
229
|
```bash
|
|
190
230
|
memgit squash --keep-last 100 # keep last 100 checkpoints, squash everything older
|
|
191
231
|
memgit squash --older-than 30 # squash everything older than 30 days
|
|
192
232
|
memgit squash --dry-run # preview first
|
|
233
|
+
|
|
234
|
+
memgit gc # delete unreachable objects, trim reflogs
|
|
235
|
+
memgit gc --dry-run # preview
|
|
236
|
+
memgit gc --squash-keep 200 # compact history, then sweep
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
The current memory **state is always preserved** — and squash is lossless-in-substance: every collapsed checkpoint leaves a one-line record (time, author, diff, message) in an append-only archive under `.memgit/logs/archive/` that gc never touches. Benchmark on a 2,000-checkpoint store: **94% smaller** (39.5 MB → 2.2 MB), `fsck` clean. History operations stay O(1) as the chain grows (SHA resolution and checkpoint counting measured at ~0.08 ms at 2,000 checkpoints).
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Multiple agents, one memory
|
|
244
|
+
|
|
245
|
+
All writes go through a git-style store lock (0.08 ms overhead), so concurrent agents can't corrupt the store or lose each other's updates. Two patterns:
|
|
246
|
+
|
|
247
|
+
**Shared thread** — agents write concurrently; if one commits while another has work staged, the second commit auto-merges (three-way, against the recorded base) instead of clobbering. Set `MEMGIT_AUTHOR=agent-name` so each checkpoint says who did it.
|
|
248
|
+
|
|
249
|
+
**Thread per agent** — isolate, then integrate:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
memgit thread create agent-1 # branch off for each agent
|
|
253
|
+
# ... agents work on their own threads ...
|
|
254
|
+
memgit merge agent-1 # three-way merge back (common-ancestor based)
|
|
193
255
|
```
|
|
194
256
|
|
|
195
|
-
|
|
257
|
+
Conflicts (same memory changed on both sides) resolve to the newest version; an edit always beats a delete. Both histories are preserved.
|
|
196
258
|
|
|
197
259
|
---
|
|
198
260
|
|
|
199
261
|
## What the AI sees
|
|
200
262
|
|
|
201
|
-
Once registered via MCP, every AI tool gets
|
|
263
|
+
Once registered via MCP, every AI tool gets 6 tools:
|
|
202
264
|
|
|
203
265
|
| Tool | When the AI uses it |
|
|
204
266
|
|---|---|
|
|
205
|
-
| `
|
|
267
|
+
| `resume_session` | When the request depends on prior state — "continue", "the pending tasks", session start |
|
|
268
|
+
| `search_memories` | Before answering anything that touches past work or preferences |
|
|
206
269
|
| `get_memory` | When it needs full details of a specific memory |
|
|
207
270
|
| `list_memories` | To browse or audit what's stored |
|
|
208
271
|
| `save_memory` | When it learns something worth keeping for next time |
|
|
209
272
|
| `get_checkpoint_log` | To check when memories were last synced |
|
|
210
273
|
|
|
211
|
-
The tool descriptions
|
|
274
|
+
The tool descriptions teach the AI **judgment** — "does this request depend on state you don't have in context?" — rather than keyword triggers. Measured cost of the whole tool surface: ~1,150 tokens once per session; a `resume_session` reply is ~335.
|
|
212
275
|
|
|
213
276
|
---
|
|
214
277
|
|
|
@@ -217,7 +280,8 @@ The tool descriptions tell the AI **when** to call each one — making it defaul
|
|
|
217
280
|
```bash
|
|
218
281
|
# Core (git-like)
|
|
219
282
|
memgit init # initialize store (auto-detects best path)
|
|
220
|
-
memgit
|
|
283
|
+
memgit onboard # bootstrap brief for an existing codebase
|
|
284
|
+
memgit add <slug> <rule> # stage a memory (--body for full detail, --project to scope)
|
|
221
285
|
memgit commit -m "message" # checkpoint current state
|
|
222
286
|
memgit log # history
|
|
223
287
|
memgit diff [sha1] [sha2] # what changed
|
|
@@ -226,16 +290,19 @@ memgit remove <slug> # remove from active index (history preserved)
|
|
|
226
290
|
memgit status # staged changes
|
|
227
291
|
memgit search <query> # BM25 relevance search
|
|
228
292
|
memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
|
|
229
|
-
memgit
|
|
293
|
+
memgit resume # where we left off — session-start digest
|
|
294
|
+
memgit merge <thread> # three-way merge a thread into the current one
|
|
230
295
|
|
|
231
296
|
# Scale & proof
|
|
232
|
-
memgit
|
|
297
|
+
memgit squash # compress old history (archives what it collapses)
|
|
298
|
+
memgit gc # reclaim disk: sweep unreachable objects
|
|
299
|
+
memgit stats # token savings + disk usage
|
|
233
300
|
memgit lint # validate all memories
|
|
234
301
|
memgit fsck # verify store integrity
|
|
235
302
|
|
|
236
303
|
# Import / export
|
|
237
|
-
memgit sync # sync from Claude Code files + commit
|
|
238
|
-
memgit import claude-code
|
|
304
|
+
memgit sync # sync from Claude Code files + commit (auto-finds them)
|
|
305
|
+
memgit import claude-code [path] # path optional — defaults to ~/.claude/projects/*/memory
|
|
239
306
|
memgit import file <path>
|
|
240
307
|
memgit export <slug>
|
|
241
308
|
|
|
@@ -254,6 +321,8 @@ memgit setup cursor
|
|
|
254
321
|
memgit setup windsurf
|
|
255
322
|
memgit setup cline
|
|
256
323
|
memgit setup continue
|
|
324
|
+
memgit setup gemini-cli
|
|
325
|
+
memgit setup hooks # Claude Code SessionStart hook → auto-inject resume digest
|
|
257
326
|
|
|
258
327
|
# Server
|
|
259
328
|
memgit serve # MCP stdio (Claude Code, Cursor, Windsurf, Cline)
|
|
@@ -298,9 +367,11 @@ The same memory in TOON:
|
|
|
298
367
|
```
|
|
299
368
|
TOON1|fb|no-db-mock|2026-07-01T10:00Z
|
|
300
369
|
#testing #database
|
|
370
|
+
PROJ:my-app
|
|
301
371
|
RULE:Never mock the database in tests
|
|
302
372
|
WHY:Mocked tests passed but prod migration failed last quarter
|
|
303
373
|
WHEN:Any persistence test
|
|
374
|
+
BODY:Full long-form detail lives here, losslessly (newlines escaped).\nSearch returns the compact RULE; get_memory returns everything.
|
|
304
375
|
```
|
|
305
376
|
|
|
306
377
|
Measured with a real tokenizer, TOON is ~5–10% leaner than equivalent markdown — a nice bonus, not the headline. **The headline saving is retrieval**: memgit loads the top-8 relevant memories per query instead of everything.
|
|
@@ -353,10 +424,15 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
|
353
424
|
- [x] `memgit git push/pull` — team sync via standard git
|
|
354
425
|
- [x] Flat `memories/` directory — grep/diff/blame your memories
|
|
355
426
|
- [x] D3.js graph visualization of memory relationships
|
|
427
|
+
- [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
|
|
428
|
+
- [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
|
|
429
|
+
- [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
|
|
356
430
|
- [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
|
|
357
431
|
- [ ] Chocolatey (not yet live on community.chocolatey.org)
|
|
358
432
|
- [x] Interactive setup wizard (`memgit setup`)
|
|
359
433
|
- [x] Smart `memgit init` (auto-detects tool, no path needed)
|
|
434
|
+
- [x] Lossless memories — full `body` alongside the compact rule (v0.3.0)
|
|
435
|
+
- [x] Project-scoped memories + `memgit onboard` mid-project bootstrap (v0.3.0)
|
|
360
436
|
- [x] VS Code extension (v0.1.5, Marketplace: code416-memgit.memgit)
|
|
361
437
|
- [ ] JetBrains plugin (Phase 3)
|
|
362
438
|
- [ ] Semantic search via embeddings (Phase 4)
|
|
@@ -21,6 +21,8 @@ You've probably already tried both. Here's why they hit a ceiling:
|
|
|
21
21
|
| Capability | claude.md | mem-search plugin | **memgit** |
|
|
22
22
|
|---|---|---|---|
|
|
23
23
|
| Loads only relevant context | ❌ loads everything | ⚠️ loads recent observations | ✅ BM25 search — top-k per query |
|
|
24
|
+
| Project-aware across a multi-repo life | ❌ per-file | ❌ | ✅ memories carry a `project`; the current workspace ranks first |
|
|
25
|
+
| Adopt on an existing codebase | ❌ starts blank | ❌ starts blank | ✅ `memgit onboard` — seed the store from the repo in one pass |
|
|
24
26
|
| Version history | ❌ | ❌ | ✅ full commit log |
|
|
25
27
|
| Diff between sessions | ❌ | ❌ | ✅ `memgit diff` |
|
|
26
28
|
| Roll back a wrong memory | ❌ manual edit | ❌ | ✅ `memgit rollback` |
|
|
@@ -135,49 +137,107 @@ pip install memgit
|
|
|
135
137
|
```bash
|
|
136
138
|
# 1. Install and initialize
|
|
137
139
|
pip install memgit
|
|
138
|
-
memgit init # auto-detects best location
|
|
140
|
+
memgit init # auto-detects the best location, finds your existing
|
|
141
|
+
# Claude Code memories, and offers to import them
|
|
139
142
|
|
|
140
|
-
# 2.
|
|
141
|
-
memgit import claude-code ~/.claude/projects/
|
|
142
|
-
|
|
143
|
-
# 3. Register with your AI tools (interactive picker)
|
|
143
|
+
# 2. Register with your AI tools (interactive picker)
|
|
144
144
|
memgit setup
|
|
145
145
|
|
|
146
|
-
#
|
|
146
|
+
# 3. See your token savings
|
|
147
147
|
memgit stats
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
`init` walks you through it — no paths to hunt down. (Importing later is one command with no arguments: `memgit sync` auto-finds `~/.claude/projects/*/memory`.)
|
|
151
|
+
|
|
150
152
|
Restart your AI tool — it now searches your memory store at the start of every session.
|
|
151
153
|
|
|
152
154
|
---
|
|
153
155
|
|
|
156
|
+
## Adopting memgit mid-project
|
|
157
|
+
|
|
158
|
+
Memory tools have a cold-start problem: install one halfway through a project and it knows *nothing* — there's no initial point, and context only trickles in from future sessions. memgit solves this with a one-time seeding pass:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
cd your-project
|
|
162
|
+
memgit onboard # prints the bootstrap brief
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The brief tells your AI agent exactly what to do: read the README/docs/manifests and recent git history, 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
|
+
|
|
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 work — not whatever repo you touched last night.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Resume where you left off
|
|
172
|
+
|
|
173
|
+
Ask an AI "can we proceed on the pending tasks?" in a fresh session and it will guess from whatever file happens to be open. `memgit resume` replaces the guess with the record:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
memgit resume # last checkpoints, work in flight, recent + critical memories
|
|
177
|
+
memgit resume --plain # plain text, for piping into an AI context
|
|
178
|
+
memgit resume --json # for tooling
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Wire it into Claude Code so every new session **starts** with this digest in context — no tool call, no judgment required:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
memgit setup hooks # installs a SessionStart hook (~/.claude/settings.json)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
154
191
|
## Scale to 10,000+ sessions
|
|
155
192
|
|
|
156
|
-
After months of use, your checkpoint history grows.
|
|
193
|
+
After months of use, your checkpoint history grows. Squash compresses it, gc reclaims the disk:
|
|
157
194
|
|
|
158
195
|
```bash
|
|
159
196
|
memgit squash --keep-last 100 # keep last 100 checkpoints, squash everything older
|
|
160
197
|
memgit squash --older-than 30 # squash everything older than 30 days
|
|
161
198
|
memgit squash --dry-run # preview first
|
|
199
|
+
|
|
200
|
+
memgit gc # delete unreachable objects, trim reflogs
|
|
201
|
+
memgit gc --dry-run # preview
|
|
202
|
+
memgit gc --squash-keep 200 # compact history, then sweep
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The current memory **state is always preserved** — and squash is lossless-in-substance: every collapsed checkpoint leaves a one-line record (time, author, diff, message) in an append-only archive under `.memgit/logs/archive/` that gc never touches. Benchmark on a 2,000-checkpoint store: **94% smaller** (39.5 MB → 2.2 MB), `fsck` clean. History operations stay O(1) as the chain grows (SHA resolution and checkpoint counting measured at ~0.08 ms at 2,000 checkpoints).
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Multiple agents, one memory
|
|
210
|
+
|
|
211
|
+
All writes go through a git-style store lock (0.08 ms overhead), so concurrent agents can't corrupt the store or lose each other's updates. Two patterns:
|
|
212
|
+
|
|
213
|
+
**Shared thread** — agents write concurrently; if one commits while another has work staged, the second commit auto-merges (three-way, against the recorded base) instead of clobbering. Set `MEMGIT_AUTHOR=agent-name` so each checkpoint says who did it.
|
|
214
|
+
|
|
215
|
+
**Thread per agent** — isolate, then integrate:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
memgit thread create agent-1 # branch off for each agent
|
|
219
|
+
# ... agents work on their own threads ...
|
|
220
|
+
memgit merge agent-1 # three-way merge back (common-ancestor based)
|
|
162
221
|
```
|
|
163
222
|
|
|
164
|
-
|
|
223
|
+
Conflicts (same memory changed on both sides) resolve to the newest version; an edit always beats a delete. Both histories are preserved.
|
|
165
224
|
|
|
166
225
|
---
|
|
167
226
|
|
|
168
227
|
## What the AI sees
|
|
169
228
|
|
|
170
|
-
Once registered via MCP, every AI tool gets
|
|
229
|
+
Once registered via MCP, every AI tool gets 6 tools:
|
|
171
230
|
|
|
172
231
|
| Tool | When the AI uses it |
|
|
173
232
|
|---|---|
|
|
174
|
-
| `
|
|
233
|
+
| `resume_session` | When the request depends on prior state — "continue", "the pending tasks", session start |
|
|
234
|
+
| `search_memories` | Before answering anything that touches past work or preferences |
|
|
175
235
|
| `get_memory` | When it needs full details of a specific memory |
|
|
176
236
|
| `list_memories` | To browse or audit what's stored |
|
|
177
237
|
| `save_memory` | When it learns something worth keeping for next time |
|
|
178
238
|
| `get_checkpoint_log` | To check when memories were last synced |
|
|
179
239
|
|
|
180
|
-
The tool descriptions
|
|
240
|
+
The tool descriptions teach the AI **judgment** — "does this request depend on state you don't have in context?" — rather than keyword triggers. Measured cost of the whole tool surface: ~1,150 tokens once per session; a `resume_session` reply is ~335.
|
|
181
241
|
|
|
182
242
|
---
|
|
183
243
|
|
|
@@ -186,7 +246,8 @@ The tool descriptions tell the AI **when** to call each one — making it defaul
|
|
|
186
246
|
```bash
|
|
187
247
|
# Core (git-like)
|
|
188
248
|
memgit init # initialize store (auto-detects best path)
|
|
189
|
-
memgit
|
|
249
|
+
memgit onboard # bootstrap brief for an existing codebase
|
|
250
|
+
memgit add <slug> <rule> # stage a memory (--body for full detail, --project to scope)
|
|
190
251
|
memgit commit -m "message" # checkpoint current state
|
|
191
252
|
memgit log # history
|
|
192
253
|
memgit diff [sha1] [sha2] # what changed
|
|
@@ -195,16 +256,19 @@ memgit remove <slug> # remove from active index (history preserved)
|
|
|
195
256
|
memgit status # staged changes
|
|
196
257
|
memgit search <query> # BM25 relevance search
|
|
197
258
|
memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
|
|
198
|
-
memgit
|
|
259
|
+
memgit resume # where we left off — session-start digest
|
|
260
|
+
memgit merge <thread> # three-way merge a thread into the current one
|
|
199
261
|
|
|
200
262
|
# Scale & proof
|
|
201
|
-
memgit
|
|
263
|
+
memgit squash # compress old history (archives what it collapses)
|
|
264
|
+
memgit gc # reclaim disk: sweep unreachable objects
|
|
265
|
+
memgit stats # token savings + disk usage
|
|
202
266
|
memgit lint # validate all memories
|
|
203
267
|
memgit fsck # verify store integrity
|
|
204
268
|
|
|
205
269
|
# Import / export
|
|
206
|
-
memgit sync # sync from Claude Code files + commit
|
|
207
|
-
memgit import claude-code
|
|
270
|
+
memgit sync # sync from Claude Code files + commit (auto-finds them)
|
|
271
|
+
memgit import claude-code [path] # path optional — defaults to ~/.claude/projects/*/memory
|
|
208
272
|
memgit import file <path>
|
|
209
273
|
memgit export <slug>
|
|
210
274
|
|
|
@@ -223,6 +287,8 @@ memgit setup cursor
|
|
|
223
287
|
memgit setup windsurf
|
|
224
288
|
memgit setup cline
|
|
225
289
|
memgit setup continue
|
|
290
|
+
memgit setup gemini-cli
|
|
291
|
+
memgit setup hooks # Claude Code SessionStart hook → auto-inject resume digest
|
|
226
292
|
|
|
227
293
|
# Server
|
|
228
294
|
memgit serve # MCP stdio (Claude Code, Cursor, Windsurf, Cline)
|
|
@@ -267,9 +333,11 @@ The same memory in TOON:
|
|
|
267
333
|
```
|
|
268
334
|
TOON1|fb|no-db-mock|2026-07-01T10:00Z
|
|
269
335
|
#testing #database
|
|
336
|
+
PROJ:my-app
|
|
270
337
|
RULE:Never mock the database in tests
|
|
271
338
|
WHY:Mocked tests passed but prod migration failed last quarter
|
|
272
339
|
WHEN:Any persistence test
|
|
340
|
+
BODY:Full long-form detail lives here, losslessly (newlines escaped).\nSearch returns the compact RULE; get_memory returns everything.
|
|
273
341
|
```
|
|
274
342
|
|
|
275
343
|
Measured with a real tokenizer, TOON is ~5–10% leaner than equivalent markdown — a nice bonus, not the headline. **The headline saving is retrieval**: memgit loads the top-8 relevant memories per query instead of everything.
|
|
@@ -322,10 +390,15 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
|
322
390
|
- [x] `memgit git push/pull` — team sync via standard git
|
|
323
391
|
- [x] Flat `memories/` directory — grep/diff/blame your memories
|
|
324
392
|
- [x] D3.js graph visualization of memory relationships
|
|
393
|
+
- [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
|
|
394
|
+
- [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
|
|
395
|
+
- [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
|
|
325
396
|
- [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
|
|
326
397
|
- [ ] Chocolatey (not yet live on community.chocolatey.org)
|
|
327
398
|
- [x] Interactive setup wizard (`memgit setup`)
|
|
328
399
|
- [x] Smart `memgit init` (auto-detects tool, no path needed)
|
|
400
|
+
- [x] Lossless memories — full `body` alongside the compact rule (v0.3.0)
|
|
401
|
+
- [x] Project-scoped memories + `memgit onboard` mid-project bootstrap (v0.3.0)
|
|
329
402
|
- [x] VS Code extension (v0.1.5, Marketplace: code416-memgit.memgit)
|
|
330
403
|
- [ ] JetBrains plugin (Phase 3)
|
|
331
404
|
- [ ] Semantic search via embeddings (Phase 4)
|