# Is create\_agent formally producing a ReAct agent?

**URL:** <https://forum.langchain.com/t/is-create-agent-formally-producing-a-react-agent/2066>\
**Category:** LangChain\
**Tags:** python-help\
**Created:** [November 3, 2025, 10:18am UTC](https://forum.langchain.com/t/is-create-agent-formally-producing-a-react-agent/2066 "2025-11-03T10:18:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric-burel](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/eric-burel/32/712_2.png) [@eric-burel](https://forum.langchain.com/u/eric-burel)\
**Post date:** [November 3, 2025, 10:18am UTC](https://forum.langchain.com/t/is-create-agent-formally-producing-a-react-agent/2066/1 "2025-11-03T10:18:44Z")

</div>

This function seems to replace `create_react_agent` and the mix of system prompt + tools is typical of ReAct agent. Yet one ingredient seems to be missing, from the quickstart doc I am reading: the agent loop. Is it built-in? Is the agent expected to run in loops and can I control this loop? I haven’t found the relevant APIs yet.  
This doc seems to imply that there is a loop: [Agents - Docs by LangChain](https://docs.langchain.com/oss/python/langchain/agents)  
But I don’t see much control over the loop.

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [November 3, 2025, 10:57am UTC](https://forum.langchain.com/t/is-create-agent-formally-producing-a-react-agent/2066/2 "2025-11-03T10:57:29Z")

</div>

hi @eric-burel

Yes - create\_agent constructs a LangGraph StateGraph that implements a ReAct-style loop (model → tools → model …) and runs until a stop condition is met. The loop is built-in.

**How to control the loop** :

- **Limit iterations** via the LangGraph executor’s `recursion_limit` config when invoking/streaming the agent:

```auto
assert app.invoke(
    {"messages": [HumanMessage(content="what is weather in sf")]},
    {"recursion_limit": 2},
    debug=True,
) == {
    "messages": [
        _AnyIdHumanMessage(content="what is weather in sf"),
        _AnyIdAIMessage(content="Sorry, need more steps to process this request."),
    ]
}

```

- **Exit early** when a tool has `return_direct=True` or when a structured output tool completes (see code excerpts above).
- **Skip the loop entirely** by passing no tools; the graph becomes a single `model` node (no tool-calling loop).
- **Programmatic control** with middleware: set `state["jump_to"]` to `"model" | "tools" | "end"` to steer or terminate the loop (see `_resolve_jump` and the conditional edges around it in the same file).
- **Pause/resume** specific nodes with `interrupt_before` / `interrupt_after` (useful for human-in-the-loop UIs); these are exposed in `create_agent(...).compile(...)` arguments.
