[GH-ISSUE #1085] [langchain]: MultiQueryRetriever not in migration #143

Closed
opened 2026-02-17 17:19:16 -05:00 by yindo · 3 comments
Owner

Originally created by @hhhFuture on GitHub (Oct 22, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/1085

Type of issue

issue / bug

Language

Python

Description

Congratulations on another leapfrog update of langchain. At the same time, we are very grateful to all the friends who have contributed to langchain. After langchain was updated to version 1.0.0, many apis have changed. Due to reinstalling the latest version of langchain in my python environment, some interfaces in the previous code can no longer be used. I query langchain1.0.0 related documents, the migration guide https://docs.langchain.com/oss/python/migrate/langchain-v1, although has listed the parts replacement API example, but still can't solve my problem, And I tried to search for relevant packages or libraries in the search box of the web page, but still couldn't find the new API corresponding to the old one. Here are my specific questions. I hope I can get help from my friends.
My code:

import os
from langchain_community.vectorstores import FAISS
from langchain_community.embeddings import DashScopeEmbeddings
from langchain_community.llms import Tongyi
# from langchain.retrievers import MultiQueryRetriever # old API
from langchain_classic.retrievers import MultiQueryRetriever

DASHSCOPE_API_KEY = "xxx"
llm = Tongyi(
    model_name="qwen-max",
    dashscope_api_key=DASHSCOPE_API_KEY
)

embeddings = DashScopeEmbeddings(
    model="text-embedding-v3",
    dashscope_api_key=DASHSCOPE_API_KEY
)

vectorstore = FAISS.load_local("./vector_db", embeddings, allow_dangerous_deserialization=True)

retriever = MultiQueryRetriever.from_llm(
    retriever=vectorstore.as_retriever(),
    llm=llm
)

query = "What are the assessment criteria for customer managers?"

results = retriever.get_relevant_documents(query)
print(results)

The error report is as follows:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[4], line 34
     26 retriever = MultiQueryRetriever.from_llm(
     27     retriever=vectorstore.as_retriever(),
     28     llm=llm
     29 )
     32 query = "What are the assessment criteria for customer managers?"
---> 34 results = retriever.get_relevant_documents(query)
     35 print(results)
File D:\Miniconda3\envs\llm\lib\site-packages\pydantic\main.py:991, in BaseModel.__getattr__(self, item)
    988     return super().__getattribute__(item)  # Raises AttributeError if appropriate
    989 else:
    990     # this is the current error
--> 991     raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'MultiQueryRetriever' object has no attribute 'get_relevant_documents'

I tried to search in the search box, but couldn't find the appropriate document.

Image This is just a problem with one of the apis. If there are other api calls that also have issues, it will be extremely difficult to query them. May I ask if the official documentation of langchain1.0.0 has considered adding a small floating window, similar to the AskAI window of llamaindex, where you can ask questions based on the documentation? In this way, if friends encounter problems with Api calls or other issues that cannot be resolved, they can ask questions through the floating window
Originally created by @hhhFuture on GitHub (Oct 22, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/1085 ### Type of issue issue / bug ### Language Python ### Description Congratulations on another leapfrog update of langchain. At the same time, we are very grateful to all the friends who have contributed to langchain. After langchain was updated to version 1.0.0, many apis have changed. Due to reinstalling the latest version of langchain in my python environment, some interfaces in the previous code can no longer be used. I query langchain1.0.0 related documents, the migration guide https://docs.langchain.com/oss/python/migrate/langchain-v1, although has listed the parts replacement API example, but still can't solve my problem, And I tried to search for relevant packages or libraries in the search box of the web page, but still couldn't find the new API corresponding to the old one. Here are my specific questions. I hope I can get help from my friends. My code: ~~~python import os from langchain_community.vectorstores import FAISS from langchain_community.embeddings import DashScopeEmbeddings from langchain_community.llms import Tongyi # from langchain.retrievers import MultiQueryRetriever # old API from langchain_classic.retrievers import MultiQueryRetriever DASHSCOPE_API_KEY = "xxx" llm = Tongyi( model_name="qwen-max", dashscope_api_key=DASHSCOPE_API_KEY ) embeddings = DashScopeEmbeddings( model="text-embedding-v3", dashscope_api_key=DASHSCOPE_API_KEY ) vectorstore = FAISS.load_local("./vector_db", embeddings, allow_dangerous_deserialization=True) retriever = MultiQueryRetriever.from_llm( retriever=vectorstore.as_retriever(), llm=llm ) query = "What are the assessment criteria for customer managers?" results = retriever.get_relevant_documents(query) print(results) ~~~ The error report is as follows: ~~~python --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[4], line 34 26 retriever = MultiQueryRetriever.from_llm( 27 retriever=vectorstore.as_retriever(), 28 llm=llm 29 ) 32 query = "What are the assessment criteria for customer managers?" ---> 34 results = retriever.get_relevant_documents(query) 35 print(results) File D:\Miniconda3\envs\llm\lib\site-packages\pydantic\main.py:991, in BaseModel.__getattr__(self, item) 988 return super().__getattribute__(item) # Raises AttributeError if appropriate 989 else: 990 # this is the current error --> 991 raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') AttributeError: 'MultiQueryRetriever' object has no attribute 'get_relevant_documents' ~~~ I tried to search in the search box, but couldn't find the appropriate document. <img width="1300" height="595" alt="Image" src="https://github.com/user-attachments/assets/2aa4d4d1-4d10-410b-8b10-dd00769e6602" /> This is just a problem with one of the apis. If there are other api calls that also have issues, it will be extremely difficult to query them. May I ask if the official documentation of langchain1.0.0 has considered adding a small floating window, similar to the AskAI window of llamaindex, where you can ask questions based on the documentation? In this way, if friends encounter problems with Api calls or other issues that cannot be resolved, they can ask questions through the floating window
yindo added the langchain label 2026-02-17 17:19:16 -05:00
yindo closed this issue 2026-02-17 17:19:16 -05:00
Author
Owner

@mdrxy commented on GitHub (Oct 22, 2025):

Hi, thank you @hhhFuture for flagging this. Retrievers such as MultiQueryRetriever are available in the langchain-classic package. Apologies as this was missed in the migration guide - I'll update it now.

In most cases, missing imports in the new langchain are found by switching to import from langchain_classic.

If there are other ones you can list, that would be appreciated so that we can ensure others don't face the same problem.

May I ask if the official documentation of langchain1.0.0 has considered adding a small floating window, similar to the AskAI window of llamaindex, where you can ask questions based on the documentation?

Yes! This is being worked on and will be available soon.

Thanks again :)

@mdrxy commented on GitHub (Oct 22, 2025): Hi, thank you @hhhFuture for flagging this. Retrievers such as `MultiQueryRetriever` are available in the `langchain-classic` package. Apologies as this was missed in the migration guide - I'll update it now. In most cases, missing imports in the new `langchain` are found by switching to import from `langchain_classic`. If there are other ones you can list, that would be appreciated so that we can ensure others don't face the same problem. > May I ask if the official documentation of langchain1.0.0 has considered adding a small floating window, similar to the AskAI window of llamaindex, where you can ask questions based on the documentation? Yes! This is being worked on and will be available soon. Thanks again :)
Author
Owner

@hhhFuture commented on GitHub (Oct 22, 2025):

嗨,感谢您标记此内容。包装中提供了诸如此类的检索器。很抱歉,因为迁移指南中遗漏了这一点 - 我现在会更新它。MultiQueryRetriever``langchain-classic

在大多数情况下,通过切换到 import from 找到新中缺少的导入。langchain``langchain_classic

如果您可以列出其他问题,我们将不胜感激,这样我们就可以确保其他人不会面临同样的问题。

请问 langchain1.0.0 的官方文档有没有考虑过增加一个小浮动窗口,类似于 llamaindex 的 AskAI 窗口,可以根据文档提问?

是的!这正在进行中,很快就会推出。

再次感谢:)
Thank you for your reply. I think I have solved this problem. To find an api with the same functionality, I re-searched the 0.3x version of langchain. I looked for hints on replacing the old API with the new one in version 0.3x. The link is:
https://python.langchain.com/api_reference/langchain/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html#langchain.retrievers.contextual_compression.ContextualCompressionRetriever.get_relevant_documents
Screenshot:

