rag-memory-pg-mcp 2.1.1 → 2.2.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/.github/workflows/security-check.yml +1 -1
- package/CHANGELOG.md +32 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/handlers.js +2 -1
- package/src/index.js +1 -1
- package/src/manager.js +25 -3
- package/src/tool-modes.js +1 -1
- package/src/tools.js +7 -7
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
echo "🔍 Scanning for potential secrets..."
|
|
24
24
|
|
|
25
25
|
# Check for API keys
|
|
26
|
-
if grep -
|
|
26
|
+
if grep -rE "(sk-proj-[A-Za-z0-9]{20,}|sk-[A-Za-z0-9]{20,})" --exclude-dir=node_modules --exclude-dir=.git . ; then
|
|
27
27
|
echo "❌ Found OpenAI API key!"
|
|
28
28
|
exit 1
|
|
29
29
|
fi
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.2.1] - 2026-01-08
|
|
9
|
+
|
|
10
|
+
### Fixed 🐛
|
|
11
|
+
- **hybridSearch syntax error** - queries with spaces/special characters no longer fail
|
|
12
|
+
- **getDetailedContext syntax error** - same fix applied
|
|
13
|
+
- Root cause: `textSearch()` used `to_tsquery()` which requires special syntax (`'word1' & 'word2'`)
|
|
14
|
+
- Solution: Added `type: 'websearch'` option to use `websearch_to_tsquery()` instead
|
|
15
|
+
|
|
16
|
+
### Improved
|
|
17
|
+
- hybridSearch now supports advanced query syntax:
|
|
18
|
+
- Plain text: `authentication jwt` (AND search)
|
|
19
|
+
- Exact phrases: `"user authentication"`
|
|
20
|
+
- OR operator: `auth OR login`
|
|
21
|
+
- Negation: `react -native`
|
|
22
|
+
|
|
23
|
+
## [2.2.0] - 2026-01-05
|
|
24
|
+
|
|
25
|
+
### Breaking Changes 🔴
|
|
26
|
+
- **Renamed `readGraph` → `getGraph`** due to Cursor API conflict
|
|
27
|
+
- The `readGraph` name was causing the tool to be ignored/blocked by Cursor
|
|
28
|
+
- Handler supports both names for backward compatibility
|
|
29
|
+
|
|
30
|
+
### Fixed 🐛
|
|
31
|
+
- **Tool loading in CLIENT mode** - now correctly shows 10 tools (was showing 9)
|
|
32
|
+
- Root cause: `readGraph` conflicted with Cursor internal API
|
|
33
|
+
- Solution: Renamed to `getGraph` - all tools now load properly
|
|
34
|
+
|
|
35
|
+
### Technical Details
|
|
36
|
+
- Debug analysis showed server was sending 10 tools correctly
|
|
37
|
+
- Cursor was blocking/ignoring the `readGraph` tool during registration
|
|
38
|
+
- Tool name conflict resolved by renaming
|
|
39
|
+
|
|
8
40
|
## [2.1.1] - 2026-01-05
|
|
9
41
|
|
|
10
42
|
### Added ✨
|
package/README.md
CHANGED
|
@@ -196,7 +196,7 @@ npm install -g github:kshidenko/rag-memory-pg-mcp
|
|
|
196
196
|
- Knowledge Graph: createEntities, createRelations, addObservations, searchNodes, openNodes
|
|
197
197
|
- Documents: processDocument (⭐ main tool)
|
|
198
198
|
- Search: hybridSearch, getDetailedContext
|
|
199
|
-
- Info:
|
|
199
|
+
- Info: getGraph, getKnowledgeGraphStats
|
|
200
200
|
|
|
201
201
|
**MAINTENANCE mode (11 tools) - For cleanup and admin:**
|
|
202
202
|
- Cleanup: deleteEntities, deleteRelations, deleteObservations, deleteDocuments
|
package/package.json
CHANGED
package/src/handlers.js
CHANGED
|
@@ -102,7 +102,8 @@ async function executeToolMethod(name, args, manager) {
|
|
|
102
102
|
includeEntities: args.includeEntities,
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
case '
|
|
105
|
+
case 'getGraph':
|
|
106
|
+
case 'readGraph': // Backward compatibility
|
|
106
107
|
return manager.readGraph();
|
|
107
108
|
|
|
108
109
|
// ==================== UTILITIES ====================
|
package/src/index.js
CHANGED
|
@@ -62,7 +62,7 @@ console.error(`📊 Active tools: ${activeTools.length}/${allTools.length}`);
|
|
|
62
62
|
const server = new Server(
|
|
63
63
|
{
|
|
64
64
|
name: 'rag-memory-pg',
|
|
65
|
-
version: '2.
|
|
65
|
+
version: '2.2.0',
|
|
66
66
|
description: 'RAG-enabled memory with PostgreSQL/Supabase backend. Provides knowledge graph, document management, and semantic search. All content should be in English for optimal performance.',
|
|
67
67
|
instructions: `This is a RAG (Retrieval-Augmented Generation) memory system with knowledge graph capabilities.
|
|
68
68
|
|
package/src/manager.js
CHANGED
|
@@ -736,15 +736,34 @@ export class RAGKnowledgeGraphManager {
|
|
|
736
736
|
/**
|
|
737
737
|
* Hybrid search (semantic + text)
|
|
738
738
|
*
|
|
739
|
-
*
|
|
739
|
+
* Uses websearch_to_tsquery for safe query parsing that handles:
|
|
740
|
+
* - Plain text with spaces
|
|
741
|
+
* - Quoted phrases ("exact match")
|
|
742
|
+
* - OR operator
|
|
743
|
+
* - Negation with -
|
|
744
|
+
*
|
|
745
|
+
* @param {string} query - Search query (plain text or websearch syntax)
|
|
740
746
|
* @param {number} limit - Max results
|
|
741
747
|
* @returns {object[]} Search results
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* // Simple search
|
|
751
|
+
* hybridSearch('authentication jwt')
|
|
752
|
+
*
|
|
753
|
+
* // Phrase search
|
|
754
|
+
* hybridSearch('"user authentication"')
|
|
755
|
+
*
|
|
756
|
+
* // With OR
|
|
757
|
+
* hybridSearch('auth OR login')
|
|
742
758
|
*/
|
|
743
759
|
async hybridSearch(query, limit = 5) {
|
|
744
760
|
const { data, error } = await this.supabase
|
|
745
761
|
.from('rag_documents')
|
|
746
762
|
.select('id, content, metadata, created_at')
|
|
747
|
-
.textSearch('content', query
|
|
763
|
+
.textSearch('content', query, {
|
|
764
|
+
type: 'websearch',
|
|
765
|
+
config: 'english'
|
|
766
|
+
})
|
|
748
767
|
.limit(limit);
|
|
749
768
|
|
|
750
769
|
if (error) throw new Error(error.message);
|
|
@@ -768,7 +787,10 @@ export class RAGKnowledgeGraphManager {
|
|
|
768
787
|
const { data: docs } = await this.supabase
|
|
769
788
|
.from('rag_documents')
|
|
770
789
|
.select('id, content, metadata')
|
|
771
|
-
.textSearch('content', query
|
|
790
|
+
.textSearch('content', query, {
|
|
791
|
+
type: 'websearch',
|
|
792
|
+
config: 'english'
|
|
793
|
+
})
|
|
772
794
|
.limit(limit);
|
|
773
795
|
|
|
774
796
|
if (docs) results.documents = docs;
|
package/src/tool-modes.js
CHANGED
|
@@ -27,7 +27,7 @@ export const TOOL_MODES = {
|
|
|
27
27
|
'getDetailedContext', // Get rich context with entities
|
|
28
28
|
|
|
29
29
|
// Utilities - Basic info
|
|
30
|
-
'
|
|
30
|
+
'getGraph', // View knowledge graph (renamed from readGraph)
|
|
31
31
|
'getKnowledgeGraphStats', // See statistics
|
|
32
32
|
],
|
|
33
33
|
|
package/src/tools.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @returns {object[]} Array of tool definitions
|
|
14
14
|
*/
|
|
15
15
|
export function getToolDefinitions() {
|
|
16
|
-
|
|
16
|
+
const tools = [
|
|
17
17
|
// ==================== ENTITY TOOLS ====================
|
|
18
18
|
{
|
|
19
19
|
name: 'createEntities',
|
|
@@ -297,7 +297,7 @@ export function getToolDefinitions() {
|
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
name: 'embedAllEntities',
|
|
300
|
-
description: 'Generate embeddings for all entities',
|
|
300
|
+
description: 'Generate embeddings for all entities in the knowledge graph. Use this to enable semantic search on entities or after adding many new entities. No parameters required.',
|
|
301
301
|
inputSchema: {
|
|
302
302
|
type: 'object',
|
|
303
303
|
properties: {},
|
|
@@ -349,23 +349,21 @@ export function getToolDefinitions() {
|
|
|
349
349
|
},
|
|
350
350
|
},
|
|
351
351
|
{
|
|
352
|
-
name: '
|
|
353
|
-
description: '
|
|
352
|
+
name: 'getGraph',
|
|
353
|
+
description: 'Get the entire knowledge graph with all entities, relationships, and observations. Use this to retrieve complete overview of stored knowledge. Returns full graph structure for analysis or visualization. No parameters required.',
|
|
354
354
|
inputSchema: {
|
|
355
355
|
type: 'object',
|
|
356
356
|
properties: {},
|
|
357
|
-
description: 'No parameters required. Returns complete graph with all entities and their connections.'
|
|
358
357
|
},
|
|
359
358
|
},
|
|
360
359
|
|
|
361
360
|
// ==================== UTILITY TOOLS ====================
|
|
362
361
|
{
|
|
363
362
|
name: 'getKnowledgeGraphStats',
|
|
364
|
-
description: 'Get statistics about the knowledge graph including total counts of entities, relationships, documents, and chunks. Use this to understand the size and scope of stored knowledge.',
|
|
363
|
+
description: 'Get statistics about the knowledge graph including total counts of entities, relationships, documents, and chunks. Use this to understand the size and scope of stored knowledge. Returns entity_count, relationship_count, document_count, chunk_count, and type distributions. No parameters required.',
|
|
365
364
|
inputSchema: {
|
|
366
365
|
type: 'object',
|
|
367
366
|
properties: {},
|
|
368
|
-
description: 'No parameters required. Returns entity_count, relationship_count, document_count, chunk_count, and type distributions.'
|
|
369
367
|
},
|
|
370
368
|
},
|
|
371
369
|
{
|
|
@@ -394,4 +392,6 @@ export function getToolDefinitions() {
|
|
|
394
392
|
},
|
|
395
393
|
},
|
|
396
394
|
];
|
|
395
|
+
|
|
396
|
+
return tools;
|
|
397
397
|
}
|