langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Embedding individual text

Open hetthummar opened this issue 1 year ago • 2 comments

I am building a recommendation engine for an e-commerce site with over 15k products, and I am wondering how to create an embedding for each individual product and then combine them into a larger embedding model. This approach will allow me to easily remove a product's embedding when it is removed from the site, and then merge the remaining embeddings without the need to construct a new model.

My goal is to have a system that can handle the addition and removal of products from the e-commerce site without having to create a new embedding model each time.

I am wondering if there's a way to implement this merging and removal of embeddings in langchain?

hetthummar avatar Mar 05 '23 02:03 hetthummar

You can use a Vector Db to store the embeddings, like Chroma. langchain has a nice wrapper for Chroma, that can be used for adding documents (products in your case) and for querying, but for removing a product embedding you need to use Chroma directly.

Hope this helps!

References: Vector store example Chroma getting started Deleting data from a Chroma collection

claust avatar Mar 05 '23 09:03 claust

Wish I had stumbled upon this post earlier.

I'm using FAISS vectorstore, might be different use cases. My way of deleting was accessing the .docstore._dict and deleting keys from there.

wheynelau avatar Apr 14 '23 02:04 wheynelau

Did you ever figure out how to remove the Embeddings? I'm currently trying to figure out this too.

SpaceController avatar May 29 '23 15:05 SpaceController