Local Vector Store
by @jackfeng0614-prog
Implements semantic search using local vector embeddings for knowledge base indexing and similarity matching. Use when you need to search documents by meanin...
const vectorStore = require('./local-vector-store');// Initialize store
const store = await vectorStore.create({
dimension: 384,
storePath: '/tmp/vector-store'
});
// Index documents
await store.index({
id: 'doc1',
content: 'Machine learning is a subset of artificial intelligence',
metadata: { source: 'wiki' }
});
// Search by semantic similarity
const results = await store.search({
query: 'AI and deep learning',
topK: 5,
threshold: 0.7
});
// Batch operations
await store.indexBatch([
{ id: 'doc2', content: 'Neural networks process data' },
{ id: 'doc3', content: 'Algorithms solve computational problems' }
]);
Set environment variables:
VECTOR_DIMENSION: Embedding dimension (default: 384)STORE_PATH: Local storage directory (default: /tmp/vector-store)SIMILARITY_THRESHOLD: Minimum similarity score (default: 0.5)clawhub install local-vector-store