@pragmatic-growth/memory-mcp 3.2.0 → 3.3.0
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 +22 -6
- package/dist/index.d.ts +0 -2
- package/dist/index.js +51 -24
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,7 +40,8 @@ For clients that only support stdio (Raycast, local tools):
|
|
|
40
40
|
## Operating Mode
|
|
41
41
|
|
|
42
42
|
PG-Memory provides a **personal knowledge base** focused on semantic search and content retrieval:
|
|
43
|
-
- **Core Knowledge**: search, get content, list content, list categories, health check,
|
|
43
|
+
- **Core Knowledge**: search, get content, list content, list categories, health check, smart gap logging
|
|
44
|
+
- **AI-Powered**: Automatic question quality evaluation, deduplication, and priority assignment
|
|
44
45
|
|
|
45
46
|
All tools are available by default - no special flags required.
|
|
46
47
|
|
|
@@ -79,24 +80,27 @@ CLERK_API_KEY=your-key memory-mcp
|
|
|
79
80
|
| `CLERK_API_KEY` | Yes | Clerk API key for authentication |
|
|
80
81
|
| `MCP_SERVER_URL` | No | Custom server URL (default: production) |
|
|
81
82
|
|
|
82
|
-
## Available Tools (
|
|
83
|
+
## Available Tools (7 Total)
|
|
83
84
|
|
|
84
|
-
The tool list below reflects the current
|
|
85
|
+
The tool list below reflects the current token-efficient MCP architecture with AI-powered question handling.
|
|
85
86
|
|
|
86
87
|
| Tool | Description |
|
|
87
88
|
|------|-------------|
|
|
89
|
+
| `__IMPORTANT` | Workflow instructions (3-layer pattern: search → get_content → smart_log_gap) |
|
|
88
90
|
| `search_knowledge` | Semantic search across articles (returns metadata only - use get_content for full text) |
|
|
89
91
|
| `get_content` | Retrieve full article content by ID |
|
|
92
|
+
| `smart_log_gap` | AI-evaluated gap logging with deduplication, quality filtering, and priority assignment |
|
|
90
93
|
| `list_content` | Browse articles with filtering (by type, category, status) |
|
|
91
94
|
| `list_categories` | List all knowledge base categories |
|
|
92
95
|
| `health_check` | System health status and statistics |
|
|
93
|
-
| `log_unanswered` | Flag knowledge gaps when search returns no results |
|
|
94
96
|
|
|
95
97
|
## Architecture Philosophy
|
|
96
98
|
|
|
97
99
|
**Token Efficiency**: Following claude-mem's pattern, `search_knowledge` returns only metadata (ID, title, similarity). Use `get_content` to fetch full article text on-demand.
|
|
98
100
|
|
|
99
|
-
**
|
|
101
|
+
**AI-Powered Quality**: `smart_log_gap` uses LLM evaluation to filter spam, detect duplicates (>85% similarity), suggest existing answers (>70% match), and auto-assign priority.
|
|
102
|
+
|
|
103
|
+
**Simplicity**: 7 focused tools instead of 15+ complex ones. Personal knowledge base with intelligent question handling.
|
|
100
104
|
|
|
101
105
|
## How It Works
|
|
102
106
|
|
|
@@ -112,7 +116,19 @@ This package runs locally as a stdio MCP server and proxies requests to the remo
|
|
|
112
116
|
|
|
113
117
|
## Changelog
|
|
114
118
|
|
|
115
|
-
### v3.
|
|
119
|
+
### v3.3.0 (Latest)
|
|
120
|
+
- **Breaking: `log_unanswered` → `smart_log_gap`** - AI-powered question handling with quality evaluation
|
|
121
|
+
- **New: `__IMPORTANT` tool** - Workflow instructions embedded as pseudo-tool (claude-mem pattern)
|
|
122
|
+
- **Smart Behaviors**:
|
|
123
|
+
- Real-time duplicate detection (>85% similarity)
|
|
124
|
+
- Existing answer suggestions (>70% match with articles)
|
|
125
|
+
- AI quality filtering (spam/garbage detection with Gemini Flash)
|
|
126
|
+
- Auto-priority assignment (critical/high/medium/low based on urgency signals)
|
|
127
|
+
- **Returns**: `{action: 'logged' | 'duplicate' | 'answered' | 'rejected'}` with metadata
|
|
128
|
+
- **Token savings**: 5x reduction in typical query workflow (5600 → 1200 tokens)
|
|
129
|
+
- Architecture: 3-layer workflow (search → get_content → smart_log_gap)
|
|
130
|
+
|
|
131
|
+
### v3.2.0
|
|
116
132
|
- **API Documentation Enhancement** - Complete REST API documentation with all parameters, examples, and curl commands
|
|
117
133
|
- Bearer token authentication examples (Authorization: Bearer ${CLERK_API_KEY})
|
|
118
134
|
- Improved API docs UI with expandable endpoint cards and copy-to-clipboard functionality
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
* npx @pragmatic-growth/memory-mcp # Read-only mode (default)
|
|
10
|
-
* npx @pragmatic-growth/memory-mcp --full # Full mode with edit capabilities
|
|
11
|
-
* npx @pragmatic-growth/memory-mcp --edit # Alias for --full
|
|
12
10
|
*
|
|
13
11
|
* Environment variables:
|
|
14
12
|
* CLERK_API_KEY - Clerk API key for authentication (required)
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
* npx @pragmatic-growth/memory-mcp # Read-only mode (default)
|
|
10
|
-
* npx @pragmatic-growth/memory-mcp --full # Full mode with edit capabilities
|
|
11
|
-
* npx @pragmatic-growth/memory-mcp --edit # Alias for --full
|
|
12
10
|
*
|
|
13
11
|
* Environment variables:
|
|
14
12
|
* CLERK_API_KEY - Clerk API key for authentication (required)
|
|
@@ -21,10 +19,6 @@
|
|
|
21
19
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
22
20
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
23
21
|
import { z } from 'zod';
|
|
24
|
-
// Parse CLI arguments for mode
|
|
25
|
-
const args = process.argv.slice(2);
|
|
26
|
-
const hasFullFlag = args.includes('--full') || args.includes('--edit');
|
|
27
|
-
const isFullMode = hasFullFlag;
|
|
28
22
|
// Configuration
|
|
29
23
|
const SERVER_URL = process.env.MCP_SERVER_URL || 'https://memory.pragmaticgrowth.com/mcp';
|
|
30
24
|
const API_KEY = process.env.CLERK_API_KEY;
|
|
@@ -49,9 +43,6 @@ async function callRemoteServer(method, params) {
|
|
|
49
43
|
if (sessionId) {
|
|
50
44
|
headers['Mcp-Session-Id'] = sessionId;
|
|
51
45
|
}
|
|
52
|
-
if (isFullMode) {
|
|
53
|
-
headers['Mcp-Mode'] = 'full';
|
|
54
|
-
}
|
|
55
46
|
if (negotiatedProtocolVersion && method !== 'initialize') {
|
|
56
47
|
headers['Mcp-Protocol-Version'] = negotiatedProtocolVersion;
|
|
57
48
|
}
|
|
@@ -86,7 +77,7 @@ async function initializeRemoteSession() {
|
|
|
86
77
|
capabilities: {},
|
|
87
78
|
clientInfo: {
|
|
88
79
|
name: 'pg-memory-stdio',
|
|
89
|
-
version: '3.
|
|
80
|
+
version: '3.3.0',
|
|
90
81
|
},
|
|
91
82
|
});
|
|
92
83
|
if (typeof result === 'object' && result && 'protocolVersion' in result) {
|
|
@@ -100,7 +91,6 @@ async function initializeRemoteSession() {
|
|
|
100
91
|
* Create and start the stdio MCP server.
|
|
101
92
|
*/
|
|
102
93
|
async function main() {
|
|
103
|
-
const modeLabel = isFullMode ? 'full' : 'readonly';
|
|
104
94
|
// Initialize remote session first
|
|
105
95
|
try {
|
|
106
96
|
await initializeRemoteSession();
|
|
@@ -112,12 +102,39 @@ async function main() {
|
|
|
112
102
|
// Create local MCP server
|
|
113
103
|
const server = new McpServer({
|
|
114
104
|
name: 'pg-memory',
|
|
115
|
-
version: '3.
|
|
116
|
-
description:
|
|
105
|
+
version: '3.3.0',
|
|
106
|
+
description: 'PG-Memory personal knowledge base with AI-powered question handling',
|
|
117
107
|
});
|
|
118
108
|
// ============================================================
|
|
119
109
|
// CORE KNOWLEDGE TOOLS (available in all modes)
|
|
120
110
|
// ============================================================
|
|
111
|
+
// Tool 0: __IMPORTANT - Workflow Instructions (pseudo-tool)
|
|
112
|
+
server.tool('__IMPORTANT', `3-LAYER WORKFLOW FOR QUESTION ANSWERING (ALWAYS FOLLOW):
|
|
113
|
+
|
|
114
|
+
1. search_knowledge(query) → Get lightweight index with IDs (~50 tokens/result)
|
|
115
|
+
- Searches articles in knowledge base
|
|
116
|
+
- Returns: id, title, similarity, date
|
|
117
|
+
- DO NOT fetch full content yet
|
|
118
|
+
|
|
119
|
+
2. get_content(id) → Fetch full content for filtered IDs only
|
|
120
|
+
- Only fetch what you need after reviewing search results
|
|
121
|
+
- Saves 10x tokens vs fetching all results
|
|
122
|
+
|
|
123
|
+
3. smart_log_gap(question, context?) → Log unanswered questions
|
|
124
|
+
- AI evaluates quality, deduplicates, suggests existing answers
|
|
125
|
+
- Returns: {action: 'logged' | 'duplicate' | 'answered' | 'rejected'}
|
|
126
|
+
- NEVER log without searching first
|
|
127
|
+
|
|
128
|
+
CRITICAL RULES:
|
|
129
|
+
- NEVER fetch full content before reviewing search results
|
|
130
|
+
- NEVER log gaps without searching first
|
|
131
|
+
- ALWAYS check for duplicates using similarity`, {}, async () => {
|
|
132
|
+
const result = await callRemoteServer('tools/call', {
|
|
133
|
+
name: '__IMPORTANT',
|
|
134
|
+
arguments: {},
|
|
135
|
+
});
|
|
136
|
+
return result;
|
|
137
|
+
});
|
|
121
138
|
// Tool 1: Search Knowledge
|
|
122
139
|
server.tool('search_knowledge', `Search the knowledge base using semantic similarity.
|
|
123
140
|
|
|
@@ -138,10 +155,8 @@ Use get_content with the ID to retrieve full content.`, {
|
|
|
138
155
|
// Tool 2: Get Content
|
|
139
156
|
server.tool('get_content', `Retrieve complete article content from the knowledge base by ID.
|
|
140
157
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
max_length: z.number().optional().describe('Max content length in chars (truncates if exceeded)'),
|
|
144
|
-
summary_only: z.boolean().optional().describe('Return only summary/metadata (default: false)'),
|
|
158
|
+
Call this after reviewing search_knowledge results to fetch full content only for relevant articles.`, {
|
|
159
|
+
id: z.string().describe('Article ID from search results (e.g., art_abc123)'),
|
|
145
160
|
}, async (args) => {
|
|
146
161
|
const result = await callRemoteServer('tools/call', {
|
|
147
162
|
name: 'get_content',
|
|
@@ -149,16 +164,28 @@ Use summary_only=true first to check content size, then fetch with max_length if
|
|
|
149
164
|
});
|
|
150
165
|
return result;
|
|
151
166
|
});
|
|
152
|
-
// Tool 3: Log
|
|
153
|
-
server.tool('
|
|
167
|
+
// Tool 3: Smart Log Gap - AI-evaluated gap logging
|
|
168
|
+
server.tool('smart_log_gap', `Step 3: Log unanswered question with AI evaluation.
|
|
169
|
+
|
|
170
|
+
SMART BEHAVIORS:
|
|
171
|
+
- Checks for similar existing gaps (>85% = returns duplicate)
|
|
172
|
+
- Checks for matching articles (>70% = suggests existing answer)
|
|
173
|
+
- AI evaluates quality (filters garbage/spam)
|
|
174
|
+
- Auto-assigns priority based on urgency signals
|
|
175
|
+
|
|
176
|
+
ALWAYS search first before calling this. Do not log without searching.
|
|
154
177
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
178
|
+
Returns one of:
|
|
179
|
+
- {action: 'logged', gapId, priority, quality} - Question logged
|
|
180
|
+
- {action: 'duplicate', existingGapId, similarity} - Duplicate detected
|
|
181
|
+
- {action: 'answered', articleId, title, similarity} - Already answered
|
|
182
|
+
- {action: 'rejected', reason, quality} - Spam/garbage filtered`, {
|
|
183
|
+
question: z.string().describe('The unanswered question'),
|
|
184
|
+
context: z.string().optional().describe('Additional context (email subject, sender, etc)'),
|
|
185
|
+
source: z.enum(['mcp', 'email', 'chat']).optional().describe('Question source (default: mcp)'),
|
|
159
186
|
}, async (args) => {
|
|
160
187
|
const result = await callRemoteServer('tools/call', {
|
|
161
|
-
name: '
|
|
188
|
+
name: 'smart_log_gap',
|
|
162
189
|
arguments: args,
|
|
163
190
|
});
|
|
164
191
|
return result;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pragmatic-growth/memory-mcp",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Stdio proxy for PG-Memory - connects stdio-based MCP clients (Claude Desktop, Raycast) to your PG-Memory HTTP server using Clerk API key authentication. Personal knowledge base with
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "Stdio proxy for PG-Memory - connects stdio-based MCP clients (Claude Desktop, Raycast) to your PG-Memory HTTP server using Clerk API key authentication. Personal knowledge base with 7 focused tools including AI-powered question handling with smart deduplication and quality filtering.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"memory-mcp": "dist/index.js"
|