memory-pulse-mcp-server 0.1.2 → 0.1.4

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,65 +1,462 @@
1
1
  # Memory Pulse MCP Server
2
2
 
3
- 精准、结构化的 AI 上下文记忆系统 - MCP Server
3
+ [![GitHub Stars](https://img.shields.io/github/stars/jiahuidegit/memory-mcp-server?style=social)](https://github.com/jiahuidegit/memory-mcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
6
+ [![npm version](https://img.shields.io/npm/v/memory-pulse-mcp-server.svg)](https://www.npmjs.com/package/memory-pulse-mcp-server)
7
+ [![npm downloads](https://img.shields.io/npm/dm/memory-pulse-mcp-server.svg)](https://www.npmjs.com/package/memory-pulse-mcp-server)
4
8
 
5
- ## 安装
9
+ **A precise, structured AI context memory system. MCP Server designed for Claude Code.**
10
+
11
+ > **If you find this project helpful, please give it a star on [GitHub](https://github.com/jiahuidegit/memory-mcp-server)!** Your support helps us improve!
12
+
13
+ [English](https://github.com/jiahuidegit/memory-mcp-server#readme) | [中文](https://github.com/jiahuidegit/memory-mcp-server/blob/main/README_CN.md)
14
+
15
+ ---
16
+
17
+ ## Why Memory Pulse?
18
+
19
+ ### The Problem with Existing AI Memory Solutions
20
+
21
+ | Problem | Traditional Solutions | Memory Pulse |
22
+ |---------|----------------------|--------------|
23
+ | **Information Loss** | Vector compression loses details | Complete context preservation |
24
+ | **Imprecise Retrieval** | Semantic-only search misses exact matches | Multi-level: Exact → Full-text → Semantic |
25
+ | **Decision Gap** | Stores conclusions, not reasoning | Structured: Problem → Analysis → Options → Decision |
26
+ | **Context Fragmentation** | Scattered, unrelated memories | Relationship chains & timeline tracking |
27
+
28
+ ### Comparison with Other Memory Systems
29
+
30
+ | Feature | Memory Pulse | mem0 | Zep | LangChain Memory |
31
+ |---------|-------------|------|-----|------------------|
32
+ | **Storage** | Full context (no compression) | Vector embeddings | Vector + Graph | Vector embeddings |
33
+ | **Retrieval Strategy** | L1 Exact → L2 Full-text → L3 Semantic | Semantic only | Semantic + Temporal | Semantic only |
34
+ | **Decision Tracking** | Forced structured fields | - | - | - |
35
+ | **Relationship Graph** | Built-in | - | Built-in | - |
36
+ | **Timeline View** | Built-in | - | Built-in | - |
37
+ | **MCP Native** | Yes | - | - | - |
38
+ | **Local-first** | SQLite | Cloud-dependent | Cloud-dependent | Varies |
39
+ | **Zero Config** | Yes | - | - | - |
40
+
41
+ ---
42
+
43
+ ## Features
44
+
45
+ - **Complete Context Preservation** - No compression, no information loss
46
+ - **Multi-level Retrieval** - L1 Exact match → L2 Full-text search → L3 Semantic search
47
+ - **Structured Memory Types** - Decision / Solution / Session / Code / Error / Config
48
+ - **Relationship Chains** - Track how memories relate and evolve
49
+ - **Timeline View** - See memory evolution over time
50
+ - **Forced Structure** - AI must provide complete context (no lazy summaries)
51
+ - **Local-first** - SQLite storage, your data stays with you
52
+ - **Zero Config** - Works out of the box
53
+
54
+ ---
55
+
56
+ ## Quick Start
57
+
58
+ ### Option 1: Run with npx (Recommended)
59
+
60
+ ```bash
61
+ npx memory-pulse-mcp-server
62
+ ```
63
+
64
+ ### Option 2: Global Installation
6
65
 
7
66
  ```bash
8
67
  npm install -g memory-pulse-mcp-server
68
+ memory-pulse-mcp
69
+ ```
70
+
71
+ ### Option 3: Build from Source
72
+
73
+ ```bash
74
+ git clone https://github.com/jiahuidegit/memory-mcp-server.git
75
+ cd memory-mcp-server
76
+ pnpm install
77
+ pnpm build
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Update to Latest Version
83
+
84
+ ### If using npx (Recommended)
85
+
86
+ npx automatically uses the latest version, just restart your MCP client.
87
+
88
+ ### If globally installed
89
+
90
+ ```bash
91
+ npm update -g memory-pulse-mcp-server
92
+ # Or reinstall
93
+ npm install -g memory-pulse-mcp-server@latest
94
+ ```
95
+
96
+ ### Check current version
97
+
98
+ ```bash
99
+ npm list -g memory-pulse-mcp-server
100
+ ```
101
+
102
+ ---
103
+
104
+ ## MCP Client Configuration
105
+
106
+ ### Claude Code
107
+
108
+ Create `.mcp.json` in your project directory:
109
+
110
+ ```json
111
+ {
112
+ "mcpServers": {
113
+ "memory-pulse": {
114
+ "command": "npx",
115
+ "args": ["-y", "memory-pulse-mcp-server"]
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ Or global configuration at `~/.claude/mcp.json`:
122
+
123
+ ```json
124
+ {
125
+ "mcpServers": {
126
+ "memory-pulse": {
127
+ "command": "npx",
128
+ "args": ["-y", "memory-pulse-mcp-server"]
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ ### Claude Desktop
135
+
136
+ Edit the configuration file:
137
+
138
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
139
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
140
+
141
+ ```json
142
+ {
143
+ "mcpServers": {
144
+ "memory-pulse": {
145
+ "command": "npx",
146
+ "args": ["-y", "memory-pulse-mcp-server"]
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ Restart the client after configuration.
153
+
154
+ ---
155
+
156
+ ## Environment Variables
157
+
158
+ | Variable | Description | Default |
159
+ |----------|-------------|---------|
160
+ | `MEMORY_STORAGE` | Storage type: `sqlite` or `postgresql` | `sqlite` |
161
+ | `MEMORY_DB_PATH` | SQLite database file path | `./memory.db` |
162
+ | `DATABASE_URL` | PostgreSQL connection string (required for postgresql) | - |
163
+
164
+ ### SQLite Storage (Default)
165
+
166
+ Zero configuration, works out of the box:
167
+
168
+ ```json
169
+ {
170
+ "mcpServers": {
171
+ "memory-pulse": {
172
+ "command": "npx",
173
+ "args": ["-y", "memory-pulse-mcp-server"]
174
+ }
175
+ }
176
+ }
9
177
  ```
10
178
 
11
- ## 配置 Claude Code
179
+ ### Custom SQLite Path
12
180
 
13
- 在 `~/.claude/mcp.json` 或项目目录 `.mcp.json` 中添加:
181
+ ```json
182
+ {
183
+ "mcpServers": {
184
+ "memory-pulse": {
185
+ "command": "npx",
186
+ "args": ["-y", "memory-pulse-mcp-server"],
187
+ "env": {
188
+ "MEMORY_DB_PATH": "/path/to/your/memory.db"
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ### PostgreSQL Storage
196
+
197
+ For production deployments or team usage:
14
198
 
15
199
  ```json
16
200
  {
17
201
  "mcpServers": {
18
202
  "memory-pulse": {
19
- "command": "memory-pulse-mcp",
20
- "args": []
203
+ "command": "npx",
204
+ "args": ["-y", "memory-pulse-mcp-server"],
205
+ "env": {
206
+ "MEMORY_STORAGE": "postgresql",
207
+ "DATABASE_URL": "postgresql://user:password@localhost:5432/memory_pulse"
208
+ }
21
209
  }
22
210
  }
23
211
  }
24
212
  ```
25
213
 
26
- ## 可用工具
214
+ > **Note**: PostgreSQL storage requires `@prisma/client`. Install it manually if needed:
215
+ > ```bash
216
+ > npm install @prisma/client
217
+ > ```
218
+
219
+ ---
220
+
221
+ ## MCP Tools
222
+
223
+ ### Memory Storage
224
+
225
+ | Tool | Description |
226
+ |------|-------------|
227
+ | `mpulse_store` | Smart memory storage with auto-classification |
228
+ | `mpulse_store_decision` | Store architectural decisions (forced complete fields) |
229
+ | `mpulse_store_solution` | Store problem solutions (problem → root cause → solution) |
230
+ | `mpulse_store_session` | Store session summaries (call at session end) |
231
+
232
+ ### Memory Retrieval
233
+
234
+ | Tool | Description |
235
+ |------|-------------|
236
+ | `mpulse_recall` | Multi-strategy memory retrieval |
237
+ | `mpulse_timeline` | View project timeline |
238
+ | `mpulse_relations` | Query memory relationship chains |
239
+
240
+ ---
241
+
242
+ ## Usage Examples
243
+
244
+ ### Store a Decision
245
+
246
+ When you make an architectural decision, AI calls `mpulse_store_decision`:
247
+
248
+ ```
249
+ User: Let's use Zustand for state management instead of Redux
250
+
251
+ AI: [calls mpulse_store_decision]
252
+ {
253
+ "question": "Which state management solution to use?",
254
+ "options": [
255
+ { "name": "Redux", "pros": ["Mature ecosystem", "DevTools"], "cons": ["Boilerplate heavy"] },
256
+ { "name": "Zustand", "pros": ["Lightweight", "TypeScript friendly"], "cons": ["Smaller ecosystem"] }
257
+ ],
258
+ "chosen": "Zustand",
259
+ "reason": "Project is medium-sized, prioritizing development efficiency. Zustand has lower learning curve.",
260
+ "projectId": "my-app"
261
+ }
262
+
263
+ Decision stored with ID: mem_xxx
264
+ ```
265
+
266
+ ### Store a Solution
267
+
268
+ When you solve a problem, AI calls `mpulse_store_solution`:
269
+
270
+ ```
271
+ User: Fixed the memory leak in useEffect
272
+
273
+ AI: [calls mpulse_store_solution]
274
+ {
275
+ "problem": "Memory leak warning in React component",
276
+ "rootCause": "Async operation continues after component unmount",
277
+ "solution": "Added cleanup function in useEffect to cancel pending requests",
278
+ "projectId": "my-app"
279
+ }
280
+
281
+ Solution stored with ID: mem_xxx
282
+ ```
283
+
284
+ ### Recall Memories
285
+
286
+ When you need context from previous sessions:
287
+
288
+ ```
289
+ User: What did we decide about state management?
290
+
291
+ AI: [calls mpulse_recall]
292
+ {
293
+ "query": "state management",
294
+ "projectId": "my-app",
295
+ "strategy": "fulltext"
296
+ }
297
+
298
+ Found: Decision from 2 days ago - Chose Zustand because...
299
+ ```
300
+
301
+ ### View Timeline
27
302
 
28
- | 工具 | 说明 |
29
- |------|------|
30
- | `mpulse_store` | 智能存储记忆,AI 自动分类和结构化 |
31
- | `mpulse_store_decision` | 存储架构决策(强制字段,防止 AI 偷懒) |
32
- | `mpulse_store_solution` | 存储问题解决方案 |
33
- | `mpulse_store_session` | 存储会话总结(会话结束时调用) |
34
- | `mpulse_recall` | 检索记忆(多策略:精确、全文、语义) |
35
- | `mpulse_timeline` | 查看项目的时间线视图 |
36
- | `mpulse_relations` | 查询记忆的关系链 |
303
+ ```
304
+ User: Show me what we worked on this week
37
305
 
38
- ## 使用示例
306
+ AI: [calls mpulse_timeline]
307
+ {
308
+ "projectId": "my-app",
309
+ "limit": 20
310
+ }
311
+
312
+ Timeline:
313
+ - Jan 15: Decision - State management (Zustand)
314
+ - Jan 15: Solution - Memory leak fix
315
+ - Jan 14: Decision - API architecture (REST vs GraphQL)
316
+ ...
317
+ ```
39
318
 
40
- ### 存储决策
319
+ ### Query Relationships
41
320
 
42
321
  ```
43
- AI 会自动调用 mpulse_store_decision 工具:
44
- - question: "状态管理选择什么?"
45
- - options: [{ name: "Redux", pros: [...], cons: [...] }, ...]
46
- - chosen: "Zustand"
47
- - reason: "轻量、TypeScript 支持好"
322
+ User: What decisions are related to our API design?
323
+
324
+ AI: [calls mpulse_relations]
325
+ {
326
+ "memoryId": "mem_api_decision",
327
+ "depth": 2
328
+ }
329
+
330
+ Relationships:
331
+ - mem_api_decision (Decision: REST API)
332
+ ├── mem_auth_solution (Solution: JWT implementation)
333
+ └── mem_error_handling (Decision: Error response format)
48
334
  ```
49
335
 
50
- ### 检索记忆
336
+ ---
337
+
338
+ ## Retrieval Algorithm
339
+
340
+ Memory Pulse uses a **3-level cascade retrieval strategy**:
51
341
 
52
342
  ```
53
- AI 会自动调用 mpulse_recall 工具:
54
- - query: "状态管理"
55
- - projectId: "my-project"
56
- - strategy: "fulltext"
343
+ ┌─────────────────────────────────────────────────────┐
344
+ │ User Query │
345
+ └─────────────────────┬───────────────────────────────┘
346
+
347
+ ┌─────────────────────────────────────────────────────┐
348
+ │ L1: Exact Match (< 10ms) │
349
+ │ - projectId + type + keywords index │
350
+ │ - Returns if matches ≥ 5 │
351
+ └─────────────────────┬───────────────────────────────┘
352
+ ▼ (if insufficient)
353
+ ┌─────────────────────────────────────────────────────┐
354
+ │ L2: Full-text Search (< 100ms) │
355
+ │ - SQLite FTS5 / PostgreSQL full-text │
356
+ │ - Chinese + English tokenization │
357
+ │ - Returns if matches ≥ 3 │
358
+ └─────────────────────┬───────────────────────────────┘
359
+ ▼ (if insufficient)
360
+ ┌─────────────────────────────────────────────────────┐
361
+ │ L3: Semantic Search (< 500ms) │
362
+ │ - Embedding similarity (optional) │
363
+ │ - Fallback for fuzzy queries │
364
+ └─────────────────────────────────────────────────────┘
57
365
  ```
58
366
 
59
- ## 数据存储
367
+ **Why this approach?**
368
+
369
+ - **Precision first**: Exact matches are faster and more accurate
370
+ - **Graceful degradation**: Falls back to broader search when needed
371
+ - **No false positives**: Semantic search is last resort, not default
372
+
373
+ ---
374
+
375
+ ## Memory Types
376
+
377
+ | Type | Use Case | Required Fields |
378
+ |------|----------|-----------------|
379
+ | `decision` | Architectural choices | question, options, chosen, reason |
380
+ | `solution` | Problem fixes | problem, rootCause, solution |
381
+ | `session` | Session summaries | summary, decisions, nextSteps |
382
+ | `code` | Code implementations | content, artifacts |
383
+ | `error` | Error records | content, stackTrace |
384
+ | `config` | Configuration info | content, settings |
385
+
386
+ ---
387
+
388
+ ## Security & Privacy
60
389
 
61
- 默认使用 SQLite 存储在当前目录的 `memory.db` 文件中。
390
+ 1. **Local-first** - All data stored locally in SQLite, no cloud dependency
391
+ 2. **Your Data** - Database file is yours, backup/migrate anytime
392
+ 3. **No Telemetry** - Zero data collection or phone-home
393
+ 4. **Project Isolation** - Memories isolated by projectId
394
+
395
+ ---
396
+
397
+ ## Web Dashboard (Optional)
398
+
399
+ Memory Pulse includes an optional Web Dashboard for visualizing and managing your memories.
400
+
401
+ Check out the full project repository for the Web Dashboard:
402
+ 👉 [https://github.com/jiahuidegit/memory-mcp-server](https://github.com/jiahuidegit/memory-mcp-server)
403
+
404
+ Features:
405
+ - Memory management with modern UI
406
+ - Timeline view
407
+ - Relationship graph visualization
408
+ - Project filtering
409
+ - Full-text search
410
+
411
+ ---
412
+
413
+ ## Roadmap
414
+
415
+ - [x] MCP Server core functionality
416
+ - [x] SQLite local storage
417
+ - [x] PostgreSQL cloud support
418
+ - [x] Multi-level retrieval (Exact + Full-text)
419
+ - [x] Decision/Solution/Session structured storage
420
+ - [x] Web Dashboard for visualization
421
+ - [ ] CLI tool for manual operations
422
+ - [ ] Semantic search (Embedding)
423
+ - [ ] Team collaboration features
424
+
425
+ ---
426
+
427
+ ## Star History
428
+
429
+ <a href="https://star-history.com/#jiahuidegit/memory-mcp-server&Date">
430
+ <picture>
431
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=jiahuidegit/memory-mcp-server&type=Date&theme=dark" />
432
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=jiahuidegit/memory-mcp-server&type=Date" />
433
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=jiahuidegit/memory-mcp-server&type=Date" />
434
+ </picture>
435
+ </a>
436
+
437
+ ---
438
+
439
+ ## Contributing
440
+
441
+ Issues and Pull Requests are welcome!
442
+
443
+ ```bash
444
+ # Development
445
+ git clone https://github.com/jiahuidegit/memory-mcp-server.git
446
+ cd memory-mcp-server
447
+ pnpm install
448
+ pnpm build
449
+ pnpm test
450
+ ```
451
+
452
+ ---
62
453
 
63
454
  ## License
64
455
 
65
- MIT
456
+ This project is licensed under the [MIT License](LICENSE).
457
+
458
+ ---
459
+
460
+ **If you find this project helpful, please give it a star!**
461
+
462
+ **Feel free to open issues for questions or submit PRs for improvements!**