Skip to content

Commit 4f3a4c5

Browse files
committed
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
1 parent a8aea14 commit 4f3a4c5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/services/code-index/vector-store/qdrant-client.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ export class QdrantVectorStore implements IVectorStore {
155155
vectors: {
156156
size: this.vectorSize,
157157
distance: this.DISTANCE_METRIC,
158+
on_disk: true, // Store vectors on disk for low memory usage
159+
},
160+
hnsw_config: {
161+
m: 64, // Increased for better precision
162+
ef_construct: 512, // Increased for better precision during index construction
163+
on_disk: true, // Store HNSW index on disk for low memory usage
158164
},
159165
})
160166
created = true
@@ -244,6 +250,12 @@ export class QdrantVectorStore implements IVectorStore {
244250
vectors: {
245251
size: this.vectorSize,
246252
distance: this.DISTANCE_METRIC,
253+
on_disk: true, // Store vectors on disk for low memory usage
254+
},
255+
hnsw_config: {
256+
m: 64, // Increased for better precision
257+
ef_construct: 512, // Increased for better precision during index construction
258+
on_disk: true, // Store HNSW index on disk for low memory usage
247259
},
248260
})
249261
console.log(`[QdrantVectorStore] Successfully created new collection ${this.collectionName}`)
@@ -404,7 +416,7 @@ export class QdrantVectorStore implements IVectorStore {
404416
score_threshold: minScore ?? DEFAULT_SEARCH_MIN_SCORE,
405417
limit: maxResults ?? DEFAULT_MAX_SEARCH_RESULTS,
406418
params: {
407-
hnsw_ef: 128,
419+
hnsw_ef: 256, // Increased from 128 for better search precision with on-disk storage
408420
exact: false,
409421
},
410422
with_payload: {
@@ -491,8 +503,6 @@ export class QdrantVectorStore implements IVectorStore {
491503
// Include first few file paths for debugging (avoid logging too many)
492504
samplePaths: filePaths.slice(0, 3),
493505
})
494-
495-
throw error
496506
}
497507
}
498508

0 commit comments

Comments
 (0)