Skip to content

Commit 11c454f

Browse files
authored
feat: Enable on-disk storage for Qdrant vectors and HNSW index (RooCodeInc#7182)
1 parent 934bfd0 commit 11c454f

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ describe("QdrantVectorStore", () => {
532532
vectors: {
533533
size: mockVectorSize,
534534
distance: "Cosine", // Assuming 'Cosine' is the DISTANCE_METRIC
535+
on_disk: true,
536+
},
537+
hnsw_config: {
538+
m: 64,
539+
ef_construct: 512,
540+
on_disk: true,
535541
},
536542
})
537543
expect(mockQdrantClientInstance.deleteCollection).not.toHaveBeenCalled()
@@ -610,6 +616,12 @@ describe("QdrantVectorStore", () => {
610616
vectors: {
611617
size: mockVectorSize, // Should use the new, correct vector size
612618
distance: "Cosine",
619+
on_disk: true,
620+
},
621+
hnsw_config: {
622+
m: 64,
623+
ef_construct: 512,
624+
on_disk: true,
613625
},
614626
})
615627

@@ -903,6 +915,12 @@ describe("QdrantVectorStore", () => {
903915
vectors: {
904916
size: newVectorSize, // Should create with new 768 dimensions
905917
distance: "Cosine",
918+
on_disk: true,
919+
},
920+
hnsw_config: {
921+
m: 64,
922+
ef_construct: 512,
923+
on_disk: true,
906924
},
907925
})
908926
expect(mockQdrantClientInstance.createPayloadIndex).toHaveBeenCalledTimes(5)

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

Lines changed: 12 additions & 2 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,
159+
},
160+
hnsw_config: {
161+
m: 64,
162+
ef_construct: 512,
163+
on_disk: true,
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,
254+
},
255+
hnsw_config: {
256+
m: 64,
257+
ef_construct: 512,
258+
on_disk: true,
247259
},
248260
})
249261
console.log(`[QdrantVectorStore] Successfully created new collection ${this.collectionName}`)
@@ -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)