[GH-ISSUE #660] [langchain][v1]: Migrating from Legacy AgentExecutor to alpha version v1.0 #105

Open
opened 2026-02-17 17:19:11 -05:00 by yindo · 0 comments
Owner

Originally created by @MLemp86 on GitHub (Sep 26, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/660

Type of issue

question

Language

Python

Description

Hi all and thanks for your amazing work!

I am quite new to langchain and somewhat confused about the changes made in alpha version 1.0.
Prior to v 1.0 I used the legacy AgentExecutor and create_react_agent to build a ReAct agent, e.g.

prompt = hub.pull("hwchase17/react")

llm = get_openai_llm()

tools = [some tool]

agent = create_react_agent(llm, tools=tools, prompt=prompt)

agent_executor = AgentExecutor(
    agent=agent,
    tools=tools,
    verbose=True,
    return_intermediate_steps=True,
    handle_parsing_errors=True,
    max_iterations=10,
)

result = self.agent_executor.invoke({"input": "How are you"})

In that case I needed a react prompt template which specified the tool, the agent_scratchpad and so on.
By returning the intermediate steps I could observe messages, tool calls with input and outputs was well as reasoning steps.

As far as I have understood, in alpha v1.0, everything has been moved to langchain.agent.create_agent, while AgentExecutor and create_react_agent don't exist anymore.

So a ReAct agent according to v.1.0 would be:

llm = get_openai_llm()

tools = [some tool]

agent = create_agent(llm, tools=tools, prompt="My prompt")

result = self.agent.invoke(
    {"messages": [{"role": "user", "content": question}]}
)

Now I have the following questions:

  • The agent does not return reasoning steps anymore, why is that and how can I get them?
  • What happened to the react template? Is that not needed anymore?
  • When specifying a custom prompt, do I need to follow the ReAct template pattern or is this something that is done under the hood?
  • What happened to max iteration?
  • How can I get the final answer?

Thanks for taking the time to answer the above questions,

best regards,

M

Originally created by @MLemp86 on GitHub (Sep 26, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/660 ### Type of issue question ### Language Python ### Description Hi all and thanks for your amazing work! I am quite new to langchain and somewhat confused about the changes made in alpha version 1.0. Prior to v 1.0 I used the legacy AgentExecutor and create_react_agent to build a ReAct agent, e.g. ```python prompt = hub.pull("hwchase17/react") llm = get_openai_llm() tools = [some tool] agent = create_react_agent(llm, tools=tools, prompt=prompt) agent_executor = AgentExecutor( agent=agent, tools=tools, verbose=True, return_intermediate_steps=True, handle_parsing_errors=True, max_iterations=10, ) result = self.agent_executor.invoke({"input": "How are you"}) ``` In that case I needed a react prompt template which specified the tool, the agent_scratchpad and so on. By returning the intermediate steps I could observe messages, tool calls with input and outputs was well as reasoning steps. As far as I have understood, in alpha v1.0, everything has been moved to langchain.agent.create_agent, while AgentExecutor and create_react_agent don't exist anymore. So a ReAct agent according to v.1.0 would be: ```python llm = get_openai_llm() tools = [some tool] agent = create_agent(llm, tools=tools, prompt="My prompt") result = self.agent.invoke( {"messages": [{"role": "user", "content": question}]} ) ``` Now I have the following questions: - The agent does not return reasoning steps anymore, why is that and how can I get them? - What happened to the react template? Is that not needed anymore? - When specifying a custom prompt, do I need to follow the ReAct template pattern or is this something that is done under the hood? - What happened to max iteration? - How can I get the final answer? Thanks for taking the time to answer the above questions, best regards, M
yindo added the langchainexternal labels 2026-02-17 17:19:11 -05:00
yindo changed title from [langchain][v1]: Migrating from Legacy AgentExecutor to alpha version v1.0 to [GH-ISSUE #660] [langchain][v1]: Migrating from Legacy AgentExecutor to alpha version v1.0 2026-06-05 17:25:04 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#105