langchain
langchain copied to clipboard
community[minor]: add mongodb byte store
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:
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 !