You are viewing the v1 docs for LangChain, which is currently under active development. Learn more.
1.0 Alpha releases are available for the following packages:
  • langchain
  • langchain-core
  • langchain-anthropic
  • langchain-openai
Broader support will be rolled out during the alpha period.

New features

LangChain 1.0 introduces new features:
  • A new .content_blocks property on message objects. This property provides a fully typed view of message content and standardizes modern LLM features across providers, including reasoning, citations, server-side tool calls, and more. There are no breaking changes associated with the new message content. Refer to the message content docs for more info.
  • New prebuilt langgraph chains and agents in langchain. The surface area of the langchain package has been reduced to focus on popular and essential abstractions. A new langchain-legacy package is available for backward compatibility. Refer to the new agents docs and to the release notes for more detail.

Breaking changes

Deprecations

Prebuilt agents

The langchain release focuses on reducing LangChain’s surface area and narrowing in on popular and essential abstractions.

ReAct agent migration

create_react_agent has moved from langgraph to langchain with significant enhancements: Enhanced structured output create_react_agent enhances coercion of outputs to structured data types:
from langchain.agents import create_react_agent
from langchain_core.messages import HumanMessage
from pydantic import BaseModel

class Weather(BaseModel):
    temperature: float
    condition: str

def weather_tool(city: str) -> str:
    """Get the weather for a city."""
    return f"it's sunny and 70 degrees in {city}"

agent = create_react_agent(
    "openai:gpt-4o-mini",
    tools=[weather_tool],
    response_format=Weather
)
result = agent.invoke({"messages": [HumanMessage("What's the weather in SF?")]})
print(repr(result["structured_response"]))
#> Weather(temperature=70.0, condition='sunny')
Structural improvements
  • Main loop integration: Structured output is now generated in the main loop instead of requiring an additional LLM call
  • Tool/output choice: Models can choose between calling tools, generating structured output, or both
  • Cost reduction: Eliminates extra expense from additional LLM calls
Advanced configuration Two strategies for structured output generation:
  1. Artificial tool calling (default for most models)
    • LangChain generates tools matching your response format schema
    • Model calls these tools, LangChain coerces args to desired format
  2. Provider implementations
    • Uses native structured output support when available
    • Configure with ProviderStrategy hint
Prompted output is no longer supported via the response_format argument.

Error handling

Structured output errors Control error handling via the handle_errors arg to ToolStrategy:
  • Parsing errors: Model generates data that doesn’t match desired structure
  • Multiple tool calls: Model generates 2+ tool calls for structured output schemas
Tool calling errors Updated error handling for tool failures:
  • Invocation failure: Agent returns artificial ToolMessage asking model to retry (unchanged)
  • Execution failure: Agent now raises ToolException by default instead of retrying (prevents infinite loops)
Configure behavior via handle_tool_errors arg to ToolNode.

Breaking changes

Pre-bound models To better support structured output, create_react_agent no longer supports pre-bound models with tools or configuration:
# No longer supported
model_with_tools = ChatOpenAI().bind_tools([some_tool])
agent = create_react_agent(model_with_tools, tools=[])

# Use instead
agent = create_react_agent("openai:gpt-4o-mini", tools=[some_tool])
Dynamic model functions can return pre-bound models if structured output is not used.
Import changes
# Before
from langgraph.prebuilts import create_react_agent, ToolNode, AgentState

# After
from langchain.agents import create_react_agent, ToolNode, AgentState

Reporting issues

Please report any issues discovered with 1.0 on GitHub using the 'v1' label.

See also