langchain icon indicating copy to clipboard operation
langchain copied to clipboard

VectorStoreToolkit uses deprecated VectorDBQA, langchain needs create_retrieval_qa_agent

Open amicus-veritatis opened this issue 1 year ago • 4 comments

  1. VectorStoreToolkit, VectorStoreRouterToolkit rely on VectorStoreQATool and VectorStoreQAWithSourcesTool
  2. VectorStoreQATool and VectorStoreQAWithSourcesTool rely on VectorDBQA and VectorDBQAWithSourcesChain respectively.
  3. Although VectorDBQA and VectorDBQAWithSourcesChainare deprecated, there are currently no replacements available.
  4. As a result, an agent initialized by create_vectorstore_agent continually calls raise_deprecation in agent executor. To address this issue, LangChain needs following: create_retrieval_qa_agent, RetrievalQAToolKit, RetrievalQAWithSourcesTool.

amicus-veritatis avatar Apr 13 '23 07:04 amicus-veritatis

I made a PR #2885

amicus-veritatis avatar Apr 14 '23 09:04 amicus-veritatis

When running VectorDBQAWithSourcesChain, I keep getting a warning in the terminal that I should use RetrievalQAWithSourcesChain.

The issue with RetrievalQAWithSourcesChain is the "retriever" arg which no longer accepts a vectorstore anymore. It needs some kind of BaseRetriever type.

Any idea how to get around this?

NikhilSehgal123 avatar Apr 15 '23 14:04 NikhilSehgal123

@NikhilSehgal123 I think you can use .as_retriever() method in such case.

amicus-veritatis avatar Apr 16 '23 06:04 amicus-veritatis

@NikhilSehgal123 cc: @hwchase17 I updated those legacy code as well, they will use as_retriever() method within VectorStoreQATool, VectorStoreQAWithSourcesTool. Check the updated PR (#2885) for more details.

amicus-veritatis avatar Apr 17 '23 03:04 amicus-veritatis

Hi, @amicus-veritatis! 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 you reported was regarding the VectorStoreToolkit in LangChain relying on deprecated VectorDBQA and VectorDBQAWithSourcesChain, which caused an agent initialized by create_vectorstore_agent to continually call raise_deprecation in the agent executor. You made a pull request (#2885) to address this issue, suggesting the use of the .as_retriever() method and updating the legacy code in the PR to use as_retriever() method within VectorStoreQATool and VectorStoreQAWithSourcesTool.

I wanted to check with you if this issue is still relevant to the latest version of the LangChain repository. If it is, please let the LangChain team 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 and for helping us improve LangChain! Let me know if you have any further questions or concerns.

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