rag-memory-epf-mcp 3.2.0 → 3.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/README.md CHANGED
@@ -12,6 +12,7 @@ A **project-local RAG memory** MCP server — knowledge graph + multilingual vec
12
12
  - **Project-local isolation** — each project gets its own `.memory/rag-memory.db`. Multiple projects run simultaneously without interference.
13
13
  - **3-signal hybrid search** — vector similarity (bge-m3, 1024-dim) + FTS5 BM25 keyword matching + knowledge graph re-ranking, combined via Reciprocal Rank Fusion
14
14
  - **100+ languages** — Korean, Chinese, Japanese, Arabic, and more. Cross-lingual search works out of the box.
15
+ - **Graph-aware scoring** — per-entity geometric decay (0.5^i) with hard cap prevents any single document from dominating results
15
16
  - **27 MCP tools** — entity/relation CRUD, document pipeline, multi-hop graph traversal, export/import, temporal queries
16
17
  - **SQLite optimized** — WAL mode, 32MB cache, 256MB mmap, FTS5 triggers, 7 indexes
17
18
  - **MCP SDK 1.27.1** — Tool Annotations (readOnly/destructive/idempotent), latest protocol 2025-11-25
@@ -55,7 +56,7 @@ Place this `.mcp.json` in each project folder with its own `DB_FILE_PATH`. Each
55
56
  | `embedChunks` | Generate 1024-dim embeddings + auto-link entities | idempotent |
56
57
  | `embedAllEntities` | Batch embed all entities (32 parallel) | idempotent |
57
58
  | `extractTerms` | Extract potential entity terms | — |
58
- | `linkEntitiesToDocument` | Manually link entities to document chunks | idempotent |
59
+ | `linkEntitiesToDocument` | Link entities to chunks where they actually appear (text-matched) | idempotent |
59
60
  | `deleteDocuments` | Remove documents and associated data | destructive |
60
61
  | `listDocuments` | View all stored documents | readOnly |
61
62
 
@@ -127,6 +128,10 @@ storeDocument(id, content, metadata)
127
128
 
128
129
  ## Changelog
129
130
 
131
+ ### v3.2.0
132
+ - **Chunk-level entity linking in `linkEntitiesToDocument`** — entities are now linked only to chunks where they actually appear (using `buildEntityMatcher` word-boundary/CJK matching), instead of blanket-linking to all chunks. Fixes search result domination by heavily-linked documents.
133
+ - **Graph boost decay + hard cap** — per-entity scores are sorted descending and decayed geometrically (0.5^i): 1st entity 100%, 2nd 50%, 3rd 25%, etc. Hard cap at 0.4 prevents graph signal from overwhelming vector similarity.
134
+
130
135
  ### v3.0.0
131
136
  - **Back to self-contained embeddings** — reverted from Ollama dependency (v2.x) to built-in `@huggingface/transformers` with bge-m3 (1024-dim). No external services required.
132
137
  - **Cross-lingual search** — auto-detects non-English queries and performs dual-language search
package/dist/index.js CHANGED
@@ -1264,11 +1264,7 @@ class RAGKnowledgeGraphManager {
1264
1264
  if (chunks.length === 0)
1265
1265
  return 0;
1266
1266
  // Get all entities with observations for richer matching
1267
- const entities = this.db.prepare(`SELECT e.id, e.name, e.entityType,
1268
- GROUP_CONCAT(o.content, ' ||| ') as observations
1269
- FROM entities e
1270
- LEFT JOIN observations o ON o.entityId = e.id
1271
- GROUP BY e.id`).all();
1267
+ const entities = this.db.prepare(`SELECT id, name, entityType, observations FROM entities`).all();
1272
1268
  // Minimum name length: 2 for CJK (e.g. "할랄"), 4 for Latin (avoid "API", "Bug")
1273
1269
  const MIN_LEN_CJK = 2;
1274
1270
  const MIN_LEN_LATIN = 4;
@@ -1284,7 +1280,13 @@ class RAGKnowledgeGraphManager {
1284
1280
  // Also collect observation-derived aliases (short keywords from observations)
1285
1281
  const aliases = [];
1286
1282
  if (entity.observations) {
1287
- const obs = entity.observations.split(' ||| ');
1283
+ let obs;
1284
+ try {
1285
+ obs = JSON.parse(entity.observations);
1286
+ }
1287
+ catch {
1288
+ obs = [];
1289
+ }
1288
1290
  for (const ob of obs) {
1289
1291
  // Extract file paths or identifiers mentioned in observations (e.g. "gemini_converter.py")
1290
1292
  const pathMatch = ob.match(/[\w\-]+\.\w{1,4}\b/g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rag-memory-epf-mcp",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "MCP server for project-local RAG memory with knowledge graph and multilingual vector search",
5
5
  "license": "MIT",
6
6
  "author": "bripin123",