The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
docs[patch]: Add ReAct agent conceptual guide, improve search (#23554)
Jacob Lee47f69fe0d850
diff --git a/docs/docs/concepts.mdx b/docs/docs/concepts.mdxindex c0be58b56f..410bca3938 100644--- a/docs/docs/concepts.mdx+++ b/docs/docs/concepts.mdx@@ -550,6 +550,28 @@ If you are still using AgentExecutor, do not fear: we still have a guide on [howIt is recommended, however, that you start to transition to LangGraph.In order to assist in this we have put together a [transition guide on how to do so](/docs/how_to/migrate_agent).+#### ReAct agents+<span data-heading-keywords="react,react agent"></span>++One popular architecture for building agents is [**ReAct**](https://arxiv.org/abs/2210.03629).+ReAct combines reasoning and acting in an iterative process - in fact the name "ReAct" stands for "Reason" and "Act".++The general flow looks like this:++- The model will "think" about what step to take in response to an input and any previous observations.+- The model will then choose an action from available tools (or choose to respond to the user).+- The model will generate arguments to that tool.+- The agent runtime (executor) will parse out the chosen tool and call it with the generated arguments.+- The executor will return the results of the tool call back to the model as an observation.+- This process repeats until the agent chooses to respond.++There are general prompting based implementations that do not require any model-specific features, but the most+reliable implementations use features like [tool calling](/docs/how_to/tool_calling/) to reliably format outputs+and reduce variance.++Please see the [LangGraph documentation](https://langchain-ai.github.io/langgraph/) for more information,+or [this how-to guide](/docs/how_to/migrate_agent/) for specific information on migrating to LangGraph.+### CallbacksLangChain provides a callbacks system that allows you to hook into the various stages of your LLM application. This is useful for logging, monitoring, streaming, and other tasks.diff --git a/docs/docs/how_to/migrate_agent.ipynb b/docs/docs/how_to/migrate_agent.ipynbindex 3ca7441db6..93c1e79705 100644--- a/docs/docs/how_to/migrate_agent.ipynb+++ b/docs/docs/how_to/migrate_agent.ipynb@@ -1,5 +1,19 @@{"cells": [+ {+ "cell_type": "raw",+ "id": "adc7ee09",+ "metadata": {+ "vscode": {+ "languageId": "raw"+ }+ },+ "source": [+ "---\n",+ "keywords: [create_react_agent, create_react_agent()]\n",+ "---"+ ]+ },{"cell_type": "markdown","id": "457cdc67-1893-4653-8b0c-b185a5947e74",@@ -9,7 +23,7 @@"\n","Here we focus on how to move from legacy LangChain agents to LangGraph agents.\n","LangChain agents (the [AgentExecutor](https://api.python.langchain.com/en/latest/agents/langchain.agents.agent.AgentExecutor.html#langchain.agents.agent.AgentExecutor) in particular) have multiple configuration parameters.\n",- "In this notebook we will show how those parameters map to the LangGraph [react agent executor](https://langchain-ai.github.io/langgraph/reference/prebuilt/#create_react_agent).\n",+ "In this notebook we will show how those parameters map to the LangGraph react agent executor using the [create_react_agent](https://langchain-ai.github.io/langgraph/reference/prebuilt/#create_react_agent) prebuilt helper method.\n","\n","#### Prerequisites\n","\n",diff --git a/docs/docs/how_to/tool_calling.ipynb b/docs/docs/how_to/tool_calling.ipynbindex e9f4f34890..dd900c80a1 100644--- a/docs/docs/how_to/tool_calling.ipynb+++ b/docs/docs/how_to/tool_calling.ipynb@@ -1,5 +1,18 @@{"cells": [+ {+ "cell_type": "raw",+ "metadata": {+ "vscode": {+ "languageId": "raw"+ }+ },+ "source": [+ "---\n",+ "keywords: [tool calling, tool call]\n",+ "---"+ ]+ },{"cell_type": "markdown","metadata": {},