Skip to content

The agent engineering platform.

docs(langchain-classic): warn about older `create_react_agent` (#35052)

Mason Daugherty751d8957ea8c
diff --git a/libs/langchain/langchain_classic/_api/deprecation.py b/libs/langchain/langchain_classic/_api/deprecation.py
index dd53c0cab0..fc53400ff1 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 9dce04145c..f1152d480b 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 9db3194fb3..3f2cd4a63d 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 d8c9d096be..4625df49ad 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 1845439f7a..6fe1c71f07 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 bd3d6e8689..32b3acb05e 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):