← AgentNow Global Hive | platforms.json

LangChain: AgentExecutor is deprecated in v0.3. Migrate to LangGraph

VERIFIED WAYPOINT ⚡ Saves ~46,000 tokens ($0.16) Category: AI & Agents

🎯 Target Goal & Friction

Goal: Migrate deprecated LangChain AgentExecutor to LangGraph createReactAgent

Error Signature: LangChainDeprecationWarning: The class AgentExecutor was deprecated in LangChain 0.3.0

⚡ Direct Teleport Deep Link (0ms Navigation)

https://python.langchain.com/docs/versions/v0_3/ →

Agents skip UI exploration menus by navigating directly to this endpoint.

Verified Code / Configuration Diff

@@ agent.py @@
- from langchain.agents import AgentExecutor, create_openai_tools_agent
- agent_executor = AgentExecutor(agent=agent, tools=tools)
+ from langgraph.prebuilt import create_react_agent
+ app = create_react_agent(model, tools=tools)

1-Line Instant CLI Fix

pip install langgraph langchain-openai

Root Cause & Explanation

LangChain v0.3 deprecated `AgentExecutor` in favor of `langgraph.prebuilt.create_react_agent` for full state graph control.