langchainjs icon indicating copy to clipboard operation
langchainjs copied to clipboard

Retrieval_QA with ChromaStore?

Open liamcharmer opened this issue 1 year ago • 1 comments

I was following https://js.langchain.com/docs/modules/chains/index_related_chains/retrieval_qa, however instead of

  const chain = RetrievalQAChain.fromLLM(model, vectorStore.asRetriever());
  const res = await chain.call({
    query: "What did the president say about Justice Breyer?",
  });``
  
  instead of using HNSWLib vector store, Im hoping to use ChromaDB Vector store. It isn't quite obvious to see how I can do asRetriever with Chroma?

liamcharmer avatar Apr 21 '23 11:04 liamcharmer

I've just found this: https://github.com/hwchase17/langchainjs/blob/main/examples/src/chains/chat_vector_db_chroma.ts

However instead of doing

 const vectorStore = await Chroma.fromDocuments(
          docs,
          new OpenAIEmbeddings(),
          { collectionName: "japan" }
        );```

How is it possible to make the vector store from the collection that exists? Instead of creating a new one?        
    

liamcharmer avatar Apr 21 '23 11:04 liamcharmer

I've just found this: https://github.com/hwchase17/langchainjs/blob/main/examples/src/chains/chat_vector_db_chroma.ts

However instead of doing

 const vectorStore = await Chroma.fromDocuments(
          docs,
          new OpenAIEmbeddings(),
          { collectionName: "japan" }
        );```

How is it possible to make the vector store from the collection that exists? Instead of creating a new one?        
    

I have been looking into this issue recently and I have solved it by using Chroma.fromExistingCollection. I hope this can be helpful to you.

sivanzheng avatar Jun 06 '23 08:06 sivanzheng

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

From what I understand, the issue is about using ChromaDB Vector store instead of HNSWLib vector store in the Retrieval_QA module of the LangChain library. User "sivanzheng" suggests using Chroma.fromExistingCollection to make the vector store from an existing collection instead of creating a new one.

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 it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain project!

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