@pi-unipi/memory 0.1.13 → 0.1.14
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 +39 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,8 @@
|
|
|
1
1
|
# @pi-unipi/memory
|
|
2
2
|
|
|
3
|
-
Persistent
|
|
3
|
+
Persistent memory that survives across sessions. Stores facts, preferences, and decisions in SQLite with vector search, so the agent remembers what you told it last week.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **Two-tier storage:** SQLite + sqlite-vec for vector search, markdown files for human-readable memory
|
|
8
|
-
- **Project-scoped + global memory:** Each project gets its own DB, global memories accessible cross-project
|
|
9
|
-
- **Hybrid search:** Vector similarity + fuzzy text matching for best recall
|
|
10
|
-
- **Session injection:** Agent sees memory titles at session start
|
|
11
|
-
- **Auto-consolidation:** Memories extracted during compaction
|
|
12
|
-
- **Update-first:** Prevents memory duplication
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# All-in-one (includes memory)
|
|
18
|
-
pi install npm:unipi
|
|
19
|
-
|
|
20
|
-
# Standalone
|
|
21
|
-
pi install npm:@pi-unipi/memory
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Tools
|
|
25
|
-
|
|
26
|
-
| Tool | Description |
|
|
27
|
-
|------|-------------|
|
|
28
|
-
| `memory_store` | Store/update memory (project scope) |
|
|
29
|
-
| `memory_search` | Search memories (project scope) |
|
|
30
|
-
| `memory_delete` | Delete memory by ID or title |
|
|
31
|
-
| `memory_list` | List all project memories |
|
|
32
|
-
| `global_memory_store` | Store/update memory (global scope) |
|
|
33
|
-
| `global_memory_search` | Search global memories |
|
|
34
|
-
| `global_memory_list` | List all global memories |
|
|
5
|
+
Two storage tiers: SQLite + sqlite-vec for vector similarity search, markdown files for human-readable memories you can edit by hand. Project-scoped memories stay separate per codebase, global memories are accessible everywhere.
|
|
35
6
|
|
|
36
7
|
## Commands
|
|
37
8
|
|
|
@@ -45,9 +16,31 @@ pi install npm:@pi-unipi/memory
|
|
|
45
16
|
| `/unipi:global-memory-search <term>` | Search global memories |
|
|
46
17
|
| `/unipi:global-memory-list` | List all global memories |
|
|
47
18
|
|
|
48
|
-
##
|
|
19
|
+
## Special Triggers
|
|
20
|
+
|
|
21
|
+
At session start, the agent sees memory titles injected into context. This gives it a summary of what it should remember without loading full memory content.
|
|
22
|
+
|
|
23
|
+
During compaction (if `@pi-unipi/compactor` is installed), memories are auto-extracted from the conversation. The `memory-consolidate` command also triggers this manually.
|
|
49
24
|
|
|
50
|
-
|
|
25
|
+
Memory registers with the info-screen dashboard, showing project memory count, total count, and consolidation count. The footer subscribes to `MEMORY_STORED`, `MEMORY_DELETED`, and `MEMORYCONSOLIDATED` events to display memory stats.
|
|
26
|
+
|
|
27
|
+
## Agent Tools
|
|
28
|
+
|
|
29
|
+
| Tool | Scope | Description |
|
|
30
|
+
|------|-------|-------------|
|
|
31
|
+
| `memory_store` | Project | Store or update a memory |
|
|
32
|
+
| `memory_search` | Project | Search memories by query |
|
|
33
|
+
| `memory_delete` | Project | Delete memory by ID or title |
|
|
34
|
+
| `memory_list` | Project | List all project memories |
|
|
35
|
+
| `global_memory_store` | Global | Store or update global memory |
|
|
36
|
+
| `global_memory_search` | Global | Search global memories |
|
|
37
|
+
| `global_memory_list` | Global | List all global memories |
|
|
38
|
+
|
|
39
|
+
The agent uses `memory_store` when it learns something worth remembering — a user preference, a technical decision, a code pattern. `memory_search` is used to recall relevant context before answering questions.
|
|
40
|
+
|
|
41
|
+
## Memory Format
|
|
42
|
+
|
|
43
|
+
Memories are markdown files with YAML frontmatter:
|
|
51
44
|
|
|
52
45
|
```markdown
|
|
53
46
|
---
|
|
@@ -65,16 +58,18 @@ User prefers short-lived access tokens (15min) with long-lived refresh tokens (3
|
|
|
65
58
|
Always implement token rotation on refresh.
|
|
66
59
|
```
|
|
67
60
|
|
|
68
|
-
|
|
61
|
+
### Naming Convention
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
Format: `<most_important>_<less_important>_<lesser>`
|
|
71
64
|
|
|
72
65
|
Examples:
|
|
73
66
|
- `auth_jwt_prefer_refresh_tokens`
|
|
74
67
|
- `db_postgres_use_connection_pooling`
|
|
75
68
|
- `style_typescript_strict_mode_always`
|
|
76
69
|
|
|
77
|
-
##
|
|
70
|
+
## Configurables
|
|
71
|
+
|
|
72
|
+
Memory has no configuration file. Storage paths are fixed:
|
|
78
73
|
|
|
79
74
|
```
|
|
80
75
|
~/.unipi/memory/
|
|
@@ -88,7 +83,11 @@ Examples:
|
|
|
88
83
|
|
|
89
84
|
## Dependencies
|
|
90
85
|
|
|
91
|
-
- `better-sqlite3`
|
|
92
|
-
- `sqlite-vec`
|
|
93
|
-
- `js-yaml`
|
|
94
|
-
- `@pi-unipi/core`
|
|
86
|
+
- `better-sqlite3` — SQLite database
|
|
87
|
+
- `sqlite-vec` — Vector search extension
|
|
88
|
+
- `js-yaml` — YAML frontmatter parsing
|
|
89
|
+
- `@pi-unipi/core` — Shared utilities
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|