feat: enable on-disk storage for Qdrant vectors and HNSW index

- Configure vectors with on_disk: true to reduce memory usage
- Configure HNSW index with on_disk: true for low memory footprint
- Improve precision with m=64 and ef_construct=512 parameters
- Increase hnsw_ef from 128 to 256 for better search precision
- Remove error throwing in deletePointsByMultipleFilePaths to prevent disruption
This commit is contained in:
daniel-lxs 2025-08-18 08:50:20 -05:00
parent a8aea14078
commit 4f3a4c56c4
No known key found for this signature in database
GPG key ID: 21C74479048B3AA6

View file

@ -155,6 +155,12 @@ export class QdrantVectorStore implements IVectorStore {
vectors: {
size: this.vectorSize,
distance: this.DISTANCE_METRIC,
on_disk: true, // Store vectors on disk for low memory usage
},
hnsw_config: {
m: 64, // Increased for better precision
ef_construct: 512, // Increased for better precision during index construction
on_disk: true, // Store HNSW index on disk for low memory usage
},
})
created = true
@ -244,6 +250,12 @@ export class QdrantVectorStore implements IVectorStore {
vectors: {
size: this.vectorSize,
distance: this.DISTANCE_METRIC,
on_disk: true, // Store vectors on disk for low memory usage
},
hnsw_config: {
m: 64, // Increased for better precision
ef_construct: 512, // Increased for better precision during index construction
on_disk: true, // Store HNSW index on disk for low memory usage
},
})
console.log(`[QdrantVectorStore] Successfully created new collection ${this.collectionName}`)
@ -404,7 +416,7 @@ export class QdrantVectorStore implements IVectorStore {
score_threshold: minScore ?? DEFAULT_SEARCH_MIN_SCORE,
limit: maxResults ?? DEFAULT_MAX_SEARCH_RESULTS,
params: {
hnsw_ef: 128,
hnsw_ef: 256, // Increased from 128 for better search precision with on-disk storage
exact: false,
},
with_payload: {
@ -491,8 +503,6 @@ export class QdrantVectorStore implements IVectorStore {
// Include first few file paths for debugging (avoid logging too many)
samplePaths: filePaths.slice(0, 3),
})
throw error
}
}