-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
community: Cassandra Vector Store: extend metadata-related methods #27078
Merged
efriis
merged 4 commits into
langchain-ai:master
from
hemidactylus:SL-cassandra-vectorstore-metadata-methods
Oct 9, 2024
Merged
community: Cassandra Vector Store: extend metadata-related methods #27078
efriis
merged 4 commits into
langchain-ai:master
from
hemidactylus:SL-cassandra-vectorstore-metadata-methods
Oct 9, 2024
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
dosubot
bot
added
size:L
This PR changes 100-499 lines, ignoring generated files.
community
Related to langchain-community
Ɑ: vector store
Related to vector store module
labels
Oct 3, 2024
I helped work on this code. The changes here are a prerequisite needed for upcoming changes to the Cassandra Graph Vector Store. |
@efriis may I ask you to take a look, please? This enhancement will enable the upcoming improvements to the Graph Vector Store. 🙏 |
efriis
approved these changes
Oct 9, 2024
dosubot
bot
added
the
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
label
Oct 9, 2024
efriis
added a commit
that referenced
this pull request
Oct 22, 2024
**Description:** This PR updates `CassandraGraphVectorStore` to be based off `CassandraVectorStore`, instead of using a custom CQL implementation. This allows users using a `CassandraVectorStore` to upgrade to a `GraphVectorStore` without having to change their database schema or re-embed documents. This PR also updates the documentation of the `GraphVectorStore` base class and contains native async implementations for the standard graph methods: `traversal_search` and `mmr_traversal_search` in `CassandraVectorStore`. **Issue:** No issue number. **Dependencies:** #27078 (already-merged) **Lint and test**: - Lint and tests all pass, including existing `CassandraGraphVectorStore` tests. - Also added numerous additional tests based of the tests in `langchain-astradb` which cover many more scenarios than the existing tests for `Cassandra` and `CassandraGraphVectorStore` ** BREAKING CHANGE** Note that this is a breaking change for existing users of `CassandraGraphVectorStore`. They will need to wipe their database table and restart. However: - The interfaces have not changed. Just the underlying storage mechanism. - Any one using `langchain_community.vectorstores.Cassandra` can instead use `langchain_community.graph_vectorstores.CassandraGraphVectorStore` and they will gain Graph capabilities without having to re-embed their existing documents. This is the primary goal of this PR. --------- Co-authored-by: Erick Friis <erick@langchain.dev>
ccurme
pushed a commit
that referenced
this pull request
Oct 22, 2024
**Description:** This PR updates `CassandraGraphVectorStore` to be based off `CassandraVectorStore`, instead of using a custom CQL implementation. This allows users using a `CassandraVectorStore` to upgrade to a `GraphVectorStore` without having to change their database schema or re-embed documents. This PR also updates the documentation of the `GraphVectorStore` base class and contains native async implementations for the standard graph methods: `traversal_search` and `mmr_traversal_search` in `CassandraVectorStore`. **Issue:** No issue number. **Dependencies:** #27078 (already-merged) **Lint and test**: - Lint and tests all pass, including existing `CassandraGraphVectorStore` tests. - Also added numerous additional tests based of the tests in `langchain-astradb` which cover many more scenarios than the existing tests for `Cassandra` and `CassandraGraphVectorStore` ** BREAKING CHANGE** Note that this is a breaking change for existing users of `CassandraGraphVectorStore`. They will need to wipe their database table and restart. However: - The interfaces have not changed. Just the underlying storage mechanism. - Any one using `langchain_community.vectorstores.Cassandra` can instead use `langchain_community.graph_vectorstores.CassandraGraphVectorStore` and they will gain Graph capabilities without having to re-embed their existing documents. This is the primary goal of this PR. --------- Co-authored-by: Erick Friis <erick@langchain.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
community
Related to langchain-community
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
size:L
This PR changes 100-499 lines, ignoring generated files.
Ɑ: vector store
Related to vector store module
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.
Description: this PR adds a set of methods to deal with metadata associated to the vector store entries. These, while essential to the Graph-related extension of the
Cassandra
vector store, are also useful in themselves. These are (all come in their sync+async versions):[a]delete_by_metadata_filter
[a]replace_metadata
[a]get_by_document_id
[a]metadata_search
Additionally, a
[a]similarity_search_with_embedding_id_by_vector
method is introduced to better serve the store's internal working (esp. related to reranking logic).Issue: no issue number, but now all Document's returned bear their
.id
consistently (as a consequence of a slight refactoring in how the raw entries read from DB are made back intoDocument
instances).Dependencies: (no new deps: packaging comes through langchain-core already;
cassio
is now required to be version 0.1.10+)Add tests and docs
Added integration tests for the relevant newly-introduced methods.
(Docs will be updated in a separate PR).
Lint and test Lint and (updated) test all pass.