@jcyamacho/agent-memory 0.0.12 → 0.0.15

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 (3) hide show
  1. package/README.md +58 -67
  2. package/dist/index.js +825 -510
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -62,16 +62,34 @@ With a custom database path:
62
62
  }
63
63
  ```
64
64
 
65
+ With a custom model cache path:
66
+
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "memory": {
71
+ "command": "npx",
72
+ "args": [
73
+ "-y",
74
+ "@jcyamacho/agent-memory"
75
+ ],
76
+ "env": {
77
+ "AGENT_MEMORY_MODELS_CACHE_PATH": "/absolute/path/to/models"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ ```
83
+
65
84
  Optional LLM instructions to reinforce the MCP's built-in guidance:
66
85
 
67
86
  ```text
68
- Use `recall` at the start of every conversation and again mid-task before
69
- making design choices or picking conventions. Use `remember` when the user
70
- corrects your approach, a key decision is established, or you learn project
71
- context not obvious from the code. Before saving, recall to check whether a
72
- memory about the same fact already exists -- if so, use `revise` to update
73
- it instead of creating a duplicate. Use `forget` to remove memories that
74
- are wrong or no longer relevant. Always pass workspace.
87
+ Use `recall` at conversation start and before design choices, conventions, or
88
+ edge cases. Query with 2-5 short anchor-heavy terms or exact phrases, not
89
+ questions or sentences. `recall` is lexical-first; if it misses, retry once
90
+ with overlapping alternate terms. Use `remember` for one durable fact, then
91
+ use `revise` instead of duplicates and `forget` for wrong or obsolete
92
+ memories. Always pass workspace unless the memory is truly global.
75
93
  ```
76
94
 
77
95
  ## What It Stores
@@ -101,60 +119,10 @@ The web UI uses the same database as the MCP server.
101
119
 
102
120
  ## Tools
103
121
 
104
- ### `remember`
105
-
106
- Save durable context for later recall.
107
-
108
- Inputs:
109
-
110
- - `content` -> fact, preference, decision, or context to store
111
- - `workspace` -> repository or workspace path
112
-
113
- Output:
114
-
115
- - `id`
116
-
117
- ### `recall`
118
-
119
- Retrieve relevant memories for the current task.
120
-
121
- Inputs:
122
-
123
- - `terms` -> 2-5 distinctive terms or short phrases that should appear in the
124
- memory content; avoid full natural-language questions
125
- - `limit` -> maximum results to return
126
- - `workspace` -> workspace or repo path; biases ranking toward this workspace
127
- - `updated_after` -> ISO 8601 lower bound
128
- - `updated_before` -> ISO 8601 upper bound
129
-
130
- Output:
131
-
132
- - `results[]` with `id`, `content`, `score`, `workspace`, and `updated_at`
133
-
134
- ### `revise`
135
-
136
- Update the content of an existing memory.
137
-
138
- Inputs:
139
-
140
- - `id` -> the memory id from a previous recall result
141
- - `content` -> replacement content for the memory
142
-
143
- Output:
144
-
145
- - `id`, `updated_at`
146
-
147
- ### `forget`
148
-
149
- Permanently delete a memory.
150
-
151
- Inputs:
152
-
153
- - `id` -> the memory id from a previous recall result
154
-
155
- Output:
156
-
157
- - `id`, `deleted`
122
+ - `remember` saves durable facts, preferences, decisions, and project context.
123
+ - `recall` retrieves the most relevant saved memories.
124
+ - `revise` updates an existing memory when it becomes outdated.
125
+ - `forget` deletes a memory that is no longer relevant.
158
126
 
159
127
  ## How Ranking Works
160
128
 
@@ -163,18 +131,21 @@ memories:
163
131
 
164
132
  1. **Text relevance** is the primary signal -- memories whose content best
165
133
  matches your search terms rank highest.
166
- 2. **Workspace match** is a strong secondary signal. When you pass
134
+ 2. **Embedding similarity** is the next strongest signal. Recall builds an
135
+ embedding from your normalized search terms and boosts memories whose stored
136
+ embeddings are most semantically similar.
137
+ 3. **Workspace match** is a strong secondary signal. When you pass
167
138
  `workspace`, exact matches rank highest, sibling repositories get a small
168
139
  boost, and unrelated workspaces rank lowest.
169
- 3. **Global memories** (saved without a workspace) are treated as relevant
140
+ 4. **Global memories** (saved without a workspace) are treated as relevant
170
141
  everywhere. When you pass `workspace`, they rank below exact workspace
171
142
  matches and above sibling or unrelated repositories.
172
- 4. **Recency** is a minor tiebreaker -- newer memories rank slightly above older
143
+ 5. **Recency** is a minor tiebreaker -- newer memories rank slightly above older
173
144
  ones when other signals are equal.
174
145
 
175
- If you omit `workspace`, recall falls back to text relevance and recency only.
176
- For best results, pass `workspace` whenever you have one. Save memories without
177
- a workspace only when they apply across all projects.
146
+ If you omit `workspace`, recall still uses text relevance, embedding similarity,
147
+ and recency. For best results, pass `workspace` whenever you have one. Save
148
+ memories without a workspace only when they apply across all projects.
178
149
 
179
150
  ## Database location
180
151
 
@@ -196,6 +167,26 @@ Set `AGENT_MEMORY_DB_PATH` when you want to:
196
167
  - share a memory DB across multiple clients
197
168
  - store the DB somewhere easier to back up or inspect
198
169
 
170
+ ## Model cache location
171
+
172
+ By default, downloaded embedding model files are cached at:
173
+
174
+ ```text
175
+ ~/.config/agent-memory/models
176
+ ```
177
+
178
+ Override it with:
179
+
180
+ ```bash
181
+ AGENT_MEMORY_MODELS_CACHE_PATH=/absolute/path/to/models
182
+ ```
183
+
184
+ Set `AGENT_MEMORY_MODELS_CACHE_PATH` when you want to:
185
+
186
+ - keep model artifacts out of `node_modules`
187
+ - share the model cache across reinstalls or multiple clients
188
+ - store model downloads somewhere easier to inspect or manage
189
+
199
190
  Beta note: schema changes are not migrated. If you are upgrading from an older
200
191
  beta, delete the existing memory DB and let the server create a new one.
201
192