rag-memory-epf-mcp 1.8.0 → 2.0.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 +125 -161
- package/dist/index.js +197 -145
- package/dist/index.js.map +1 -1
- package/dist/rag-memory.db +0 -0
- package/dist/src/migrations/migrations.d.ts.map +1 -1
- package/dist/src/migrations/migrations.js +35 -0
- package/dist/src/migrations/migrations.js.map +1 -1
- package/dist/src/tools/graph-query-tools.d.ts +2 -0
- package/dist/src/tools/graph-query-tools.d.ts.map +1 -1
- package/dist/src/tools/graph-query-tools.js +88 -0
- package/dist/src/tools/graph-query-tools.js.map +1 -1
- package/dist/src/tools/tool-registry.d.ts +1 -0
- package/dist/src/tools/tool-registry.d.ts.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -5,38 +5,19 @@
|
|
|
5
5
|
[](https://github.com/heesongkoh/rag-memory-epf-mcp/blob/main/LICENSE)
|
|
6
6
|
[](https://github.com/heesongkoh/rag-memory-epf-mcp)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A **project-local RAG memory** MCP server — knowledge graph + multilingual vector search + FTS5 full-text search, all in a single SQLite file per project.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Key Features
|
|
11
11
|
|
|
12
|
-
**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| **Embedding Model** | all-MiniLM-L12-v2 | **Qwen3-Embedding-0.6B** |
|
|
19
|
-
| **Dimensions** | 384 | **1024** |
|
|
20
|
-
| **Languages** | English only | **100+ (Korean, Chinese, Japanese, Arabic, etc.)** |
|
|
21
|
-
| **MTEB Score** | ~49 | **63.0+** |
|
|
22
|
-
| **Max Tokens** | 256 | **8192** |
|
|
23
|
-
| **Unicode Support** | ASCII only fallback | **Full Unicode (CJK, Arabic, Cyrillic, etc.)** |
|
|
24
|
-
| **Auto Entity Linking** | None | **Chunk-level with word boundary + CJK support** |
|
|
12
|
+
- **Project-local isolation** — each project gets its own `.memory/rag-memory.db`. Multiple projects run simultaneously without interference.
|
|
13
|
+
- **3-signal hybrid search** — vector similarity (Qwen3-Embedding-0.6B, 1024-dim) + FTS5 BM25 keyword matching + knowledge graph re-ranking, combined via Reciprocal Rank Fusion
|
|
14
|
+
- **100+ languages** — Korean, Chinese, Japanese, Arabic, and more. Cross-lingual search works out of the box.
|
|
15
|
+
- **27 MCP tools** — entity/relation CRUD, document pipeline, multi-hop graph traversal, export/import, temporal queries
|
|
16
|
+
- **SQLite optimized** — WAL mode, 32MB cache, 256MB mmap, FTS5 triggers, 7 indexes
|
|
17
|
+
- **MCP SDK 1.27.1** — Tool Annotations (readOnly/destructive/idempotent), latest protocol 2025-11-25
|
|
25
18
|
|
|
26
19
|
## Quick Start
|
|
27
20
|
|
|
28
|
-
```json
|
|
29
|
-
{
|
|
30
|
-
"mcpServers": {
|
|
31
|
-
"rag-memory": {
|
|
32
|
-
"command": "npx",
|
|
33
|
-
"args": ["-y", "rag-memory-epf-mcp@latest"]
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
**Project-local memory (recommended):**
|
|
40
21
|
```json
|
|
41
22
|
{
|
|
42
23
|
"mcpServers": {
|
|
@@ -51,154 +32,137 @@ An advanced MCP server for **project-local RAG memory** through a knowledge grap
|
|
|
51
32
|
}
|
|
52
33
|
```
|
|
53
34
|
|
|
54
|
-
Place this `.mcp.json` in each project folder with its own `DB_FILE_PATH`. Each project maintains completely isolated memory
|
|
35
|
+
Place this `.mcp.json` in each project folder with its own `DB_FILE_PATH`. Each project maintains completely isolated memory.
|
|
36
|
+
|
|
37
|
+
## Tools (27)
|
|
38
|
+
|
|
39
|
+
### Knowledge Graph (7)
|
|
40
|
+
| Tool | Description | Annotation |
|
|
41
|
+
|------|------------|------------|
|
|
42
|
+
| `createEntities` | Create entities with observations and types (upsert) | idempotent |
|
|
43
|
+
| `createRelations` | Establish relationships between entities | idempotent |
|
|
44
|
+
| `addObservations` | Add contextual information to entities (dedup) | idempotent |
|
|
45
|
+
| `updateRelations` | Update relationship confidence and metadata | idempotent |
|
|
46
|
+
| `deleteEntities` | Remove entities and relationships | destructive |
|
|
47
|
+
| `deleteRelations` | Remove specific relationships | destructive |
|
|
48
|
+
| `deleteObservations` | Remove specific observations | destructive |
|
|
49
|
+
|
|
50
|
+
### Document Pipeline (8)
|
|
51
|
+
| Tool | Description | Annotation |
|
|
52
|
+
|------|------------|------------|
|
|
53
|
+
| `storeDocument` | Store documents with metadata | idempotent |
|
|
54
|
+
| `chunkDocument` | Create text chunks with configurable parameters | — |
|
|
55
|
+
| `embedChunks` | Generate 1024-dim embeddings + auto-link entities | idempotent |
|
|
56
|
+
| `embedAllEntities` | Batch embed all entities (32 parallel) | idempotent |
|
|
57
|
+
| `extractTerms` | Extract potential entity terms | — |
|
|
58
|
+
| `linkEntitiesToDocument` | Manually link entities to document chunks | idempotent |
|
|
59
|
+
| `deleteDocuments` | Remove documents and associated data | destructive |
|
|
60
|
+
| `listDocuments` | View all stored documents | readOnly |
|
|
61
|
+
|
|
62
|
+
### Search & Retrieval (9)
|
|
63
|
+
| Tool | Description | Annotation |
|
|
64
|
+
|------|------------|------------|
|
|
65
|
+
| `hybridSearch` | Vector + FTS5 BM25 + graph traversal (3-signal) | readOnly |
|
|
66
|
+
| `searchNodes` | Semantic entity search with `since`/`until` temporal filtering | readOnly |
|
|
67
|
+
| `openNodes` | Retrieve specific entities by name | readOnly |
|
|
68
|
+
| `readGraph` | Get complete knowledge graph | readOnly |
|
|
69
|
+
| `getNeighbors` | Multi-hop graph traversal (depth 1-5, cycle detection) | readOnly |
|
|
70
|
+
| `getDetailedContext` | Get full context for a chunk | readOnly |
|
|
71
|
+
| `exportGraph` | Export full graph as JSON (backup) | readOnly |
|
|
72
|
+
| `importGraph` | Import graph from JSON (merge or replace) | destructive |
|
|
73
|
+
| `getKnowledgeGraphStats` | Knowledge base statistics | readOnly |
|
|
74
|
+
|
|
75
|
+
### Migration (3)
|
|
76
|
+
| Tool | Description | Annotation |
|
|
77
|
+
|------|------------|------------|
|
|
78
|
+
| `getMigrationStatus` | Check database schema version | readOnly |
|
|
79
|
+
| `runMigrations` | Apply pending migrations | idempotent |
|
|
80
|
+
| `rollbackMigration` | Revert to a previous schema version | destructive |
|
|
55
81
|
|
|
56
82
|
## Document Processing Pipeline
|
|
57
83
|
|
|
58
|
-
`embedChunks` automatically links entities to the specific chunks where they appear:
|
|
59
|
-
|
|
60
84
|
```
|
|
61
85
|
storeDocument(id, content, metadata)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|-- auto-links entities to chunks where they appear (chunk-level precision)
|
|
68
|
-
+-- returns { embeddedChunks, linkedEntities }
|
|
69
|
-
|
|
70
|
-
linkEntitiesToDocument(documentId, entityNames)
|
|
71
|
-
+-- [optional] manually link additional entities that auto-linking missed
|
|
86
|
+
→ chunkDocument(documentId, maxTokens, overlap)
|
|
87
|
+
→ embedChunks(documentId)
|
|
88
|
+
├── generates vector embeddings for each chunk
|
|
89
|
+
├── auto-links entities to chunks (word boundary + CJK aware)
|
|
90
|
+
└── returns { embeddedChunks, linkedEntities }
|
|
72
91
|
```
|
|
73
92
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
##
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- `extractTerms`: Extract potential entity terms
|
|
109
|
-
- `linkEntitiesToDocument`: Manually create entity-document associations
|
|
110
|
-
- `deleteDocuments`: Remove documents and associated data
|
|
111
|
-
- `listDocuments`: View all stored documents
|
|
112
|
-
|
|
113
|
-
### Knowledge Graph
|
|
114
|
-
- `createEntities`: Create entities with observations and types
|
|
115
|
-
- `createRelations`: Establish relationships between entities
|
|
116
|
-
- `addObservations`: Add contextual information to entities
|
|
117
|
-
- `updateRelations`: Update relationship confidence and metadata
|
|
118
|
-
- `deleteEntities`: Remove entities and relationships
|
|
119
|
-
- `deleteRelations`: Remove specific relationships
|
|
120
|
-
- `deleteObservations`: Remove specific observations
|
|
121
|
-
- `embedAllEntities`: Generate embeddings for all entities (batch 32 parallel)
|
|
122
|
-
|
|
123
|
-
### Search & Retrieval
|
|
124
|
-
- `hybridSearch`: Vector + FTS5 BM25 + graph traversal (3-signal hybrid)
|
|
125
|
-
- `searchNodes`: Semantic entity search (multilingual, with since/until temporal filtering)
|
|
126
|
-
- `openNodes`: Retrieve specific entities
|
|
127
|
-
- `readGraph`: Get complete knowledge graph
|
|
128
|
-
- `getDetailedContext`: Get full context for a chunk
|
|
129
|
-
|
|
130
|
-
### Backup & Migration
|
|
131
|
-
- `exportGraph`: Export full knowledge graph as JSON (entities, relations, documents)
|
|
132
|
-
- `importGraph`: Import knowledge graph from JSON (merge or replace mode)
|
|
133
|
-
- `getKnowledgeGraphStats`: Knowledge base statistics
|
|
134
|
-
- `getMigrationStatus`: Check database schema version
|
|
135
|
-
- `runMigrations`: Apply pending migrations
|
|
136
|
-
- `rollbackMigration`: Revert to a previous schema version
|
|
93
|
+
## Architecture
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
┌─────────────────────────────────────────────┐
|
|
97
|
+
│ MCP Client (Claude Code, Gemini CLI, etc) │
|
|
98
|
+
└──────────────────┬──────────────────────────┘
|
|
99
|
+
│ stdio (MCP SDK 1.27.1)
|
|
100
|
+
┌──────────────────▼──────────────────────────┐
|
|
101
|
+
│ rag-memory-epf-mcp │
|
|
102
|
+
│ ┌────────────┐ ┌─────────────┐ ┌────────┐ │
|
|
103
|
+
│ │ Knowledge │ │ RAG Document│ │ Search │ │
|
|
104
|
+
│ │ Graph CRUD │ │ Pipeline │ │ Engine │ │
|
|
105
|
+
│ └─────┬──────┘ └──────┬──────┘ └───┬────┘ │
|
|
106
|
+
│ │ │ │ │
|
|
107
|
+
│ ┌─────▼───────────────▼────────────▼─────┐ │
|
|
108
|
+
│ │ SQLite (WAL mode, per-project file) │ │
|
|
109
|
+
│ │ ├── entities + relationships │ │
|
|
110
|
+
│ │ ├── documents + chunk_metadata │ │
|
|
111
|
+
│ │ ├── chunks (sqlite-vec, 1024-dim) │ │
|
|
112
|
+
│ │ ├── entity_embeddings (sqlite-vec) │ │
|
|
113
|
+
│ │ ├── entities_fts + chunks_fts (FTS5) │ │
|
|
114
|
+
│ │ └── 7 migrations (auto-applied) │ │
|
|
115
|
+
│ └────────────────────────────────────────┘ │
|
|
116
|
+
│ │
|
|
117
|
+
│ Qwen3-Embedding-0.6B (ONNX, 100+ langs) │
|
|
118
|
+
└──────────────────────────────────────────────┘
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Environment Variables
|
|
122
|
+
|
|
123
|
+
| Variable | Default | Description |
|
|
124
|
+
|----------|---------|-------------|
|
|
125
|
+
| `DB_FILE_PATH` | `rag-memory.db` (server dir) | Path to project-local SQLite database |
|
|
126
|
+
| `EMBEDDING_MODEL` | `onnx-community/Qwen3-Embedding-0.6B-ONNX` | HuggingFace model ID for embeddings |
|
|
137
127
|
|
|
138
128
|
## Changelog
|
|
139
129
|
|
|
140
|
-
### v1.
|
|
130
|
+
### v1.9.0
|
|
131
|
+
- **Multi-hop graph traversal** — `getNeighbors` tool with `WITH RECURSIVE` CTE, depth 1-5, cycle detection, bidirectional
|
|
132
|
+
- **Embedding LRU cache** — 500-entry in-memory cache, skips redundant re-computation
|
|
133
|
+
- **Configurable model** — `EMBEDDING_MODEL` env var to use alternative embedding models
|
|
134
|
+
- 27 tools total
|
|
135
|
+
|
|
136
|
+
### v1.8.0
|
|
137
|
+
- **MCP SDK 1.27.1** — protocol 2025-11-25, security fix GHSA-345p-7cg4-v4c7 (CVSS 7.1)
|
|
138
|
+
- **Tool Annotations** — all 27 tools annotated (readOnlyHint, destructiveHint, idempotentHint)
|
|
139
|
+
- **SIGTERM graceful shutdown** — clean exit without ONNX mutex crash
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
- **
|
|
145
|
-
- **
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
141
|
+
### v1.7.0
|
|
142
|
+
- **SQLite optimization** — WAL mode, 32MB cache, 256MB mmap, busy_timeout
|
|
143
|
+
- **FTS5 full-text search** — BM25 keyword matching + Reciprocal Rank Fusion with vector search
|
|
144
|
+
- **updateRelations** — update confidence scores and metadata without delete+recreate
|
|
145
|
+
- **exportGraph / importGraph** — JSON backup and restore (merge or replace)
|
|
146
|
+
- **Batch embedding** — `embedAllEntities` processes 32 entities in parallel
|
|
147
|
+
- **Temporal filtering** — `searchNodes` with `since`/`until` ISO 8601 date filters
|
|
148
148
|
- **better-sqlite3 12.x** — SQLite 3.51.3 with query planner improvements
|
|
149
149
|
- **sqlite-vec 0.1.7** — DELETE space reclaim, KNN distance constraints
|
|
150
|
-
- **
|
|
151
|
-
- **SQL safety** — `safeRowid()` validation for vec0
|
|
150
|
+
- **DB indexes** — entityType, relationType, chunk lookups
|
|
151
|
+
- **SQL safety** — `safeRowid()` validation for vec0 operations
|
|
152
152
|
|
|
153
153
|
### v1.6.0
|
|
154
|
-
|
|
155
|
-
- **
|
|
156
|
-
- **
|
|
157
|
-
- **Dedup by content** — date prefixes are stripped when comparing observations to prevent duplicate entries with different dates.
|
|
154
|
+
- **Entity upsert** — merges new observations into existing entities instead of ignoring duplicates
|
|
155
|
+
- **Observation timestamps** — auto `[YYYY-MM-DD]` prefix for staleness tracking
|
|
156
|
+
- **Dedup by content** — date-stripped comparison prevents duplicate observations
|
|
158
157
|
|
|
159
158
|
### v1.5.0
|
|
159
|
+
- **Chunk-level entity linking** — precision linking to specific chunks, not all chunks
|
|
160
|
+
- **Word boundary + CJK matching** — Latin word boundaries, CJK substring matching
|
|
161
|
+
- **Observation-derived aliases** — file paths from observations matched against chunks
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
- **Observation-derived aliases** — file paths from entity observations are matched against chunk text
|
|
165
|
-
- **README overhaul** — added pipeline diagram, auto-linking docs, changelog section
|
|
166
|
-
|
|
167
|
-
### v1.4.2
|
|
168
|
-
|
|
169
|
-
- fp16 quantization for embeddings
|
|
170
|
-
- Auto-link entities after `embedChunks` (document-level, basic substring match)
|
|
171
|
-
|
|
172
|
-
### v1.4.1
|
|
173
|
-
|
|
174
|
-
- Qwen3 instruction prefix optimization
|
|
175
|
-
- Entity embedding text format improvements
|
|
176
|
-
|
|
177
|
-
### v1.4.0
|
|
178
|
-
|
|
179
|
-
- Switched embedding model to **Qwen3-Embedding-0.6B** (1024-dim, 100+ languages)
|
|
180
|
-
- Replaced BGE-M3 for better multilingual performance
|
|
181
|
-
|
|
182
|
-
### v1.3.x
|
|
183
|
-
|
|
184
|
-
- Cross-lingual graph boost via entity vector search
|
|
185
|
-
- Korean + acronym + partial matching improvements
|
|
186
|
-
- Unicode/Korean fallback embedding fixes
|
|
187
|
-
|
|
188
|
-
### v1.2.x
|
|
189
|
-
|
|
190
|
-
- jina-v5-nano embedding model (768-dim)
|
|
191
|
-
- Initial multilingual support
|
|
192
|
-
|
|
193
|
-
### v1.0.0
|
|
194
|
-
|
|
195
|
-
- Initial fork from rag-memory-mcp
|
|
196
|
-
- BGE-M3 embedding model (1024-dim)
|
|
197
|
-
- sqlite-vec vector search
|
|
198
|
-
|
|
199
|
-
## Environment Variables
|
|
200
|
-
|
|
201
|
-
- `DB_FILE_PATH`: Path to the SQLite database file (default: `rag-memory.db` in the server directory)
|
|
163
|
+
### v1.4.x
|
|
164
|
+
- Switched to **Qwen3-Embedding-0.6B** (1024-dim, 100+ languages, MTEB 63.0+)
|
|
165
|
+
- fp16 quantization, instruction prefix optimization
|
|
202
166
|
|
|
203
167
|
## Development
|
|
204
168
|
|
|
@@ -211,17 +175,17 @@ npm run build
|
|
|
211
175
|
|
|
212
176
|
## License
|
|
213
177
|
|
|
214
|
-
|
|
178
|
+
MIT License. See [LICENSE](LICENSE).
|
|
215
179
|
|
|
216
180
|
### Third-Party Model Licenses
|
|
217
181
|
|
|
218
182
|
| Component | License | Details |
|
|
219
183
|
|-----------|---------|---------|
|
|
220
|
-
| **Qwen3-Embedding-0.6B** | Apache 2.0 |
|
|
184
|
+
| **Qwen3-Embedding-0.6B** | Apache 2.0 | [Model card](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) |
|
|
221
185
|
| **@huggingface/transformers** | Apache 2.0 | JS inference runtime |
|
|
222
186
|
|
|
223
|
-
|
|
187
|
+
Model weights are downloaded at runtime and not bundled in this package.
|
|
224
188
|
|
|
225
189
|
---
|
|
226
190
|
|
|
227
|
-
**Built with**: TypeScript, SQLite
|
|
191
|
+
**Built with**: TypeScript, SQLite (WAL + FTS5 + sqlite-vec), Qwen3-Embedding-0.6B, MCP SDK 1.27.1
|