rag-memory-epf-mcp 3.1.2 → 3.1.4

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -78,20 +78,21 @@ class RAGKnowledgeGraphManager {
78
78
  // Configure environment to allow remote model downloads
79
79
  env.allowRemoteModels = true;
80
80
  env.allowLocalModels = true;
81
- this.embeddingModel = await pipeline('feature-extraction', EMBEDDING_MODEL, { revision: 'main' });
81
+ this.embeddingModel = await pipeline('feature-extraction', EMBEDDING_MODEL, { revision: 'main', dtype: 'fp16' });
82
82
  this.modelInitialized = true;
83
- console.error(`✅ ${EMBEDDING_MODEL} model loaded successfully (fp32)`);
83
+ console.error(`✅ ${EMBEDDING_MODEL} model loaded successfully (fp16)`);
84
84
  }
85
85
  catch (error) {
86
- console.error('❌ Failed to load embedding model (fp32):', error instanceof Error ? error.message : error);
87
- console.error('🔄 Retrying with fp16...');
86
+ console.error('❌ Failed to load embedding model (fp16):', error instanceof Error ? error.message : error);
87
+ const FALLBACK_MODEL = 'Xenova/all-MiniLM-L6-v2';
88
+ console.error(`🔄 Falling back to ${FALLBACK_MODEL}...`);
88
89
  try {
89
- this.embeddingModel = await pipeline('feature-extraction', EMBEDDING_MODEL, { revision: 'main', dtype: 'fp16' });
90
+ this.embeddingModel = await pipeline('feature-extraction', FALLBACK_MODEL, { revision: 'main' });
90
91
  this.modelInitialized = true;
91
- console.error(`✅ ${EMBEDDING_MODEL} model loaded successfully (fp16 fallback)`);
92
+ console.error(`✅ ${FALLBACK_MODEL} loaded (fallback — 384-dim, English-focused)`);
92
93
  }
93
94
  catch (retryError) {
94
- console.error('❌ Embedding model failed to load. Search will not work.', retryError instanceof Error ? retryError.message : retryError);
95
+ console.error('❌ All embedding models failed to load. Search will not work.', retryError instanceof Error ? retryError.message : retryError);
95
96
  this.modelInitialized = false;
96
97
  }
97
98
  }
@@ -1802,7 +1803,7 @@ class RAGKnowledgeGraphManager {
1802
1803
  const similarEntities = Array.from(entityMap.values()).sort((a, b) => a.distance - b.distance);
1803
1804
  for (const entity of similarEntities) {
1804
1805
  const similarity = Math.max(0, 1 - entity.distance / 2);
1805
- if (similarity > 0.5) {
1806
+ if (similarity > 0.4) {
1806
1807
  queryMatchedEntities.add(entity.name);
1807
1808
  // Get connected entities via relationships
1808
1809
  const connected = this.db.prepare(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rag-memory-epf-mcp",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
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",