langchain icon indicating copy to clipboard operation
langchain copied to clipboard

community[minor]: add mongodb byte store

Open pprados opened this issue 7 months ago • 2 comments

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 !

pprados avatar Jul 04 '24 14:07 pprados