From 751d8957ea8cf40940002862c65b5cf103790840 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Fri, 6 Feb 2026 15:22:14 -0500 Subject: [PATCH] docs(langchain-classic): warn about older `create_react_agent` (#35052) --- .../langchain_classic/_api/deprecation.py | 1 + .../langchain_classic/agents/react/agent.py | 17 ++++++++++------- .../chains/llm_checker/base.py | 2 +- .../chains/llm_summarization_checker/base.py | 2 +- .../langchain_classic/chains/mapreduce.py | 5 ++--- .../langchain_classic/memory/summary.py | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/libs/langchain/langchain_classic/_api/deprecation.py b/libs/langchain/langchain_classic/_api/deprecation.py index dd53c0cab03..fc53400ff13 100644 --- a/libs/langchain/langchain_classic/_api/deprecation.py +++ b/libs/langchain/langchain_classic/_api/deprecation.py @@ -7,6 +7,7 @@ from langchain_core._api.deprecation import ( warn_deprecated, ) +# TODO: this is old, fix AGENT_DEPRECATION_WARNING = ( "LangChain agents will continue to be supported, but it is recommended for new " "use cases to be built with LangGraph. LangGraph offers a more flexible and " diff --git a/libs/langchain/langchain_classic/agents/react/agent.py b/libs/langchain/langchain_classic/agents/react/agent.py index 9dce04145c5..f1152d480b2 100644 --- a/libs/langchain/langchain_classic/agents/react/agent.py +++ b/libs/langchain/langchain_classic/agents/react/agent.py @@ -28,13 +28,16 @@ def create_react_agent( (https://arxiv.org/abs/2210.03629) !!! warning - This implementation is based on the foundational ReAct paper but is older and - not well-suited for production applications. - For a more robust and feature-rich implementation, we recommend using the - `create_react_agent` function from the LangGraph library. - See the - [reference doc](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent) - for more information. + + This implementation is based on the foundational ReAct paper but is older and + not well-suited for production applications. + + For a more robust and feature-rich implementation, we recommend using the + `create_agent` function from the `langchain` library. + + See the + [reference doc](https://reference.langchain.com/python/langchain/agents/) + for more information. Args: llm: LLM to use as the agent. diff --git a/libs/langchain/langchain_classic/chains/llm_checker/base.py b/libs/langchain/langchain_classic/chains/llm_checker/base.py index 9db3194fb3d..3f2cd4a63de 100644 --- a/libs/langchain/langchain_classic/chains/llm_checker/base.py +++ b/libs/langchain/langchain_classic/chains/llm_checker/base.py @@ -68,7 +68,7 @@ def _load_question_to_checked_assertions_chain( message=( "See LangGraph guides for a variety of self-reflection and corrective " "strategies for question-answering and other tasks: " - "https://langchain-ai.github.io/langgraph/tutorials/rag/langgraph_self_rag/" + "https://docs.langchain.com/oss/python/langchain/overview" ), removal="1.0", ) diff --git a/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py b/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py index d8c9d096be1..4625df49ada 100644 --- a/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py +++ b/libs/langchain/langchain_classic/chains/llm_summarization_checker/base.py @@ -73,7 +73,7 @@ def _load_sequential_chain( message=( "See LangGraph guides for a variety of self-reflection and corrective " "strategies for question-answering and other tasks: " - "https://langchain-ai.github.io/langgraph/tutorials/rag/langgraph_self_rag/" + "https://docs.langchain.com/oss/python/langgraph/agentic-rag" ), removal="1.0", ) diff --git a/libs/langchain/langchain_classic/chains/mapreduce.py b/libs/langchain/langchain_classic/chains/mapreduce.py index 1845439f7a6..6fe1c71f079 100644 --- a/libs/langchain/langchain_classic/chains/mapreduce.py +++ b/libs/langchain/langchain_classic/chains/mapreduce.py @@ -32,9 +32,8 @@ from langchain_classic.chains.llm import LLMChain removal="1.0", message=( "Refer to migration guide here for a recommended implementation using " - "LangGraph: https://python.langchain.com/docs/versions/migrating_chains/map_reduce_chain/" - ". See also LangGraph guides for map-reduce: " - "https://langchain-ai.github.io/langgraph/how-tos/map-reduce/." + "LangGraph: https://docs.langchain.com/oss/python/langgraph/graph-api#map-reduce-and-the-send-api" + "." ), ) class MapReduceChain(Chain): diff --git a/libs/langchain/langchain_classic/memory/summary.py b/libs/langchain/langchain_classic/memory/summary.py index bd3d6e86895..32b3acb05ea 100644 --- a/libs/langchain/langchain_classic/memory/summary.py +++ b/libs/langchain/langchain_classic/memory/summary.py @@ -21,7 +21,7 @@ from langchain_classic.memory.prompt import SUMMARY_PROMPT removal="1.0", message=( "Refer here for how to incorporate summaries of conversation history: " - "https://langchain-ai.github.io/langgraph/how-tos/memory/add-summary-conversation-history/" + "https://docs.langchain.com/oss/python/langgraph/add-memory#summarize-messages" ), ) class SummarizerMixin(BaseModel):