Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/services/code-index/vector-store/qdrant-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HNSW parameters (m=64, ef_construct=512) are significantly higher than typical defaults. Could you add a comment explaining why these specific values were chosen? This would help future maintainers understand the precision vs. performance trade-offs.

ef_construct: 512, // Increased for better precision during index construction
on_disk: true, // Store HNSW index on disk for low memory usage
},
})
created = true
Expand Down Expand Up @@ -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}`)
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the here silently swallows errors, which might hide important issues. While preventing disruption is good, consider:

  1. Logging at a higher severity level (console.error is already there, which is good)
  2. Implementing a retry mechanism for transient failures
  3. Only catching specific non-critical errors and re-throwing critical ones

For example:

}

Expand Down
Loading