langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Add update method on vectorstores

Open vyeevani opened this issue 2 years ago • 3 comments
trafficstars

I am building a chain to analyze codebases. This involves documents that's constantly changing as the user modifies the files. As far as I can see, there doesn't seem to be a way to update the embeddings that are saved in vector stores once they have been embedded and submitted to the backing vectorstore.

This appears to be possible at least for chromaDB based on: (https://docs.trychroma.com/api-reference) and (https://github.com/chroma-core/chroma/blob/79c891f8f597dad8bd3eb5a42645cb99ec553440/chromadb/api/models/Collection.py#L258).

vyeevani avatar Apr 22 '23 16:04 vyeevani

Wrote the following to address this specifically for chromaDB: https://github.com/vyeevani/langchain/tree/vyeevani/update-vectorstore-entry-chromadb

vyeevani avatar Apr 22 '23 17:04 vyeevani

I think you might be able to query your documents, embed a new one, and add it back into the database.

trancethehuman avatar Apr 23 '23 03:04 trancethehuman

I have been working on something similar. But I was taking a more low level approach like file tools. Can the chroma db function insert the code in the right place? That would be awe

rick2047 avatar Apr 23 '23 11:04 rick2047

Hey folks, I am also working on a similar problem @vyeevani did you get a solution?

AvikantSrivastava avatar Jun 19 '23 13:06 AvikantSrivastava

Hi, @vyeevani! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened this issue requesting the addition of an update method on vectorstores to allow for updating embeddings that have already been submitted. You mentioned that this functionality is possible with chromaDB and provided references to support this. There have been a few comments on the issue, with you providing a solution specifically for chromaDB and other users discussing alternative approaches and asking for updates on the progress.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!

dosubot[bot] avatar Sep 20 '23 16:09 dosubot[bot]

is this dead? not optimal to delete the old vector store object everytime a refresh is needed...

sd3ntato avatar Feb 16 '24 14:02 sd3ntato