hippo-memory 0.8.1 → 0.10.0
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.
- package/README.md +135 -7
- package/dist/cli.d.ts +6 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +853 -213
- package/dist/cli.js.map +1 -1
- package/dist/consolidate.d.ts.map +1 -1
- package/dist/consolidate.js +12 -5
- package/dist/consolidate.js.map +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +149 -100
- package/dist/db.js.map +1 -1
- package/dist/handoff.d.ts +29 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +30 -0
- package/dist/handoff.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/invalidation.d.ts +23 -0
- package/dist/invalidation.d.ts.map +1 -0
- package/dist/invalidation.js +94 -0
- package/dist/invalidation.js.map +1 -0
- package/dist/memory.d.ts +1 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +1 -0
- package/dist/memory.js.map +1 -1
- package/dist/path-context.d.ts +12 -0
- package/dist/path-context.d.ts.map +1 -0
- package/dist/path-context.js +32 -0
- package/dist/path-context.js.map +1 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +55 -2
- package/dist/search.js.map +1 -1
- package/dist/store.d.ts +18 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +209 -99
- package/dist/store.js.map +1 -1
- package/dist/working-memory.d.ts +59 -0
- package/dist/working-memory.d.ts.map +1 -0
- package/dist/working-memory.js +149 -0
- package/dist/working-memory.js.map +1 -0
- package/extensions/openclaw-plugin/index.ts +569 -495
- package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
- package/extensions/openclaw-plugin/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
8
8
|
```
|
|
9
|
-
Works with: Claude Code, Codex, Cursor, OpenClaw, any CLI agent
|
|
9
|
+
Works with: Claude Code, Codex, Cursor, OpenClaw, OpenCode, any CLI agent
|
|
10
10
|
Imports from: ChatGPT, Claude (CLAUDE.md), Cursor (.cursorrules), any markdown
|
|
11
11
|
Storage: SQLite backbone + markdown/YAML mirrors. Git-trackable and human-readable.
|
|
12
12
|
Dependencies: Zero runtime deps. Requires Node.js 22.5+. Optional embeddings via @xenova/transformers.
|
|
@@ -43,6 +43,28 @@ hippo recall "data pipeline issues" --budget 2000
|
|
|
43
43
|
|
|
44
44
|
That's it. You have a memory system.
|
|
45
45
|
|
|
46
|
+
### What's new in v0.10.0
|
|
47
|
+
|
|
48
|
+
- **Active invalidation.** `hippo learn --git` detects migration and breaking-change commits and actively weakens memories referencing the old pattern. Manual invalidation via `hippo invalidate "REST API" --reason "migrated to GraphQL"`.
|
|
49
|
+
- **Architectural decisions.** `hippo decide` stores one-off decisions with 90-day half-life and verified confidence. Supports `--context` for reasoning and `--supersedes` to chain decisions when the architecture evolves.
|
|
50
|
+
- **Decision recall boost.** 1.2x scoring multiplier for decision-tagged memories so they surface despite low retrieval frequency.
|
|
51
|
+
|
|
52
|
+
### What's new in v0.9.1
|
|
53
|
+
|
|
54
|
+
- **Auto-sleep on session exit.** `hippo hook install claude-code` now installs a Stop hook in `~/.claude/settings.json` so `hippo sleep` runs automatically when Claude Code exits. `hippo init` does this too when Claude Code is detected. No cron needed, no manual sleep.
|
|
55
|
+
|
|
56
|
+
### What's new in v0.9.0
|
|
57
|
+
|
|
58
|
+
- **Working memory layer** (`hippo wm push/read/clear/flush`). Bounded buffer (max 20 per scope) with importance-based eviction. Current-state notes live separately from long-term memory.
|
|
59
|
+
- **Session handoffs** (`hippo handoff create/latest/show`). Persist session summaries, next actions, and artifacts so successor sessions can resume without transcript archaeology.
|
|
60
|
+
- **Session lifecycle** with explicit start/end events, fallback session IDs, and `hippo session resume` for continuity.
|
|
61
|
+
- **Explainable recall** (`hippo recall --why`). See which terms matched, whether BM25 or embedding contributed, and the source bucket (layer, confidence, local/global).
|
|
62
|
+
- **`hippo current show`** for compact current-state display (active task + recent session events), ready for agent injection.
|
|
63
|
+
- **SQLite lock hardening**: `busy_timeout=5000`, `synchronous=NORMAL`, `wal_autocheckpoint=100`. Concurrent plugin calls no longer hit `SQLITE_BUSY`.
|
|
64
|
+
- **Consolidation batching**: all writes/deletes happen in a single transaction instead of N open/close cycles.
|
|
65
|
+
- **`--limit` flag** on `hippo recall` and `hippo context` to cap result count independently of token budget.
|
|
66
|
+
- **Plugin injection dedup guard** prevents double context injection on reconnect.
|
|
67
|
+
|
|
46
68
|
### What's new in v0.8.0
|
|
47
69
|
|
|
48
70
|
- **Hybrid search** blends BM25 keywords with cosine embedding similarity. Install `@xenova/transformers`, run `hippo embed`, recall quality jumps. Falls back to BM25 otherwise.
|
|
@@ -64,7 +86,7 @@ hippo init
|
|
|
64
86
|
# Auto-installed claude-code hook in CLAUDE.md
|
|
65
87
|
```
|
|
66
88
|
|
|
67
|
-
If you have a `CLAUDE.md`, it patches it. `AGENTS.md` for Codex/OpenClaw. `.cursorrules` for Cursor. No manual `hook install` needed. Your agent starts using Hippo on its next session.
|
|
89
|
+
If you have a `CLAUDE.md`, it patches it. `AGENTS.md` for Codex/OpenClaw/OpenCode. `.cursorrules` for Cursor. No manual `hook install` needed. Your agent starts using Hippo on its next session.
|
|
68
90
|
|
|
69
91
|
It also sets up a daily cron job (6:15am) that runs `hippo learn --git` and `hippo sleep` automatically. Memories get captured from your commits and consolidated every day without you thinking about it.
|
|
70
92
|
|
|
@@ -150,6 +172,50 @@ hippo context --auto --budget 1500
|
|
|
150
172
|
|
|
151
173
|
Hippo mirrors the latest trail to `.hippo/buffer/recent-session.md` so you can inspect the short-term thread without opening SQLite.
|
|
152
174
|
|
|
175
|
+
### Session handoffs
|
|
176
|
+
|
|
177
|
+
When you're done for the day (or switching to another agent), create a handoff so the next session knows exactly where to pick up:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
hippo handoff create \
|
|
181
|
+
--summary "Finished schema migration, tests green" \
|
|
182
|
+
--next "Wire handoff injection into context output" \
|
|
183
|
+
--session sess_20260403 \
|
|
184
|
+
--artifact src/db.ts
|
|
185
|
+
|
|
186
|
+
hippo handoff latest # show the most recent handoff
|
|
187
|
+
hippo handoff show 3 # show a specific handoff by ID
|
|
188
|
+
hippo session resume # re-inject latest handoff as context
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Working memory
|
|
192
|
+
|
|
193
|
+
Working memory is a bounded scratchpad for current-state notes. It's separate from long-term memory and gets cleared between sessions.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
hippo wm push --scope repo \
|
|
197
|
+
--content "Investigating flaky test in store.test.ts, line 42" \
|
|
198
|
+
--importance 0.9
|
|
199
|
+
|
|
200
|
+
hippo wm read --scope repo # show current working notes
|
|
201
|
+
hippo wm clear --scope repo # wipe the scratchpad
|
|
202
|
+
hippo wm flush --scope repo # flush on session end
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The buffer holds a maximum of 20 entries per scope. When full, the lowest-importance entry is evicted.
|
|
206
|
+
|
|
207
|
+
### Explainable recall
|
|
208
|
+
|
|
209
|
+
See why a memory was returned:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
hippo recall "data pipeline" --why --limit 5
|
|
213
|
+
|
|
214
|
+
# --- mem_a1b2c3 [episodic] [observed] [local] score=0.847
|
|
215
|
+
# BM25: matched [data, pipeline]; cosine: 0.82
|
|
216
|
+
# ...memory content...
|
|
217
|
+
```
|
|
218
|
+
|
|
153
219
|
---
|
|
154
220
|
|
|
155
221
|
## How It Works
|
|
@@ -218,6 +284,44 @@ hippo recall "cache issues" # again next week
|
|
|
218
284
|
|
|
219
285
|
---
|
|
220
286
|
|
|
287
|
+
### Active invalidation
|
|
288
|
+
|
|
289
|
+
When you migrate from one tool to another, old memories about the replaced tool should die immediately. Hippo detects migration and breaking-change commits during `hippo learn --git` and actively weakens matching memories.
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
hippo learn --git
|
|
293
|
+
# feat: migrate from webpack to vite
|
|
294
|
+
# Invalidated 3 memories referencing "webpack"
|
|
295
|
+
# Learned: migrate from webpack to vite
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
You can also invalidate manually:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
hippo invalidate "REST API" --reason "migrated to GraphQL"
|
|
302
|
+
# Invalidated 5 memories referencing "REST API".
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### Architectural decisions
|
|
308
|
+
|
|
309
|
+
One-off decisions don't repeat, so they can't earn their keep through retrieval alone. `hippo decide` stores them with a 90-day half-life and verified confidence so they survive long enough to matter.
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
hippo decide "Use PostgreSQL for all new services" --context "JSONB support"
|
|
313
|
+
# Decision recorded: mem_a1b2c3
|
|
314
|
+
|
|
315
|
+
# Later, when the decision changes:
|
|
316
|
+
hippo decide "Use CockroachDB for global services" \
|
|
317
|
+
--context "Need multi-region" \
|
|
318
|
+
--supersedes mem_a1b2c3
|
|
319
|
+
# Superseded mem_a1b2c3 (half-life halved, marked stale)
|
|
320
|
+
# Decision recorded: mem_d4e5f6
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
221
325
|
### Error memories stick
|
|
222
326
|
|
|
223
327
|
Tag a memory as an error and it gets 2x the half-life automatically.
|
|
@@ -401,9 +505,12 @@ hippo watch "npm run build"
|
|
|
401
505
|
| `hippo remember "<text>" --global` | Store in global `~/.hippo/` store |
|
|
402
506
|
| `hippo recall "<query>"` | Retrieve relevant memories (local + global) |
|
|
403
507
|
| `hippo recall "<query>" --budget <n>` | Recall within token limit (default: 4000) |
|
|
508
|
+
| `hippo recall "<query>" --limit <n>` | Cap result count |
|
|
509
|
+
| `hippo recall "<query>" --why` | Show match reasons and source buckets |
|
|
404
510
|
| `hippo recall "<query>" --json` | Output as JSON |
|
|
405
511
|
| `hippo context --auto` | Smart context injection (auto-detects task from git) |
|
|
406
512
|
| `hippo context "<query>" --budget <n>` | Context injection with explicit query (default: 1500) |
|
|
513
|
+
| `hippo context --limit <n>` | Cap memory count in context |
|
|
407
514
|
| `hippo context --budget 0` | Skip entirely (zero token cost) |
|
|
408
515
|
| `hippo context --framing <mode>` | Framing: observe (default), suggest, assert |
|
|
409
516
|
| `hippo context --format <fmt>` | Output format: markdown (default) or json |
|
|
@@ -443,9 +550,24 @@ hippo watch "npm run build"
|
|
|
443
550
|
| `hippo share --auto --dry-run` | Preview what would be shared |
|
|
444
551
|
| `hippo peers` | List projects contributing to global store |
|
|
445
552
|
| `hippo sync` | Pull global memories into local project |
|
|
553
|
+
| `hippo invalidate "<pattern>"` | Actively weaken memories matching an old pattern |
|
|
554
|
+
| `hippo invalidate "<pattern>" --reason "<why>"` | Include what replaced it |
|
|
555
|
+
| `hippo decide "<decision>"` | Record architectural decision (90-day half-life) |
|
|
556
|
+
| `hippo decide "<decision>" --context "<why>"` | Include reasoning |
|
|
557
|
+
| `hippo decide "<decision>" --supersedes <id>` | Supersede a previous decision |
|
|
446
558
|
| `hippo hook list` | Show available framework hooks |
|
|
447
|
-
| `hippo hook install <target>` | Install hook (claude-code
|
|
559
|
+
| `hippo hook install <target>` | Install hook (claude-code also adds Stop hook for auto-sleep) |
|
|
448
560
|
| `hippo hook uninstall <target>` | Remove hook |
|
|
561
|
+
| `hippo handoff create --summary "..."` | Create a session handoff |
|
|
562
|
+
| `hippo handoff latest` | Show the most recent handoff |
|
|
563
|
+
| `hippo handoff show <id>` | Show a specific handoff by ID |
|
|
564
|
+
| `hippo session latest` | Show latest task snapshot + events |
|
|
565
|
+
| `hippo session resume` | Re-inject latest handoff as context |
|
|
566
|
+
| `hippo current show` | Compact current state (task + session events) |
|
|
567
|
+
| `hippo wm push --scope <s> --content "..."` | Push to working memory |
|
|
568
|
+
| `hippo wm read --scope <s>` | Read working memory entries |
|
|
569
|
+
| `hippo wm clear --scope <s>` | Clear working memory |
|
|
570
|
+
| `hippo wm flush --scope <s>` | Flush working memory (session end) |
|
|
449
571
|
| `hippo dashboard` | Open web dashboard at localhost:3333 |
|
|
450
572
|
| `hippo dashboard --port <n>` | Use custom port |
|
|
451
573
|
| `hippo mcp` | Start MCP server (stdio transport) |
|
|
@@ -460,10 +582,11 @@ hippo watch "npm run build"
|
|
|
460
582
|
|
|
461
583
|
| Framework | Detected by | Patches |
|
|
462
584
|
|-----------|------------|---------|
|
|
463
|
-
| Claude Code | `CLAUDE.md` or `.claude/settings.json` | `CLAUDE.md` |
|
|
585
|
+
| Claude Code | `CLAUDE.md` or `.claude/settings.json` | `CLAUDE.md` + Stop hook in `settings.json` |
|
|
464
586
|
| Codex | `AGENTS.md` or `.codex` | `AGENTS.md` |
|
|
465
587
|
| Cursor | `.cursorrules` or `.cursor/rules` | `.cursorrules` |
|
|
466
588
|
| OpenClaw | `.openclaw` or `AGENTS.md` | `AGENTS.md` |
|
|
589
|
+
| OpenCode | `.opencode/` or `opencode.json` | `AGENTS.md` |
|
|
467
590
|
|
|
468
591
|
No extra commands needed. Just `hippo init` and your agent knows about Hippo.
|
|
469
592
|
|
|
@@ -472,10 +595,11 @@ No extra commands needed. Just `hippo init` and your agent knows about Hippo.
|
|
|
472
595
|
If you prefer explicit control:
|
|
473
596
|
|
|
474
597
|
```bash
|
|
475
|
-
hippo hook install claude-code # patches CLAUDE.md
|
|
598
|
+
hippo hook install claude-code # patches CLAUDE.md + adds Stop hook to settings.json
|
|
476
599
|
hippo hook install codex # patches AGENTS.md
|
|
477
600
|
hippo hook install cursor # patches .cursorrules
|
|
478
601
|
hippo hook install openclaw # patches AGENTS.md
|
|
602
|
+
hippo hook install opencode # patches AGENTS.md
|
|
479
603
|
```
|
|
480
604
|
|
|
481
605
|
This adds a `<!-- hippo:start -->` ... `<!-- hippo:end -->` block that tells the agent to:
|
|
@@ -483,6 +607,8 @@ This adds a `<!-- hippo:start -->` ... `<!-- hippo:end -->` block that tells the
|
|
|
483
607
|
2. Run `hippo remember "<lesson>" --error` on errors
|
|
484
608
|
3. Run `hippo outcome --good` on completion
|
|
485
609
|
|
|
610
|
+
For Claude Code, it also adds a Stop hook to `~/.claude/settings.json` so `hippo sleep` runs automatically when the session exits.
|
|
611
|
+
|
|
486
612
|
To remove: `hippo hook uninstall claude-code`
|
|
487
613
|
|
|
488
614
|
### What the hook adds (Claude Code example)
|
|
@@ -521,7 +647,7 @@ Add to your MCP config (e.g. `.cursor/mcp.json` or `claude_desktop_config.json`)
|
|
|
521
647
|
}
|
|
522
648
|
```
|
|
523
649
|
|
|
524
|
-
Exposes
|
|
650
|
+
Exposes tools: `hippo_recall`, `hippo_remember`, `hippo_outcome`, `hippo_context`, `hippo_status`, `hippo_learn`, `hippo_wm_push`.
|
|
525
651
|
|
|
526
652
|
### OpenClaw Plugin
|
|
527
653
|
|
|
@@ -561,6 +687,8 @@ The 7 mechanisms in full: [PLAN.md#core-principles](PLAN.md#core-principles)
|
|
|
561
687
|
|
|
562
688
|
For how these mechanisms connect to LLM training, continual learning, and open research problems: **[RESEARCH.md](RESEARCH.md)**
|
|
563
689
|
|
|
690
|
+
**Related work:** [HippoRAG](https://arxiv.org/abs/2405.14831) (Gutierrez et al., 2024) applies hippocampal indexing to RAG via knowledge graphs. Complementary approach — HippoRAG optimizes retrieval quality, Hippo optimizes memory lifecycle. Same brain region, different mechanisms.
|
|
691
|
+
|
|
564
692
|
---
|
|
565
693
|
|
|
566
694
|
## Comparison
|
|
@@ -586,7 +714,7 @@ For how these mechanisms connect to LLM training, continual learning, and open r
|
|
|
586
714
|
| Git-friendly | Yes | No | Yes | No |
|
|
587
715
|
| Framework agnostic | Yes | Partial | Yes | No |
|
|
588
716
|
|
|
589
|
-
Mem0, Basic Memory, and Claude-Mem all implement "save everything, search later." Hippo implements
|
|
717
|
+
Mem0, Basic Memory, and Claude-Mem all implement "save everything, search later." Hippo implements all 7 hippocampal mechanisms: two-speed storage, decay, retrieval strengthening, schema acceleration, conflict detection, multi-agent transfer, and explicit working memory. It's the only tool that models what memories are worth keeping.
|
|
590
718
|
|
|
591
719
|
---
|
|
592
720
|
|
package/dist/cli.d.ts
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
* Commands:
|
|
6
6
|
* hippo init [--global]
|
|
7
7
|
* hippo remember <text> [--tag <t>] [--error] [--pin] [--global]
|
|
8
|
-
* hippo recall <query> [--budget <n>] [--json]
|
|
8
|
+
* hippo recall <query> [--budget <n>] [--json] [--why]
|
|
9
9
|
* hippo sleep [--dry-run]
|
|
10
10
|
* hippo status
|
|
11
11
|
* hippo outcome --good | --bad [--id <id>]
|
|
12
12
|
* hippo conflicts [--status <status>] [--json]
|
|
13
13
|
* hippo snapshot <save|show|clear>
|
|
14
|
-
* hippo session <log|show>
|
|
14
|
+
* hippo session <log|show|latest|resume>
|
|
15
|
+
* hippo handoff <create|latest|show>
|
|
16
|
+
* hippo current <show>
|
|
15
17
|
* hippo forget <id>
|
|
16
18
|
* hippo inspect <id>
|
|
17
19
|
* hippo embed [--status]
|
|
@@ -19,6 +21,8 @@
|
|
|
19
21
|
* hippo learn --git [--days <n>] [--repos <paths>]
|
|
20
22
|
* hippo promote <id>
|
|
21
23
|
* hippo sync
|
|
24
|
+
* hippo decide "<decision>" [--context "<why>"] [--supersedes <id>]
|
|
25
|
+
* hippo wm <push|read|clear|flush>
|
|
22
26
|
*/
|
|
23
27
|
export {};
|
|
24
28
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
|