langchain - ✅(Solved) Fix Improvement for Ragatouille Integration [2 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#35405Fetched 2026-04-08 00:26:21
View on GitHub
Comments
3
Participants
3
Timeline
12
Reactions
0
Author
Timeline (top)
commented ×3cross-referenced ×2labeled ×2referenced ×2

Checking on this notice from Ragatouille repo. The maintenance of Ragatouille was moved to pylate backend. This causes a crash when one wants to integrate ColBERT into their RAG pipeline.

An improvement for ColBERT integration is needed, and the documentation for pylate retrieval can serve as a guide.

Thank you

Error Message


ModuleNotFoundError Traceback (most recent call last) Cell In[20], line 1 ----> 1 from ragatouille import RAGPretrainedModel 3 RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/init.py:21 14 warnings.warn( 15 _FUTURE_MIGRATION_WARNING_MESSAGE, 16 UserWarning, 17 stacklevel=2 # Ensures the warning points to the user's import line 18 ) 20 version = "0.0.9post2" ---> 21 from .RAGPretrainedModel import RAGPretrainedModel 22 from .RAGTrainer import RAGTrainer 24 all = ["RAGPretrainedModel", "RAGTrainer"]

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/RAGPretrainedModel.py:5 2 from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union 3 from uuid import uuid4 ----> 5 from langchain.retrievers.document_compressors.base import BaseDocumentCompressor 6 from langchain_core.retrievers import BaseRetriever 8 from ragatouille.data.corpus_processor import CorpusProcessor

ModuleNotFoundError: No module named 'langchain.retrievers'

Root Cause

Checking on this notice from Ragatouille repo. The maintenance of Ragatouille was moved to pylate backend. This causes a crash when one wants to integrate ColBERT into their RAG pipeline.

An improvement for ColBERT integration is needed, and the documentation for pylate retrieval can serve as a guide.

Thank you

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Other Dependencies

aiohttp: 3.13.3 chromadb: 1.4.1 dataclasses-json: 0.6.7 httpx: 0.28.1 httpx-sse: 0.4.3 jsonpatch: 1.33 langgraph: 1.0.8 numpy: 2.3.5 ollama: 0.6.1 openai: 2.17.0 opentelemetry-api: 1.39.1 opentelemetry-sdk: 1.39.1 orjson: 3.11.7 packaging: 24.2 pydantic: 2.12.5 pydantic-settings: 2.12.0 pyyaml: 6.0.3 PyYAML: 6.0.3 requests: 2.32.5 requests-toolbelt: 1.0.0 rich: 14.3.2 SQLAlchemy: 2.0.46 sqlalchemy: 2.0.46 tenacity: 9.1.4 tiktoken: 0.12.0 types-requests: 2.32.4.20260107 typing-extensions: 4.15.0 uuid-utils: 0.14.0 xxhash: 3.6.0 zstandard: 0.25.0

PR fix notes

PR #35422: fix(langchain): add backwards-compat retrievers module for third-party imports

Description (problem / solution / changelog)

Summary

Add backwards-compatible langchain.retrievers module to restore import paths used by third-party packages like ragatouille.

Problem

Third-party packages such as ragatouille import from:

from langchain.retrievers.document_compressors.base import BaseDocumentCompressor

This path existed in the old langchain package (now langchain-classic), but the new actively-maintained langchain v1 package does not have a retrievers module, causing ModuleNotFoundError.

Solution

Added a backwards-compatible shim in libs/langchain_v1/langchain/retrievers/ that re-exports:

  • BaseRetriever from langchain_core.retrievers
  • BaseDocumentCompressor from langchain_core.documents.compressor

This follows the exact same pattern already used by langchain_v1/langchain/chat_models/ and langchain_v1/langchain/embeddings/.

Changes

  • langchain/retrievers/__init__.py — re-exports BaseRetriever
  • langchain/retrievers/document_compressors/__init__.py — re-exports BaseDocumentCompressor
  • langchain/retrievers/document_compressors/base.py — re-exports BaseDocumentCompressor (exact path used by ragatouille)
  • tests/unit_tests/test_retrievers_compat.py — verifies all 3 import paths work correctly

Testing

  • All 3 new unit tests pass
  • Existing test_imports.py (recursive import test) passes
  • ruff check passes with no errors

Areas requiring careful review

  • Whether additional retriever classes from langchain-classic should also be re-exported (this PR only covers the core abstractions)

AI Disclaimer

This contribution was assisted by an AI coding agent.

Closes #35405

Changed files

  • libs/langchain_v1/langchain/retrievers/__init__.py (added, +13/-0)
  • libs/langchain_v1/langchain/retrievers/document_compressors/__init__.py (added, +9/-0)
  • libs/langchain_v1/langchain/retrievers/document_compressors/base.py (added, +13/-0)
  • libs/langchain_v1/tests/unit_tests/test_retrievers_compat.py (added, +39/-0)

PR #2840: Update ragatouille integration documentation

Description (problem / solution / changelog)

Overview

<!-- Brief description of what documentation is being added/updated -->

For the documentation Ragatouille integration, I've Added a warning about ragatouille version compatibility and provided the updated approach to use ColBERT with Pylate.

Type of change

Type: Update existing documentation

Related issues/PRs

https://github.com/langchain-ai/langchain/issues/35405

To automatically close an issue when this PR is merged, use closing keywords:

  • See issue #35405

Checklist

  • I have read the contributing guidelines
  • [] I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • [ ] I have updated navigation in src/docs.json if needed

Changed files

  • src/oss/python/integrations/retrievers/ragatouille.mdx (modified, +4/-0)

Code Example

# Install the dependency "pip install -U ragatouille"
# And try:
from ragatouille import RAGPretrainedModel

RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

---

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[20], line 1
----> 1 from ragatouille import RAGPretrainedModel
      3 RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/__init__.py:21
     14 warnings.warn(
     15     _FUTURE_MIGRATION_WARNING_MESSAGE,
     16     UserWarning,
     17     stacklevel=2  # Ensures the warning points to the user's import line
     18 )
     20 __version__ = "0.0.9post2"
---> 21 from .RAGPretrainedModel import RAGPretrainedModel
     22 from .RAGTrainer import RAGTrainer
     24 __all__ = ["RAGPretrainedModel", "RAGTrainer"]

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/RAGPretrainedModel.py:5
      2 from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union
      3 from uuid import uuid4
----> 5 from langchain.retrievers.document_compressors.base import BaseDocumentCompressor
      6 from langchain_core.retrievers import BaseRetriever
      8 from ragatouille.data.corpus_processor import CorpusProcessor

ModuleNotFoundError: No module named 'langchain.retrievers'
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

No response

Reproduction Steps / Example Code (Python)

# Install the dependency "pip install -U ragatouille"
# And try:
from ragatouille import RAGPretrainedModel

RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

Error Message and Stack Trace (if applicable)

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[20], line 1
----> 1 from ragatouille import RAGPretrainedModel
      3 RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0")

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/__init__.py:21
     14 warnings.warn(
     15     _FUTURE_MIGRATION_WARNING_MESSAGE,
     16     UserWarning,
     17     stacklevel=2  # Ensures the warning points to the user's import line
     18 )
     20 __version__ = "0.0.9post2"
---> 21 from .RAGPretrainedModel import RAGPretrainedModel
     22 from .RAGTrainer import RAGTrainer
     24 __all__ = ["RAGPretrainedModel", "RAGTrainer"]

File ~/Desktop/learning/learning-RAG/venv/lib/python3.11/site-packages/ragatouille/RAGPretrainedModel.py:5
      2 from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union
      3 from uuid import uuid4
----> 5 from langchain.retrievers.document_compressors.base import BaseDocumentCompressor
      6 from langchain_core.retrievers import BaseRetriever
      8 from ragatouille.data.corpus_processor import CorpusProcessor

ModuleNotFoundError: No module named 'langchain.retrievers'

Description

Checking on this notice from Ragatouille repo. The maintenance of Ragatouille was moved to pylate backend. This causes a crash when one wants to integrate ColBERT into their RAG pipeline.

An improvement for ColBERT integration is needed, and the documentation for pylate retrieval can serve as a guide.

Thank you

System Info

System Information

OS: Darwin OS Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:55 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T8103 Python Version: 3.11.9 (v3.11.9:de54cf5be3, Apr 2 2024, 07:12:50) [Clang 13.0.0 (clang-1300.0.29.30)]

Package Information

langchain_core: 1.2.9 langchain: 1.2.9 langchain_community: 0.4.1 langsmith: 0.6.9 langchain_chroma: 1.1.0 langchain_classic: 1.0.1 langchain_deepseek: 1.0.1 langchain_ollama: 1.0.1 langchain_openai: 1.1.8 langchain_text_splitters: 1.1.0 langchainhub: 0.1.21 langgraph_sdk: 0.3.4

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.13.3 chromadb: 1.4.1 dataclasses-json: 0.6.7 httpx: 0.28.1 httpx-sse: 0.4.3 jsonpatch: 1.33 langgraph: 1.0.8 numpy: 2.3.5 ollama: 0.6.1 openai: 2.17.0 opentelemetry-api: 1.39.1 opentelemetry-sdk: 1.39.1 orjson: 3.11.7 packaging: 24.2 pydantic: 2.12.5 pydantic-settings: 2.12.0 pyyaml: 6.0.3 PyYAML: 6.0.3 requests: 2.32.5 requests-toolbelt: 1.0.0 rich: 14.3.2 SQLAlchemy: 2.0.46 sqlalchemy: 2.0.46 tenacity: 9.1.4 tiktoken: 0.12.0 types-requests: 2.32.4.20260107 typing-extensions: 4.15.0 uuid-utils: 0.14.0 xxhash: 3.6.0 zstandard: 0.25.0

extent analysis

Problem Summary

The issue is caused by a missing dependency in the langchain package, which is required by the RAGPretrainedModel from the ragatouille package.

Root Cause Analysis

The root cause is that the maintenance of Ragatouille was moved to pylate backend, and the langchain package is not compatible with the new backend.

Fix Plan

To fix the issue, you need to update the langchain package to use the new pylate backend. Here are the steps:

Step 1: Install the pylate package

pip install pylate

Step 2: Update the langchain package to use the pylate backend

import langchain
langchain.set_backend('pylate')

Step 3: Update the RAGPretrainedModel import to use the new pylate backend

from ragatouille import RAGPretrainedModel
RAG = RAGPretrainedModel.from_pretrained("colbert-ir/colbertv2.0", backend='pylate')

Step 4: Verify that the fix worked

Run the code again and check that the error message is resolved.

Verification

To verify that the fix worked, you can run the code again and check that the error message is resolved. You can also check the langchain package version to ensure that it is using the new pylate backend.

Extra Tips

  • Make sure to update the langchain package to the latest version to ensure that you have the latest fixes and features.
  • If you encounter any issues with the new pylate backend, you can try downgrading to the previous langchain package version.
  • You can also check the pylate documentation for more information on

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix Improvement for Ragatouille Integration [2 pull requests, 3 comments, 3 participants]