Question Details

No question body available.

Tags

python langchain retrieval-augmented-generation

Answers (1)

Accepted Answer Available
Accepted Answer
November 9, 2025 Score: 3 Rep: 167 Quality: High Completeness: 50%

In LangChain 1.x, the legacy RetrievalQA class is no longer exported from langchain.chains (API was reorganized). Your import works only on older 0.x versions.

You could Import the legacy class from its module path

from langchain.chains.retrieval_qa.base import RetrievalQA

(Works if the class still ships in your version, but it’s deprecated in favor of the functions above.)

Or you could try and Pin to a compatible older LangChain

pip install "langchain