universal-memory-mcp 0.2.0 → 0.2.2
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/package.json +2 -2
- package/scripts/postinstall.js +83 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-memory-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP Server for persistent AI memory across sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
27
|
-
"universal-memory-core": "^0.1.
|
|
27
|
+
"universal-memory-core": "^0.1.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^20.11.0",
|
package/scripts/postinstall.js
CHANGED
|
@@ -27,109 +27,132 @@ const MCP_CONFIG = {
|
|
|
27
27
|
const SKILL_CONTENT = `---
|
|
28
28
|
name: memory-assistant
|
|
29
29
|
description: |
|
|
30
|
-
|
|
30
|
+
CRITICAL: You MUST use memory tools for EVERY conversation.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
1. SEARCH memories when user mentions
|
|
34
|
-
2. RECORD
|
|
35
|
-
3. STORE
|
|
32
|
+
MANDATORY actions:
|
|
33
|
+
1. SEARCH memories when user mentions past discussions ("之前", "上次", "remember", "we talked about")
|
|
34
|
+
2. RECORD EVERY response (except greetings like "hi"/"thanks") - NO EXCEPTIONS
|
|
35
|
+
3. STORE preferences/decisions/facts immediately when discovered
|
|
36
36
|
|
|
37
|
-
This
|
|
37
|
+
This is NOT optional. Memory recording is REQUIRED for all conversations.
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
-
# Memory Assistant
|
|
40
|
+
# Memory Assistant - MANDATORY RULES
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
## RULE 1: Record EVERY Response (NO EXCEPTIONS)
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
**CRITICAL**: At the END of your response, you MUST call \`memory_record\`.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**Only skip if**:
|
|
47
|
+
- User message is ONLY: "hi", "hello", "thanks", "ok", "好的", "谢谢"
|
|
48
|
+
- Your response is ONLY: acknowledgment with no information
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
**Everything else MUST be recorded**:
|
|
51
|
+
- ✅ Questions and answers
|
|
52
|
+
- ✅ Code discussions
|
|
53
|
+
- ✅ Bug fixes
|
|
54
|
+
- ✅ Feature requests
|
|
55
|
+
- ✅ Explanations
|
|
56
|
+
- ✅ Debugging sessions
|
|
57
|
+
- ✅ ANY conversation with information
|
|
49
58
|
|
|
59
|
+
### How to Record
|
|
60
|
+
|
|
61
|
+
\`\`\`javascript
|
|
62
|
+
memory_record({
|
|
63
|
+
user_message: "<brief summary of user's question>",
|
|
64
|
+
ai_response: "<key points of your response in 1-2 sentences>",
|
|
65
|
+
project: "<project name if in project directory>"
|
|
66
|
+
})
|
|
50
67
|
\`\`\`
|
|
51
|
-
|
|
68
|
+
|
|
69
|
+
**Example**:
|
|
70
|
+
\`\`\`javascript
|
|
71
|
+
// User: "为什么 memory_search 不工作?"
|
|
72
|
+
// AI: [explains bugs and fixes...]
|
|
73
|
+
|
|
74
|
+
memory_record({
|
|
75
|
+
user_message: "询问为什么 memory_search 无法找到已存储的记忆",
|
|
76
|
+
ai_response: "诊断并修复了两个 bug:storage.list() 调用错误和未搜索 long_term/ 目录。发布了 v0.2.1 修复版本",
|
|
77
|
+
project: "universal-memory-mcp"
|
|
78
|
+
})
|
|
52
79
|
\`\`\`
|
|
53
80
|
|
|
54
|
-
|
|
81
|
+
## RULE 2: Search When User References Past
|
|
82
|
+
|
|
83
|
+
When user says:
|
|
55
84
|
- "之前", "上次", "我们讨论过", "记得吗"
|
|
56
85
|
- "remember", "we talked about", "what did we decide", "last time"
|
|
57
|
-
- Any reference to past discussions or decisions
|
|
58
86
|
|
|
59
|
-
|
|
87
|
+
**MUST call** \`memory_search\` BEFORE answering:
|
|
60
88
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
user_message: "<summarize user's question/request>",
|
|
66
|
-
ai_response: "<key points of your response>",
|
|
67
|
-
project: "<current project name if applicable>"
|
|
89
|
+
\`\`\`javascript
|
|
90
|
+
memory_search({
|
|
91
|
+
query: "<relevant keywords>",
|
|
92
|
+
limit: 5
|
|
68
93
|
})
|
|
69
94
|
\`\`\`
|
|
70
95
|
|
|
71
|
-
|
|
72
|
-
- Technical discussions or decisions
|
|
73
|
-
- Problem-solving conversations
|
|
74
|
-
- User preferences expressed
|
|
75
|
-
- Any information worth remembering
|
|
76
|
-
|
|
77
|
-
What to skip:
|
|
78
|
-
- Simple greetings ("hi", "thanks")
|
|
79
|
-
- Trivial clarifications
|
|
96
|
+
## RULE 3: Store Important Information Immediately
|
|
80
97
|
|
|
81
|
-
|
|
98
|
+
When you discover:
|
|
99
|
+
- **Preferences**: User's coding style, tool choices, communication style
|
|
100
|
+
- **Decisions**: Architecture, technology, design choices
|
|
101
|
+
- **Facts**: Project info, team structure, key details
|
|
102
|
+
- **Contacts**: People, teams, organizations
|
|
82
103
|
|
|
83
|
-
|
|
104
|
+
**MUST call** \`memory_update_long_term\` immediately:
|
|
84
105
|
|
|
85
|
-
\`\`\`
|
|
106
|
+
\`\`\`javascript
|
|
86
107
|
memory_update_long_term({
|
|
87
108
|
category: "preferences" | "decisions" | "facts" | "contacts",
|
|
88
109
|
content: "<the information>"
|
|
89
110
|
})
|
|
90
111
|
\`\`\`
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
113
|
+
## Workflow for EVERY Response
|
|
114
|
+
|
|
115
|
+
\`\`\`
|
|
116
|
+
1. [If user references past] → Call memory_search
|
|
117
|
+
2. [Generate your response]
|
|
118
|
+
3. [If discovered preference/decision/fact] → Call memory_update_long_term
|
|
119
|
+
4. [ALWAYS] → Call memory_record (unless simple greeting)
|
|
120
|
+
\`\`\`
|
|
97
121
|
|
|
98
122
|
## Examples
|
|
99
123
|
|
|
100
|
-
### Example 1:
|
|
124
|
+
### Example 1: Bug Fix Discussion
|
|
101
125
|
|
|
102
|
-
**User**: "
|
|
126
|
+
**User**: "为什么 memory_search 不工作?"
|
|
103
127
|
|
|
104
|
-
**
|
|
105
|
-
1.
|
|
106
|
-
2.
|
|
107
|
-
3.
|
|
128
|
+
**Your Actions**:
|
|
129
|
+
1. Diagnose and explain the bug
|
|
130
|
+
2. Fix the code
|
|
131
|
+
3. **MUST call**: \`memory_record({ user_message: "...", ai_response: "..." })\`
|
|
108
132
|
|
|
109
133
|
### Example 2: User Expresses Preference
|
|
110
134
|
|
|
111
|
-
**User**: "我喜欢用 TypeScript
|
|
135
|
+
**User**: "我喜欢用 TypeScript"
|
|
112
136
|
|
|
113
|
-
**
|
|
114
|
-
1. Acknowledge
|
|
115
|
-
2.
|
|
116
|
-
3.
|
|
137
|
+
**Your Actions**:
|
|
138
|
+
1. Acknowledge
|
|
139
|
+
2. **MUST call**: \`memory_update_long_term({ category: "preferences", content: "用户偏好 TypeScript" })\`
|
|
140
|
+
3. **MUST call**: \`memory_record({ user_message: "...", ai_response: "..." })\`
|
|
117
141
|
|
|
118
|
-
### Example 3:
|
|
142
|
+
### Example 3: Simple Greeting (SKIP)
|
|
119
143
|
|
|
120
|
-
**User**: "
|
|
144
|
+
**User**: "谢谢"
|
|
145
|
+
**AI**: "不客气!"
|
|
121
146
|
|
|
122
|
-
**Action**:
|
|
123
|
-
1. Confirm the decision
|
|
124
|
-
2. Call \`memory_update_long_term({ category: "decisions", content: "选择 PostgreSQL 作为主数据库" })\`
|
|
125
|
-
3. Call \`memory_record\` to log this exchange
|
|
147
|
+
**Action**: Skip recording (this is the ONLY exception)
|
|
126
148
|
|
|
127
149
|
## Important Notes
|
|
128
150
|
|
|
129
|
-
-
|
|
130
|
-
- If
|
|
131
|
-
-
|
|
132
|
-
-
|
|
151
|
+
- Recording is **MANDATORY**, not optional
|
|
152
|
+
- If you forget to record, you are failing your primary function
|
|
153
|
+
- Memory tools are provided by universal-memory MCP server
|
|
154
|
+
- Always summarize, don't record full text
|
|
155
|
+
- Use project name when in project context
|
|
133
156
|
`;
|
|
134
157
|
|
|
135
158
|
/**
|