Skip to content

Conversation

@bart0401
Copy link
Contributor

@bart0401 bart0401 commented Oct 30, 2025

The langchain.retrievers module was removed in LangChain 1.0+.
All retriever imports have been updated to use langchain_classic as documented in the v1 migration guide.

Fixes #1195

Summary

Updated outdated retriever imports that don't work in LangChain 1.0+. Changed from langchain.retrievers to from langchain_classic.retrievers as per the v1 migration guide.

Changes

31 files updated across integrations:

  • 9 document_transformers files
  • 7 retrievers files
  • 12 providers files
  • 2 vectorstores files
  • 1 document_loaders file

Before:

from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.multi_query import MultiQueryRetriever

After:

from langchain_classic.retrievers.contextual_compression import ContextualCompressionRetriever
from langchain_classic.retrievers.multi_query import MultiQueryRetriever

All changes follow the pattern in the v1 migration guide.

@bart0401 bart0401 requested a review from mdrxy as a code owner October 30, 2025 05:08
@github-actions github-actions bot added langchain For docs changes to LangChain python For content related to the Python version of LangChain projects oss labels Oct 30, 2025
@bart0401 bart0401 force-pushed the fix/update-retriever-imports branch 4 times, most recently from 3d270fa to efe5302 Compare October 30, 2025 05:23
The langchain.retrievers module was removed in LangChain 1.0+.
All retriever imports have been updated to use langchain_classic
as documented in the v1 migration guide.

Changes:
- Document transformers (9 files): Updated ContextualCompressionRetriever imports
- Retrievers (7 files): Updated various retriever class imports
- Provider integrations (12 files): Updated provider-specific retriever imports
- Vectorstores (2 files): Updated SelfQueryRetriever and MultiQueryRetriever imports
- Document loaders (1 file): Updated SelfQueryRetriever and MultiVectorRetriever imports

Fixes langchain-ai#1195
@bart0401 bart0401 force-pushed the fix/update-retriever-imports branch from efe5302 to 9b23580 Compare October 30, 2025 05:24
Copy link
Member

@mdrxy mdrxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a million! one less thing on the todo list ;)

@mdrxy mdrxy merged commit fc754d8 into langchain-ai:main Oct 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[langchain]: Outdated Import Statements for Retrievers in Documentation

2 participants