From 4f3a4c56c46dc4ed9637b8fa600f05c4b72c96d0 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Mon, 18 Aug 2025 08:50:20 -0500 Subject: [PATCH] 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 --- .../code-index/vector-store/qdrant-client.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/services/code-index/vector-store/qdrant-client.ts b/src/services/code-index/vector-store/qdrant-client.ts index 50f39666c4..b83092b28a 100644 --- a/src/services/code-index/vector-store/qdrant-client.ts +++ b/src/services/code-index/vector-store/qdrant-client.ts @@ -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 } }