Image

Later, in the migration guide of langchain1.0 version, I saw the API replaced by invoke(). Just looking at the spelling of the words, getRelevantDocuments is the same as get_relevant_documents, but I'm not sure if they are the same API.The link is:https://docs.langchain.com/oss/javascript/migrate/langchain-v1#retrievers
Screenshot:

Image

I hope this answer of mine can be helpful to other friends. At present, my personal feeling is that if the previous version used is relatively low, replacing various apis for the previous code is a rather tricky task, although the official documentation's migration guide has already provided some examples.langchain has now been updated to version 1.0.0. However, langchain_community is a package maintained by the community. Will it also be updated along with the updates of langchain? At present, I haven't found any documentation related to langchain_community in the official documentation of langchain1.0.0. Is it because it hasn't been merged in? Will you consider including langchain_community in the official documentation in the future? When looking up relevant materials on langchain_community now, one can only refer to the 0.3 version of langchain. At 11:15 on October 23, 2025, I saw that the official documentation of langchain provided an AI assistant that could ask questions. However, after using it for an entire afternoon, I found that the web page would crash after just a few rounds of asking questions. Currently, I have no idea what the reason is.Looking forward to your reply!

@hhhFuture commented on GitHub (Oct 22, 2025): > 嗨,感谢您标记此内容。包装中提供了诸如此类的检索器。很抱歉,因为迁移指南中遗漏了这一点 - 我现在会更新它。`MultiQueryRetriever``langchain-classic` > > 在大多数情况下,通过切换到 import from 找到新中缺少的导入。`langchain``langchain_classic` > > 如果您可以列出其他问题,我们将不胜感激,这样我们就可以确保其他人不会面临同样的问题。 > > > 请问 langchain1.0.0 的官方文档有没有考虑过增加一个小浮动窗口,类似于 llamaindex 的 AskAI 窗口,可以根据文档提问? > > 是的!这正在进行中,很快就会推出。 > > 再次感谢:) Thank you for your reply. I think I have solved this problem. To find an api with the same functionality, I re-searched the 0.3x version of langchain. I looked for hints on replacing the old API with the new one in version 0.3x. The link is: https://python.langchain.com/api_reference/langchain/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html#langchain.retrievers.contextual_compression.ContextualCompressionRetriever.get_relevant_documents Screenshot: <img width="916" height="492" alt="Image" src="https://github.com/user-attachments/assets/6a883779-eafb-4027-ae3c-82f3dcdcde68" /> Later, in the migration guide of langchain1.0 version, I saw the API replaced by invoke(). Just looking at the spelling of the words, getRelevantDocuments is the same as get_relevant_documents, but I'm not sure if they are the same API.The link is:https://docs.langchain.com/oss/javascript/migrate/langchain-v1#retrievers Screenshot: <img width="729" height="420" alt="Image" src="https://github.com/user-attachments/assets/814ecf8b-c7a4-427f-8122-ff6c19be8f78" /> I hope this answer of mine can be helpful to other friends. At present, my personal feeling is that if the previous version used is relatively low, replacing various apis for the previous code is a rather tricky task, although the official documentation's migration guide has already provided some examples.langchain has now been updated to version 1.0.0. However, langchain_community is a package maintained by the community. Will it also be updated along with the updates of langchain? At present, I haven't found any documentation related to langchain_community in the official documentation of langchain1.0.0. Is it because it hasn't been merged in? Will you consider including langchain_community in the official documentation in the future? When looking up relevant materials on langchain_community now, one can only refer to the 0.3 version of langchain. At 11:15 on October 23, 2025, I saw that the official documentation of langchain provided an AI assistant that could ask questions. However, after using it for an entire afternoon, I found that the web page would crash after just a few rounds of asking questions. Currently, I have no idea what the reason is.Looking forward to your reply!
Author
Owner

@mdrxy commented on GitHub (Oct 23, 2025):

Yep, langchain_community will soon be included in reference docs - it hasn't been ported just yet

@mdrxy commented on GitHub (Oct 23, 2025): Yep, `langchain_community` will soon be included in reference docs - it hasn't been ported just yet
yindo changed title from [langchain]: `MultiQueryRetriever` not in migration to [GH-ISSUE #1085] [langchain]: `MultiQueryRetriever` not in migration 2026-06-05 17:25:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#143