memoryai-mcp 2.2.0 → 2.3.1

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 CHANGED
@@ -1,304 +1,362 @@
1
- # memoryai-mcp
2
-
3
- MCP server for [MemoryAI](https://memoryai.dev) — a living brain for your AI agent.
4
-
5
- Your AI agent gets persistent memory that works like a real brain:
6
- - Remembers what matters, forgets what doesn't
7
- - Strengthens memories you use often (Hebbian learning)
8
- - Consolidates knowledge while idle (Sleep cycles)
9
- - Protects core identity (DNA memories never fade)
10
- - Adapts to your emotional state
11
-
12
- **Install once. Everything auto from there.**
13
-
14
- ## Quick Start (2 minutes)
15
-
16
- ### 1. Get an API Key
17
-
18
- ```bash
19
- curl -X POST https://memoryai.dev/v1/admin/provision \
20
- -H "Content-Type: application/json" \
21
- -d '{"name": "my-agent", "tos_accepted": true}'
22
- ```
23
-
24
- Save the `api_key` from the response. You'll need it below.
25
-
26
- ### 2. Pick Your IDE/Tool
27
-
28
- Choose your platform below. Config once — memory works automatically forever.
29
-
30
- ---
31
-
32
- ## IDE Setup
33
-
34
- ### Claude Code (CLI) — `~/.claude/settings.json`
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "memoryai": {
40
- "command": "npx",
41
- "args": ["-y", "memoryai-mcp"],
42
- "env": {
43
- "HM_ENDPOINT": "https://memoryai.dev",
44
- "HM_API_KEY": "hm_sk_your_key_here"
45
- }
46
- }
47
- }
48
- }
49
- ```
50
-
51
- Then create `~/.claude/CLAUDE.md` for auto-bootstrap:
52
-
53
- ```markdown
54
- ## Memory Protocol
55
- At the start of every conversation, call `memory_bootstrap` to load context from MemoryAI.
56
- Before context gets large (>100K tokens), call `memory_compact` to save important context.
57
- Use `memory_store` to save important decisions, preferences, and facts.
58
- Use `memory_recall` to search past memories when relevant.
59
- ```
60
-
61
- ### Cursor — `~/.cursor/mcp.json`
62
-
63
- ```json
64
- {
65
- "mcpServers": {
66
- "memoryai": {
67
- "command": "npx",
68
- "args": ["-y", "memoryai-mcp"],
69
- "env": {
70
- "HM_ENDPOINT": "https://memoryai.dev",
71
- "HM_API_KEY": "hm_sk_your_key_here"
72
- }
73
- }
74
- }
75
- }
76
- ```
77
-
78
- Auto-bootstrap — create `.cursor/rules/memoryai.mdc`:
79
-
80
- ```
81
- At the start of every session, call memory_bootstrap to load context.
82
- After completing tasks, call memory_compact to save context.
83
- Store important decisions and preferences with memory_store.
84
- ```
85
-
86
- ### VS Code — `.vscode/mcp.json`
87
-
88
- ```json
89
- {
90
- "servers": {
91
- "memoryai": {
92
- "command": "npx",
93
- "args": ["-y", "memoryai-mcp"],
94
- "env": {
95
- "HM_ENDPOINT": "https://memoryai.dev",
96
- "HM_API_KEY": "hm_sk_your_key_here"
97
- }
98
- }
99
- }
100
- }
101
- ```
102
-
103
- ### Kiro — `.kiro/settings/mcp.json`
104
-
105
- ```json
106
- {
107
- "mcpServers": {
108
- "memoryai": {
109
- "command": "npx",
110
- "args": ["-y", "memoryai-mcp"],
111
- "env": {
112
- "HM_ENDPOINT": "https://memoryai.dev",
113
- "HM_API_KEY": "hm_sk_your_key_here"
114
- }
115
- }
116
- }
117
- }
118
- ```
119
-
120
- ### Windsurf — `~/.codeium/windsurf/mcp_config.json`
121
-
122
- ```json
123
- {
124
- "mcpServers": {
125
- "memoryai": {
126
- "command": "npx",
127
- "args": ["-y", "memoryai-mcp"],
128
- "env": {
129
- "HM_ENDPOINT": "https://memoryai.dev",
130
- "HM_API_KEY": "hm_sk_your_key_here"
131
- }
132
- }
133
- }
134
- }
135
- ```
136
-
137
- ### Claude Desktop — `claude_desktop_config.json`
138
-
139
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
140
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
141
-
142
- ```json
143
- {
144
- "mcpServers": {
145
- "memoryai": {
146
- "command": "npx",
147
- "args": ["-y", "memoryai-mcp"],
148
- "env": {
149
- "HM_ENDPOINT": "https://memoryai.dev",
150
- "HM_API_KEY": "hm_sk_your_key_here"
151
- }
152
- }
153
- }
154
- }
155
- ```
156
-
157
- ### Antigravity — `~/.antigravity/mcp.json`
158
-
159
- ```json
160
- {
161
- "mcpServers": {
162
- "memoryai": {
163
- "command": "npx",
164
- "args": ["-y", "memoryai-mcp"],
165
- "env": {
166
- "HM_ENDPOINT": "https://memoryai.dev",
167
- "HM_API_KEY": "hm_sk_your_key_here"
168
- }
169
- }
170
- }
171
- }
172
- ```
173
-
174
- ### Any MCP-compatible tool
175
-
176
- ```json
177
- {
178
- "mcpServers": {
179
- "memoryai": {
180
- "command": "npx",
181
- "args": ["-y", "memoryai-mcp"],
182
- "env": {
183
- "HM_ENDPOINT": "https://memoryai.dev",
184
- "HM_API_KEY": "hm_sk_your_key_here"
185
- }
186
- }
187
- }
188
- }
189
- ```
190
-
191
- ---
192
-
193
- ## Auto-Bootstrap (Make It Fully Automatic)
194
-
195
- After MCP config, add a system rule so your agent auto-loads memory every session:
196
-
197
- | Platform | Rule File | Content |
198
- |----------|-----------|---------|
199
- | Claude Code | `~/.claude/CLAUDE.md` | See above |
200
- | Cursor | `.cursor/rules/memoryai.mdc` | See above |
201
- | Kiro | `.kiro/rules/memoryai.md` | Same content |
202
- | Windsurf | `.windsurfrules` | Same content |
203
- | VS Code | `.github/copilot-instructions.md` | Same content |
204
-
205
- Rule content (copy-paste for any platform):
206
-
207
- ```
208
- ## Memory Protocol
209
- At the start of every conversation, call `memory_bootstrap` to load context from MemoryAI.
210
- Before context gets large, call `memory_compact` to save important context.
211
- Use `memory_store` to save important decisions, preferences, and facts.
212
- Use `memory_recall` to search past memories when relevant.
213
- ```
214
-
215
- ---
216
-
217
- ## How It Works
218
-
219
- ```
220
- Open IDE → MCP auto-connects → Agent reads rules → Calls bootstrap
221
- Loads your identity, preferences, recent work
222
- Works normally (auto-stores important stuff)
223
- Context getting full? Auto-compacts
224
- Close IDE → Sleep workers consolidate overnight
225
- Open IDE next day → Bootstrap loads everything back
226
- → Cycle repeats. Memory grows smarter over time.
227
- ```
228
-
229
- **You do nothing.** The agent handles everything automatically.
230
-
231
- ---
232
-
233
- ## Tools Available
234
-
235
- | Tool | What It Does |
236
- |------|-------------|
237
- | `memory_bootstrap` | Wake up with full context (identity + recent + preferences) |
238
- | `memory_store` | Save a memory (fact, decision, preference, identity) |
239
- | `memory_recall` | Search memories by meaning (semantic + graph + FTS) |
240
- | `memory_compact` | Save conversation context before it's lost |
241
- | `memory_recover` | Recover session after a break |
242
- | `memory_health` | Check context pressure (safe/warning/critical) |
243
- | `memory_explore` | Explore connections between memories |
244
- | `memory_clusters` | View topic clusters in your knowledge graph |
245
- | `learn` | Store action + result + lesson learned |
246
- | `entity_list` | List tracked entities (files, people, packages) |
247
- | `reasoning_store` | Deep reasoning memory (Pro+) |
248
- | `reasoning_recall` | Recall reasoned insights (Pro+) |
249
- | `snapshot_create` | Backup memory state |
250
- | `snapshot_restore` | Restore from backup |
251
-
252
- ---
253
-
254
- ## Context Guard (Built-in)
255
-
256
- Context Guard monitors your session and prevents context loss:
257
-
258
- | State | Meaning | Agent Action |
259
- |-------|---------|-------------|
260
- | SAFE | Context < 40% full | Continue normally |
261
- | COMPACT_SOON | Context 40-55% full | Prepare to compact |
262
- | COMPACT_NOW | Context > 55% full | Must compact immediately |
263
-
264
- The agent handles this automatically when rules are configured. No manual intervention needed.
265
-
266
- ---
267
-
268
- ## What Gets Remembered (DNA System)
269
-
270
- | Memory Type | Example | Persistence |
271
- |-------------|---------|-------------|
272
- | `preference` | "I prefer Python over Java" | **Forever** (DNA-protected) |
273
- | `decision` | "Chose PostgreSQL for this project" | **Forever** (DNA-protected) |
274
- | `identity` | "Senior backend engineer, 10 years" | **Forever** (DNA-protected) |
275
- | `fact` | "API endpoint is /v1/users" | Decays if unused |
276
- | `goal` | "Launch v2.0 by June" | Decays if unused |
277
-
278
- DNA memories (preference/decision/identity) **never decay, never get deleted, never get overwritten** by any background process. They define who you are.
279
-
280
- ---
281
-
282
- ## Pricing
283
-
284
- | Plan | Features | Price |
285
- |------|----------|-------|
286
- | Free | Basic store/recall, 100 memories | Free |
287
- | Pro | Full brain (reasoning, consolidation, personality) | Paid |
288
- | ProMax | Multi-agent mesh, advanced features | Paid |
289
- | God | Everything + deep graph traversal | Internal |
290
-
291
- Get started free: https://memoryai.dev
292
-
293
- ---
294
-
295
- ## Links
296
-
297
- - Website: https://memoryai.dev
298
- - Python SDK: `pip install hmc-memory`
299
- - npm MCP: `npx memoryai-mcp`
300
- - GitHub: https://github.com/memoryai-dev/memoryai
301
-
302
- ## License
303
-
304
- MIT
1
+ # memoryai-mcp
2
+
3
+ MCP server for [MemoryAI](https://memoryai.dev) — a living brain for your AI agent.
4
+
5
+ Your AI agent gets persistent memory that works like a real brain:
6
+ - Remembers what matters, forgets what doesn't
7
+ - Strengthens memories you use often (Hebbian learning)
8
+ - Consolidates knowledge while idle (Sleep cycles)
9
+ - Protects core identity (DNA memories never fade)
10
+ - Adapts to your emotional state
11
+
12
+ **Install once. Everything auto from there.**
13
+
14
+ Automation level by platform:
15
+ - **Mechanism-level (hands-off, guaranteed):** OpenAI Proxy, Kiro (Agent Hooks), Claude Code (HTTP hooks via `memoryai-claude-setup`).
16
+ - **Soft (rules-file, depends on the model following instructions):** Cursor, Windsurf, VS Code Copilot. MCP tools are available; add the rules file shown below.
17
+
18
+ ## Quick Start (2 minutes)
19
+
20
+ ### 1. Run setup — that's it
21
+
22
+ You don't need to provision a key first. The setup command auto-provisions a
23
+ free key for you if you don't pass one:
24
+
25
+ ```bash
26
+ # Claude Code
27
+ npx -y -p memoryai-mcp memoryai-claude-setup
28
+
29
+ # Kiro
30
+ npx -y -p memoryai-mcp memoryai-kiro-setup
31
+ ```
32
+
33
+ Already have a key? Pass it to skip provisioning: `HM_API_KEY=hm_sk_... npx -y -p memoryai-mcp memoryai-claude-setup`.
34
+
35
+ <details>
36
+ <summary>Manual key provisioning (optional)</summary>
37
+
38
+ ```bash
39
+ curl -X POST https://memoryai.dev/v1/admin/provision \
40
+ -H "Content-Type: application/json" \
41
+ -d '{"name": "my-agent", "tos_accepted": true}'
42
+ ```
43
+
44
+ Save the `api_key` from the response.
45
+
46
+ </details>
47
+
48
+ ### 2. Other tools (MCP config)
49
+
50
+ For tools without a one-command installer, choose your platform below. Config once — memory works automatically forever.
51
+
52
+ ---
53
+
54
+ ## IDE Setup
55
+
56
+ ### Claude Code (CLI) one command, fully automatic
57
+
58
+ ```bash
59
+ HM_API_KEY=hm_sk_your_key_here npx -y -p memoryai-mcp memoryai-claude-setup
60
+ ```
61
+
62
+ This wires three HTTP hooks into `~/.claude/settings.json` plus the MCP server.
63
+ Claude Code injects each hook's context directly into the model — **memory then
64
+ works at the mechanism level, no agent cooperation required**:
65
+
66
+ - **SessionStart** → loads DNA + recent context when a session opens
67
+ - **UserPromptSubmit** → recalls relevant memory before each prompt
68
+ - **Stop** → stores decisions/preferences automatically when a turn ends
69
+
70
+ Re-running is safe (idempotent merge). For a project-only install set
71
+ `MEMORYAI_SCOPE=project`. After setup, restart Claude Code and just work — you
72
+ never call a memory tool by hand.
73
+
74
+ <details>
75
+ <summary>Manual setup (MCP only, soft automation via CLAUDE.md)</summary>
76
+
77
+ If you prefer not to use hooks, add the MCP server to `~/.claude/settings.json`:
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "memoryai": {
83
+ "command": "npx",
84
+ "args": ["-y", "memoryai-mcp"],
85
+ "env": {
86
+ "HM_ENDPOINT": "https://memoryai.dev",
87
+ "HM_API_KEY": "hm_sk_your_key_here"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ Then create `~/.claude/CLAUDE.md`:
95
+
96
+ ```markdown
97
+ ## Memory Protocol
98
+ At the start of every conversation, call `memory_bootstrap` to load context from MemoryAI.
99
+ Before context gets large (>100K tokens), call `memory_compact` to save important context.
100
+ Use `memory_store` to save important decisions, preferences, and facts.
101
+ Use `memory_recall` to search past memories when relevant.
102
+ ```
103
+
104
+ Note: without hooks, memory depends on the model following CLAUDE.md (soft
105
+ automation). The hook setup above is the guaranteed, mechanism-level path.
106
+
107
+ </details>
108
+
109
+ ### Kiro — one command, fully automatic
110
+
111
+ ```bash
112
+ HM_API_KEY=hm_sk_your_key_here npx -y -p memoryai-mcp memoryai-kiro-setup
113
+ ```
114
+
115
+ Writes `.kiro/settings/mcp.json` (with autoApprove), `.kiro/steering/memoryai.md`,
116
+ and two Agent Hooks (`promptSubmit` → recall, `agentStop` → store/compact) so
117
+ memory is automatic at the event level.
118
+
119
+ ### Cursor — `~/.cursor/mcp.json`
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "memoryai": {
125
+ "command": "npx",
126
+ "args": ["-y", "memoryai-mcp"],
127
+ "env": {
128
+ "HM_ENDPOINT": "https://memoryai.dev",
129
+ "HM_API_KEY": "hm_sk_your_key_here"
130
+ }
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ Auto-bootstrap — create `.cursor/rules/memoryai.mdc`:
137
+
138
+ ```
139
+ At the start of every session, call memory_bootstrap to load context.
140
+ After completing tasks, call memory_compact to save context.
141
+ Store important decisions and preferences with memory_store.
142
+ ```
143
+
144
+ ### VS Code — `.vscode/mcp.json`
145
+
146
+ ```json
147
+ {
148
+ "servers": {
149
+ "memoryai": {
150
+ "command": "npx",
151
+ "args": ["-y", "memoryai-mcp"],
152
+ "env": {
153
+ "HM_ENDPOINT": "https://memoryai.dev",
154
+ "HM_API_KEY": "hm_sk_your_key_here"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ ### Kiro — `.kiro/settings/mcp.json`
162
+
163
+ ```json
164
+ {
165
+ "mcpServers": {
166
+ "memoryai": {
167
+ "command": "npx",
168
+ "args": ["-y", "memoryai-mcp"],
169
+ "env": {
170
+ "HM_ENDPOINT": "https://memoryai.dev",
171
+ "HM_API_KEY": "hm_sk_your_key_here"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ ```
177
+
178
+ ### Windsurf — `~/.codeium/windsurf/mcp_config.json`
179
+
180
+ ```json
181
+ {
182
+ "mcpServers": {
183
+ "memoryai": {
184
+ "command": "npx",
185
+ "args": ["-y", "memoryai-mcp"],
186
+ "env": {
187
+ "HM_ENDPOINT": "https://memoryai.dev",
188
+ "HM_API_KEY": "hm_sk_your_key_here"
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ### Claude Desktop `claude_desktop_config.json`
196
+
197
+ macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
198
+ Windows: `%APPDATA%\Claude\claude_desktop_config.json`
199
+
200
+ ```json
201
+ {
202
+ "mcpServers": {
203
+ "memoryai": {
204
+ "command": "npx",
205
+ "args": ["-y", "memoryai-mcp"],
206
+ "env": {
207
+ "HM_ENDPOINT": "https://memoryai.dev",
208
+ "HM_API_KEY": "hm_sk_your_key_here"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ ### Antigravity — `~/.antigravity/mcp.json`
216
+
217
+ ```json
218
+ {
219
+ "mcpServers": {
220
+ "memoryai": {
221
+ "command": "npx",
222
+ "args": ["-y", "memoryai-mcp"],
223
+ "env": {
224
+ "HM_ENDPOINT": "https://memoryai.dev",
225
+ "HM_API_KEY": "hm_sk_your_key_here"
226
+ }
227
+ }
228
+ }
229
+ }
230
+ ```
231
+
232
+ ### Any MCP-compatible tool
233
+
234
+ ```json
235
+ {
236
+ "mcpServers": {
237
+ "memoryai": {
238
+ "command": "npx",
239
+ "args": ["-y", "memoryai-mcp"],
240
+ "env": {
241
+ "HM_ENDPOINT": "https://memoryai.dev",
242
+ "HM_API_KEY": "hm_sk_your_key_here"
243
+ }
244
+ }
245
+ }
246
+ }
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Auto-Bootstrap (Make It Fully Automatic)
252
+
253
+ After MCP config, add a system rule so your agent auto-loads memory every session:
254
+
255
+ | Platform | Rule File | Content |
256
+ |----------|-----------|---------|
257
+ | Claude Code | `~/.claude/CLAUDE.md` | See above |
258
+ | Cursor | `.cursor/rules/memoryai.mdc` | See above |
259
+ | Kiro | `.kiro/rules/memoryai.md` | Same content |
260
+ | Windsurf | `.windsurfrules` | Same content |
261
+ | VS Code | `.github/copilot-instructions.md` | Same content |
262
+
263
+ Rule content (copy-paste for any platform):
264
+
265
+ ```
266
+ ## Memory Protocol
267
+ At the start of every conversation, call `memory_bootstrap` to load context from MemoryAI.
268
+ Before context gets large, call `memory_compact` to save important context.
269
+ Use `memory_store` to save important decisions, preferences, and facts.
270
+ Use `memory_recall` to search past memories when relevant.
271
+ ```
272
+
273
+ ---
274
+
275
+ ## How It Works
276
+
277
+ ```
278
+ Open IDE MCP auto-connects Agent reads rules Calls bootstrap
279
+ → Loads your identity, preferences, recent work
280
+ → Works normally (auto-stores important stuff)
281
+ → Context getting full? Auto-compacts
282
+ Close IDE → Sleep workers consolidate overnight
283
+ → Open IDE next day → Bootstrap loads everything back
284
+ Cycle repeats. Memory grows smarter over time.
285
+ ```
286
+
287
+ **You do nothing.** The agent handles everything automatically.
288
+
289
+ ---
290
+
291
+ ## Tools Available
292
+
293
+ | Tool | What It Does |
294
+ |------|-------------|
295
+ | `memory_bootstrap` | Wake up with full context (identity + recent + preferences) |
296
+ | `memory_store` | Save a memory (fact, decision, preference, identity) |
297
+ | `memory_recall` | Search memories by meaning (semantic + graph + FTS) |
298
+ | `memory_compact` | Save conversation context before it's lost |
299
+ | `memory_recover` | Recover session after a break |
300
+ | `memory_health` | Check context pressure (safe/warning/critical) |
301
+ | `memory_explore` | Explore connections between memories |
302
+ | `memory_clusters` | View topic clusters in your knowledge graph |
303
+ | `learn` | Store action + result + lesson learned |
304
+ | `entity_list` | List tracked entities (files, people, packages) |
305
+ | `reasoning_store` | Deep reasoning memory (Pro+) |
306
+ | `reasoning_recall` | Recall reasoned insights (Pro+) |
307
+ | `snapshot_create` | Backup memory state |
308
+ | `snapshot_restore` | Restore from backup |
309
+
310
+ ---
311
+
312
+ ## Context Guard (Built-in)
313
+
314
+ Context Guard monitors your session and prevents context loss:
315
+
316
+ | State | Meaning | Agent Action |
317
+ |-------|---------|-------------|
318
+ | SAFE | Context < 40% full | Continue normally |
319
+ | COMPACT_SOON | Context 40-55% full | Prepare to compact |
320
+ | COMPACT_NOW | Context > 55% full | Must compact immediately |
321
+
322
+ The agent handles this automatically when rules are configured. No manual intervention needed.
323
+
324
+ ---
325
+
326
+ ## What Gets Remembered (DNA System)
327
+
328
+ | Memory Type | Example | Persistence |
329
+ |-------------|---------|-------------|
330
+ | `preference` | "I prefer Python over Java" | **Forever** (DNA-protected) |
331
+ | `decision` | "Chose PostgreSQL for this project" | **Forever** (DNA-protected) |
332
+ | `identity` | "Senior backend engineer, 10 years" | **Forever** (DNA-protected) |
333
+ | `fact` | "API endpoint is /v1/users" | Decays if unused |
334
+ | `goal` | "Launch v2.0 by June" | Decays if unused |
335
+
336
+ DNA memories (preference/decision/identity) **never decay, never get deleted, never get overwritten** by any background process. They define who you are.
337
+
338
+ ---
339
+
340
+ ## Pricing
341
+
342
+ | Plan | Features | Price |
343
+ |------|----------|-------|
344
+ | Free | Basic store/recall, 100 memories | Free |
345
+ | Pro | Full brain (reasoning, consolidation, personality) | Paid |
346
+ | ProMax | Multi-agent mesh, advanced features | Paid |
347
+ | God | Everything + deep graph traversal | Internal |
348
+
349
+ Get started free: https://memoryai.dev
350
+
351
+ ---
352
+
353
+ ## Links
354
+
355
+ - Website: https://memoryai.dev
356
+ - Python SDK: `pip install hmc-memory`
357
+ - npm MCP: `npx memoryai-mcp`
358
+ - GitHub: https://github.com/memoryai-dev/memoryai
359
+
360
+ ## License
361
+
362
+ MIT