# Node name of the agent graph which is created by prebuilt.create\_react\_agent

**URL:** <https://forum.langchain.com/t/node-name-of-the-agent-graph-which-is-created-by-prebuilt-create-react-agent/577>\
**Category:** LangGraph\
**Tags:** ambient-agents-with-, python-help\
**Created:** [July 20, 2025, 5:38pm UTC](https://forum.langchain.com/t/node-name-of-the-agent-graph-which-is-created-by-prebuilt-create-react-agent/577 "2025-07-20T17:38:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richpin](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/richpin/32/271_2.png) [@richpin](https://forum.langchain.com/u/richpin)\
**Post date:** [July 20, 2025, 5:38pm UTC](https://forum.langchain.com/t/node-name-of-the-agent-graph-which-is-created-by-prebuilt-create-react-agent/577/1 "2025-07-20T17:38:23Z")

</div>

Hi, this is Yoo.  
I’ve been used `prebuilt.create_react_agent` to make agents for making multi-agent system.

It’s super cool but the thing happened when I tried to stream the output of agents. I used stream function with paramter `stream_mode=messages` to stream LLM tokens generated by model. And I checked that `langgraph_node` of chunk’s metadata of all agents are the same as **‘agent’**. Below is the example of standard output of chunk → metadata → next chunk → next metadata sequentially.

```bash
content='\n' additional_kwargs={} response_metadata={} id='run--f567f474-6ee8-493f-b533-0a89269187a7'
{'thread_id': '975250e8-36a9-47af-afc5-0fb7420fa0db', 'langgraph_step': 3, 'langgraph_node': 'agent', 'langgraph_triggers': ('branch:to:agent',), 'langgraph_path': ('__pregel_pull', 'agent'), 'langgraph_checkpoint_ns': 'research_agent:f9beb20b-4112-7f3e-227a-5392c6a11448|agent:1bc3291f-4200-e125-bc8f-906557617fa0', 'checkpoint_ns': 'research_agent:f9beb20b-4112-7f3e-227a-5392c6a11448', 'ls_provider': 'openai', 'ls_model_name': 'gpt-4o-mini', 'ls_model_type': 'chat', 'ls_temperature': 0.5}
content='-' additional_kwargs={} response_metadata={} id='run--f567f474-6ee8-493f-b533-0a89269187a7'
{'thread_id': '975250e8-36a9-47af-afc5-0fb7420fa0db', 'langgraph_step': 3, 'langgraph_node': 'agent', 'langgraph_triggers': ('branch:to:agent',), 'langgraph_path': ('__pregel_pull', 'agent'), 'langgraph_checkpoint_ns': 'research_agent:f9beb20b-4112-7f3e-227a-5392c6a11448|agent:1bc3291f-4200-e125-bc8f-906557617fa0', 'checkpoint_ns': 'research_agent:f9beb20b-4112-7f3e-227a-5392c6a11448', 'ls_provider': 'openai', 'ls_model_name': 'gpt-4o-mini', 'ls_model_type': 'chat', 'ls_temperature': 0.5}

```

So I was not able to **distinguish which chunk came from which agents**. This is because the name of LLM calling node is hardcoded as ‘agent’ in the `prebuilt.create_react_agent`. Since there is `name` parameter in the create\_react\_agent function, it’s for graph-level, not node-level. So what I did was modifying node name as given ‘name’ parameter temporarily in the function.

For my example, I wanted to only stream output of supevisor agent which is created by `create_supervisor` function from `langgraph-supervisor` which also uses `create_react_agent` internally.

Since I don’t know langgraph that deeply, I wonder if there is some fancy way to handle this.

However, I still think that If this function could optionally receive parameters from the user and dynamically modify the LLM node name, it would make the distinction clearer and allow for more flexible handling of different situations. If this is considered to make sense, I really hope to make a PR for this, receive feedbacks, and contributes this amazing frameworks!!!😃

I ask for maintainer’s help.

Best Regards,

---

<div class="post-metadata">

**Author:** ![AbdulBasit](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/abdulbasit/32/72_2.png) [@AbdulBasit](https://forum.langchain.com/u/AbdulBasit)\
**Post date:** [July 22, 2025, 8:31am UTC](https://forum.langchain.com/t/node-name-of-the-agent-graph-which-is-created-by-prebuilt-create-react-agent/577/2 "2025-07-22T08:31:32Z")

</div>

You’re correct that `create_react_agent` hardcodes the node name as “agent”, making it difficult to distinguish between multiple agents in a multi agent system when streaming. The `name` parameter only affects the graph name, not the internal node names.

Your approach of modifying the node name based on the `name` parameter makes perfect sense and would be a valuable contribution. Currently, there’s no built in way to customize internal node names in prebuilt agents. A potential solution would be to modify `create_react_agent` to accept an optional `node_name` parameter that defaults to “agent” but allows customization.

For your immediate use case, you could create a custom version of `create_react_agent` that accepts a `node_name` parameter, or wrap the existing function to modify node names post-creation. This would definitely be a useful PR. The ability to distinguish between agents in multi agent streaming scenarios is a common need. I’d recommend proposing this enhancement on the LangGraph GitHub repository.

---

<div class="post-metadata">

**Author:** ![richpin](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/richpin/32/271_2.png) [@richpin](https://forum.langchain.com/u/richpin)\
**Post date:** [July 22, 2025, 1:47pm UTC](https://forum.langchain.com/t/node-name-of-the-agent-graph-which-is-created-by-prebuilt-create-react-agent/577/3 "2025-07-22T13:47:04Z")

</div>

I really appreciate your response which empowers my opinion, AbdulBasit 😄
