-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat!: Migrate Vector DB IDs to Vector Store IDs (breaking change) #3253
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
Merged
leseb
merged 4 commits into
llamastack:main
from
franciscojavierarceo:vector-db-stores-id
Sep 5, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
432ec7d
BREAKING CHANGE: Migrate Vector DBs to vector store ID
franciscojavierarceo ce897e1
Merge branch 'main' into vector-db-stores-id
franciscojavierarceo 4939cf3
Merge branch 'main' into vector-db-stores-id
franciscojavierarceo 76597d9
Merge branch 'main' into vector-db-stores-id
franciscojavierarceo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,6 @@ async def register_vector_db( | |
| provider_vector_db_id: str | None = None, | ||
| vector_db_name: str | None = None, | ||
| ) -> VectorDB: | ||
| provider_vector_db_id = provider_vector_db_id or vector_db_id | ||
| if provider_id is None: | ||
| if len(self.impls_by_provider_id) > 0: | ||
| provider_id = list(self.impls_by_provider_id.keys())[0] | ||
|
|
@@ -69,14 +68,33 @@ async def register_vector_db( | |
| raise ModelTypeError(embedding_model, model.model_type, ModelType.embedding) | ||
| if "embedding_dimension" not in model.metadata: | ||
| raise ValueError(f"Model {embedding_model} does not have an embedding dimension") | ||
|
|
||
| provider = self.impls_by_provider_id[provider_id] | ||
| logger.warning( | ||
| "VectorDB is being deprecated in future releases in favor of VectorStore. Please migrate your usage accordingly." | ||
| ) | ||
| vector_store = await provider.openai_create_vector_store( | ||
| name=vector_db_name or vector_db_id, | ||
| embedding_model=embedding_model, | ||
| embedding_dimension=model.metadata["embedding_dimension"], | ||
| provider_id=provider_id, | ||
| provider_vector_db_id=provider_vector_db_id, | ||
| ) | ||
|
|
||
| vector_store_id = vector_store.id | ||
| actual_provider_vector_db_id = provider_vector_db_id or vector_store_id | ||
| logger.warning( | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a reasonable way to highlight this to users. |
||
| f"Ignoring vector_db_id {vector_db_id} and using vector_store_id {vector_store_id} instead. Setting VectorDB {vector_db_id} to VectorDB.vector_db_name" | ||
| ) | ||
|
|
||
| vector_db_data = { | ||
| "identifier": vector_db_id, | ||
| "identifier": vector_store_id, | ||
| "type": ResourceType.vector_db.value, | ||
| "provider_id": provider_id, | ||
| "provider_resource_id": provider_vector_db_id, | ||
| "provider_resource_id": actual_provider_vector_db_id, | ||
| "embedding_model": embedding_model, | ||
| "embedding_dimension": model.metadata["embedding_dimension"], | ||
| "vector_db_name": vector_db_name, | ||
| "vector_db_name": vector_store.name, | ||
| } | ||
| vector_db = TypeAdapter(VectorDBWithOwner).validate_python(vector_db_data) | ||
| await self.register_object(vector_db) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't understand, if it's deprecated (or want to deprecate soon), why convert the call to vector store under the hood? Can't we just fail the call and tell users to use VectorStore?
Uh oh!
There was an error while loading. Please reload this page.
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.
I wanted to provide a lower friction migration.
The path would be:
Doing this would make the migration easier for users IMO. Under the hood, Vector Stores uses most of the VectorDB and VectorIO logic.
Given we have so many Red Hat users of RAG, I thought this was an easier path for them.
For some, they may just rip off the bandaid and that'd definitely be preferred but I'm happy to try and reduce the friction as much as possible.