langgraph/how-tos/react-agent-from-scratch/ #1657
Replies: 8 comments 20 replies
-
Great tutorial, but I'm curious: Where's the explicit reasoning step? Doesn't a true ReAct agent show 'Thought, Action, Observation' cycles? This looks more like a tool-using agent. Shouldn't we see the agent's 'Thought' process before each action? Without explicit thought steps, could this lead to less thorough reasoning and potentially worse performance in complex tasks? |
Beta Was this translation helpful? Give feedback.
-
If there were more than one tool available, then the model in |
Beta Was this translation helpful? Give feedback.
-
Why do you import END twice? from langgraph.graph import StateGraph, END |
Beta Was this translation helpful? Give feedback.
-
This guide is misleading as there is no ReAct prompting and all the reasoning steps are missing. This agent can be called simple "Function calling Agent" or something. |
Beta Was this translation helpful? Give feedback.
-
Petition to change this as its misleading |
Beta Was this translation helpful? Give feedback.
-
I don't think, this is a React agent. As per ReAct paper LLM is explicitly asked to process a query in Thought, Action input, Action and Observation in N loop till its get a final answer and providing tools inside the prompt itself. There the problem is its difficult to parse the tool and tool arguments from natural text output and most of builtin parsers are failing. Here, you bind LLM with tools, the agent will only provide tool call as response, not content untill and unless its a final answer and since there is no thoughts and observations are coming as texts in intermediate steps, we cannot append this to the scratch pad of LLM to track its previous thoughts and actions, this approach wont work to trigger LLM reasoning skills. What you are showing here is just a tool calling agent with some basic prompts.. See, this is an official documentation and you are not supposed to give misleading info. Please provide some good React agent parsers that can parse the tools, arguments effectively from React parsers or provide the bind_tool function has the capability to display reasoning steps that can stand apart from content so that we can append those intermediate steps to scratch pad. |
Beta Was this translation helpful? Give feedback.
-
is there a javascript implementation to this? |
Beta Was this translation helpful? Give feedback.
-
I dont why langchain is making things complicated. The create_react_agent of langchain 0.2 makes much sense and it works well. |
Beta Was this translation helpful? Give feedback.
-
langgraph/how-tos/react-agent-from-scratch/
Build language agents as graphs
https://langchain-ai.github.io/langgraph/how-tos/react-agent-from-scratch/
Beta Was this translation helpful? Give feedback.
All reactions