-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
community[minor]: add mongodb byte store #23876
Merged
eyurtsev
merged 14 commits into
langchain-ai:master
from
pprados:pprados/add-mongodb-byte-store
Jul 19, 2024
Merged
community[minor]: add mongodb byte store #23876
eyurtsev
merged 14 commits into
langchain-ai:master
from
pprados:pprados/add-mongodb-byte-store
Jul 19, 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
🔌: mongo
Primarily related to Mongo integrations
🤖:improvement
Medium size change to existing code to handle new use-cases
labels
Jul 4, 2024
eyurtsev
changed the title
common[small]: add mongodb byte store
community[minor]: add mongodb byte store
Jul 5, 2024
@pprados could you add an integration test using Look at the following unit tests as examples:
Essentially you only need to import the test suite and inherit from it and then provide a single fixture class TestInMemoryStore(BaseStoreSyncTests):
@pytest.fixture
def three_values(self) -> Tuple[bytes, bytes, bytes]: # <-- Provide 3
return b"foo", b"bar", b"buzz"
@pytest.fixture
def kv_store(self) -> Store:
yield implementation using mongodb that has no keys stored in it |
eyurtsev
reviewed
Jul 5, 2024
@eyurtsev |
eyurtsev
approved these changes
Jul 19, 2024
dosubot
bot
added
the
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
label
Jul 19, 2024
olgamurraft
pushed a commit
to olgamurraft/langchain
that referenced
this pull request
Aug 16, 2024
The `MongoDBStore` can manage only documents. It's not possible to use MongoDB for an `CacheBackedEmbeddings`. With this new implementation, it's possible to use: ```python CacheBackedEmbeddings.from_bytes_store( underlying_embeddings=embeddings, document_embedding_cache=MongoDBByteStore( connection_string=db_uri, db_name=db_name, collection_name=collection_name, ), ) ``` and use MongoDB to cache the embeddings !
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
community
Related to langchain-community
🤖:improvement
Medium size change to existing code to handle new use-cases
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
🔌: mongo
Primarily related to Mongo integrations
size:L
This PR changes 100-499 lines, ignoring generated files.
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.
The
MongoDBStore
can manage only documents.It's not possible to use MongoDB for an
CacheBackedEmbeddings
.With this new implementation, it's possible to use:
and use MongoDB to cache the embeddings !