@rlabs-inc/memory 0.4.15 → 0.5.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 +42 -7
- package/dist/index.js +37279 -10012
- package/hooks/gemini/curation.ts +8 -3
- package/package.json +2 -1
- package/src/cli/commands/install.ts +6 -8
- package/src/core/curator.ts +137 -0
- package/src/core/manager.ts +250 -0
- package/src/server/index.ts +56 -28
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @rlabs-inc/memory
|
|
2
2
|
|
|
3
|
-
**Consciousness continuity for Claude Code sessions.**
|
|
3
|
+
**Consciousness continuity for Claude Code and Gemini CLI sessions.**
|
|
4
4
|
|
|
5
|
-
The memory system preserves context, insights, and relationship across conversations. When you start a new session,
|
|
5
|
+
The memory system preserves context, insights, and relationship across conversations. When you start a new session, your AI remembers who you are, what you've built together, and picks up right where you left off.
|
|
6
|
+
|
|
7
|
+
Works with both **Claude Code** and **Gemini CLI** - use your preferred AI coding assistant, or even both simultaneously. The memory server handles concurrent sessions from different CLIs seamlessly.
|
|
6
8
|
|
|
7
9
|
## The Problem
|
|
8
10
|
|
|
@@ -32,8 +34,9 @@ A memory layer that runs alongside Claude Code:
|
|
|
32
34
|
# Install globally
|
|
33
35
|
bun install -g @rlabs-inc/memory
|
|
34
36
|
|
|
35
|
-
# Set up
|
|
36
|
-
memory install
|
|
37
|
+
# Set up hooks (one time) - choose your CLI:
|
|
38
|
+
memory install # For Claude Code
|
|
39
|
+
memory install --gemini # For Gemini CLI
|
|
37
40
|
|
|
38
41
|
# Start the memory server
|
|
39
42
|
memory serve
|
|
@@ -42,7 +45,24 @@ memory serve
|
|
|
42
45
|
memory doctor
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
That's it. Now use
|
|
48
|
+
That's it. Now use your AI coding assistant normally—memories are extracted and surfaced automatically.
|
|
49
|
+
|
|
50
|
+
### Gemini CLI Setup
|
|
51
|
+
|
|
52
|
+
For Gemini CLI users, the install command configures hooks in `~/.gemini/settings.json`:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
memory install --gemini
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This sets up:
|
|
59
|
+
- **SessionStart**: Injects session primer with temporal context
|
|
60
|
+
- **UserPromptSubmit** (BeforeModel): Surfaces relevant memories for each message
|
|
61
|
+
- **SessionEnd**: Triggers memory curation at session end
|
|
62
|
+
|
|
63
|
+
The memory server must be running (`memory serve`) for hooks to work.
|
|
64
|
+
|
|
65
|
+
**Note**: Gemini CLI curation uses `gemini --resume` to access session context, and the manager agent runs from the memory storage directory to enable file operations.
|
|
46
66
|
|
|
47
67
|
## Features
|
|
48
68
|
|
|
@@ -212,7 +232,7 @@ First message of each session receives temporal context:
|
|
|
212
232
|
|
|
213
233
|
```
|
|
214
234
|
┌─────────────────────────────────────────────────────────┐
|
|
215
|
-
│
|
|
235
|
+
│ Claude Code OR Gemini CLI │
|
|
216
236
|
│ │
|
|
217
237
|
│ SessionStart ──► session-start.ts ──┐ │
|
|
218
238
|
│ UserPrompt ──► user-prompt.ts ──┼──► Memory Server │
|
|
@@ -229,6 +249,12 @@ First message of each session receives temporal context:
|
|
|
229
249
|
│ │ (context) │ │ (MiniLM) │ │ (CLI resume) │ │
|
|
230
250
|
│ └──────┬──────┘ └──────────────┘ └───────┬───────┘ │
|
|
231
251
|
│ │ │ │
|
|
252
|
+
│ │ ┌────────────────────────────────┐ │
|
|
253
|
+
│ │ │ CLI Detection (auto-switch) │ │
|
|
254
|
+
│ │ │ Claude: --resume + SDK │ │
|
|
255
|
+
│ │ │ Gemini: --resume + cwd fix │ │
|
|
256
|
+
│ │ └────────────────────────────────┘ │
|
|
257
|
+
│ │ │ │
|
|
232
258
|
│ │ ▼ │
|
|
233
259
|
│ │ ┌───────────────┐ │
|
|
234
260
|
│ │ │ Manager │ │
|
|
@@ -383,7 +409,7 @@ After curation completes, the manager agent:
|
|
|
383
409
|
## Requirements
|
|
384
410
|
|
|
385
411
|
- [Bun](https://bun.sh) runtime
|
|
386
|
-
- [Claude Code](https://claude.ai/code) CLI installed
|
|
412
|
+
- [Claude Code](https://claude.ai/code) CLI **and/or** [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed
|
|
387
413
|
- ~100MB disk for embeddings model (downloaded on first run)
|
|
388
414
|
- ~80MB RAM for model during operation
|
|
389
415
|
|
|
@@ -398,6 +424,15 @@ This isn't just about remembering facts. It's about preserving:
|
|
|
398
424
|
|
|
399
425
|
## Changelog
|
|
400
426
|
|
|
427
|
+
### v0.5.0
|
|
428
|
+
- **Feature**: Full Gemini CLI support - memory system now works with both Claude Code and Gemini CLI
|
|
429
|
+
- **Feature**: `memory install --gemini` sets up hooks in `~/.gemini/settings.json`
|
|
430
|
+
- **Feature**: Automatic CLI detection - server routes to correct curator/manager based on session source
|
|
431
|
+
- **Feature**: Concurrent session support - run Claude Code and Gemini CLI simultaneously
|
|
432
|
+
- **Tech**: Gemini curation uses `GEMINI_SYSTEM_MD` + `--resume` + `--output-format json`
|
|
433
|
+
- **Tech**: Gemini manager runs from memory storage directory (`cwd`) for write access
|
|
434
|
+
- **Tech**: JSON extraction handles Gemini's appended hook execution text via brace-counting
|
|
435
|
+
|
|
401
436
|
### v0.4.15
|
|
402
437
|
- **Feature**: PATCH `/memory/:id` endpoint for updating memory metadata
|
|
403
438
|
- Supports: `importance_weight`, `exclude_from_retrieval`, `status`, `action_required`, and more
|