-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Shared Vector Store Adapter (Qdrant) — Extraction #7718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… add collection suffix; remove legacy client; generalize labels - Add shared vector-store module (interfaces, factory, filters, errors, collection manager) - Implement Qdrant adapter with URL normalization, ensure+recreate, payload indexes, search/delete - Add Code Index wrapper and update service factory (no behavior changes) - Support optional collectionSuffix for isolated collections - Update tests for factory/adapter; remove legacy client/tests - Generalize settings labels to "Vector Database" across locales Refs: RooCodeInc#6223
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this well-structured refactoring! The extraction of Qdrant vector store logic into a shared, provider-agnostic adapter pattern is clean and maintains backward compatibility while setting up a solid foundation for future vector database integrations.
Positive aspects:
✅ Clean separation of concerns with the adapter pattern
✅ Maintains backward compatibility - no breaking changes
✅ Good test coverage with contract tests, unit tests, and integration tests
✅ Proper error handling with custom error taxonomy
✅ Smart collection management with ensure-once caching
✅ Thoughtful i18n updates generalizing from "Qdrant" to "Vector Database"
I've left some suggestions inline that could improve the implementation further, but overall this is a solid architectural improvement that aligns well with the incremental approach requested in issue #6223.
I'll address those roomote suggestions. Heading home for the day so it will likely be over the weekend or Tuesday. |
- Fix collection manager concurrency race conditions with in-flight tracking - Integrate custom error classes (UnsupportedProviderError, DimensionMismatchError, CollectionInitError) - Make provider types flexible (string) instead of hard-coded 'qdrant' - Implement dynamic provider registry with auto-updating error messages - Fix cross-platform path handling by normalizing to forward slashes - Clean up unused parameter with meaningful logging for dimension changes - Add comprehensive CollectionManager unit tests (19 tests) - Enhance factory tests for new provider registration functionality
Typographical inconsistency: "URL del database vettoriale non valida" should likely be "non valido" to match the masculine form used elsewhere (e.g., in 'URL Ollama non valido'). Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Typographical suggestion: In the string "URL de base de données vectorielle", consider adding the article "la" for grammatical consistency (e.g., "URL de la base de données vectorielle"). Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@Michaelzag you still on this? |
Ya the pr is waiting |
Shared Vector Store Adapter (Qdrant) — Extraction
Related GitHub Issue
Refs: #6223
Note: This PR does not close #6223. It partially addresses the requested "vector database adapter" work by extracting a shared adapter module and providing the Qdrant implementation. Follow‑up PRs can extend this adapter as needed. No additional vector store implementations are included here.
Description
This PR extracts Qdrant vector‑store logic from Code Index into a shared, provider‑agnostic adapter. It keeps Code Index behavior the same, generalizes settings labels from “Qdrant …” to “Vector Database …”, and removes the legacy client after verifying tests.
Key implementation points:
src/services/vector-store/
:interfaces.ts
:VectorDatabaseAdapter
,VectorRecord
,VectorFilter
,DatabaseCapabilities
,VectorStoreConfig
.errors.ts
: adapter‑level error taxonomy.filters.ts
:FilterTranslator
+QdrantFilterTranslator
(directory prefix, delete filters viapathSegments.*
).collection-manager.ts
: ensure‑once cache percollection:dimension
.adapters/qdrant.ts
:QdrantAdapter
with URL/port normalization, ensure + dimension mismatch recreate, payload index creation, upsert shaping, search, delete‑by‑filter.factory.ts
:VectorStoreFactory.create()
(Qdrant only for now).src/services/code-index/vector-store-adapter.ts
: wrapper implementingIVectorStore
by delegating to shared adapter; preserves parity and no‑op delete when collection missing.src/services/code-index/service-factory.ts
: switches to shared factory + wrapper; preserves config and dimension resolution.src/services/code-index/vector-store/qdrant-client.ts
and its tests.collectionSuffix
is supported; default behavior is unchanged.Compatibility
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
Follow‑ups
Important
Extracts Qdrant vector-store logic into a shared adapter module, updates Code Index integration, and generalizes UI labels.
src/services/vector-store/
.qdrant-client.ts
and its tests fromsrc/services/code-index/vector-store/
.interfaces.ts
,errors.ts
,filters.ts
,collection-manager.ts
,adapters/qdrant.ts
, andfactory.ts
.QdrantAdapter
with URL/port normalization, collection management, and CRUD operations.vector-store-adapter.ts
to use the shared adapter.service-factory.ts
to switch to the shared factory and adapter.This description was created by
for b63ebfb. You can customize this summary. It will automatically update as commits are pushed.