Repository navigation
Expand file tree
/
Copy pathtest-dogfort.js
More file actions
61 lines (46 loc) · 2.08 KB
/
Copy pathtest-dogfort.js
File metadata and controls
61 lines (46 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env node
/**
* Direct test of dogfort query using both HTTP and STDIO paths
*/
import dotenv from 'dotenv';
dotenv.config();
import { initializeServices } from './src/mcp/lib/initialization.js';
async function testDogfort() {
console.log('🔍 Testing "dogfort" query directly...');
try {
const { memoryManager } = await initializeServices();
console.log('\n📊 Memory stats:');
console.log(`- FAISS index size: ${memoryManager.storage.vectors.getIndexSize()}`);
console.log(`- Target dimension: ${memoryManager.storage.getDimension()}`);
// Test the search directly
console.log('\n🔍 Searching for "dogfort"...');
// Generate embedding for "dogfort"
const queryEmbedding = await memoryManager.embeddingProvider.generateEmbedding('dogfort');
console.log(`🎯 Query embedding dimension: ${queryEmbedding.length}`);
// Search using storage directly
const results = await memoryManager.storage.search(queryEmbedding, 10, 0.3);
console.log(`📊 Found ${results.length} results`);
if (results.length > 0) {
console.log('\n✅ Results found:');
results.forEach((result, i) => {
console.log(`${i + 1}. Similarity: ${result.similarity?.toFixed(3)} - ${result.prompt?.substring(0, 100)}...`);
});
} else {
console.log('\n❌ No results found');
// Debug: Check what's in memory
console.log('\n🔍 Debugging memory contents...');
const shortTerm = memoryManager.storage.shortTermMemory || [];
console.log(`Short-term memory entries: ${shortTerm.length}`);
if (shortTerm.length > 0) {
console.log('Sample entries:');
shortTerm.slice(0, 3).forEach((entry, i) => {
console.log(`${i + 1}. ${entry.prompt?.substring(0, 100)}...`);
});
}
}
await memoryManager.dispose();
} catch (error) {
console.error('❌ Error:', error.message);
}
}
testDogfort();