langchain
langchain copied to clipboard
Embedding individual text
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?
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
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.
Did you ever figure out how to remove the Embeddings? I'm currently trying to figure out this too.