Create_react_agent internal loop

Yes, create_react_agent().invoke() runs a complete loop internally and returns the final result, similar to AgentExecutor. The difference is that create_react_agent creates a LangGraph-based agent which offers better state management, streaming, and debugging capabilities compared to the legacy AgentExecutor.

To see intermediate steps (Action/Thought outputs), use streaming instead of invoke():

for event in langgraph_agent.stream({"messages": [("human", query)]}):
    print(event)  # Shows each step including tool calls and thoughts

Or use astream_events() for more granular control over what intermediate data you want to observe during execution.