# langgraph-prebuilt

> Library with high-level APIs for creating and executing LangGraph agents and tools.

- **URL**: https://www.freshcrate.ai/projects/langgraph-prebuilt
- **Author**: pypi
- **Category**: AI Agents
- **Latest version**: `1.2.4` (2026-06-02)
- **License**: Unknown
- **Source**: https://github.com/langchain-ai/langgraph/tree/main/libs/prebuilt
- **Homepage**: https://pypi.org/project/langgraph-prebuilt/
- **Language**: Python
- **GitHub**: 29,892 stars, 5,113 forks
- **Registry**: pypi (`langgraph-prebuilt`)
- **Tags**: `pypi`

## Description

# LangGraph Prebuilt

This library defines high-level APIs for creating and executing LangGraph agents and tools.

> [!IMPORTANT]
> This library is meant to be bundled with `langgraph`, don't install it directly

## Agents

`langgraph-prebuilt` provides an [implementation](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent) of a tool-calling [ReAct-style](https://langchain-ai.github.io/langgraph/concepts/agentic_concepts/#react-implementation) agent - `create_react_agent`:

```bash
pip install langchain-anthropic
```

```python
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent

# Define the tools for the agent to use
def search(query: str):
    """Call to surf the web."""
    # This is a placeholder, but don't tell the LLM that...
    if "sf" in query.lower() or "san francisco" in query.lower():
        return "It's 60 degrees and foggy."
    return "It's 90 degrees and sunny."

tools = [search]
model = ChatAnthropic(model="claude-3-7-sonnet-latest")

app = create_react_agent(model, tools)
# run the agent
app.invoke(
    {"messages": [{"role": "user", "content": "what is the weather in sf"}]},
)
```

## Tools

### ToolNode

`langgraph-prebuilt` provides an [implementation](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_node.ToolNode) of a node that executes tool calls - `ToolNode`:

```python
from langgraph.prebuilt import ToolNode
from langchain_core.messages import AIMessage

def search(query: str):
    """Call to surf the web."""
    # This is a placeholder, but don't tell the LLM that...
    if "sf" in query.lower() or "san francisco" in query.lower():
        return "It's 60 degrees and foggy."
    return "It's 90 degrees and sunny."

tool_node = ToolNode([search])
tool_calls = [{"name": "search", "args": {"query": "what is the weather in sf"}, "id": "1"}]
ai_message = AIMessage(content="", tool_calls=tool_calls)
# execute tool call
tool_node.invoke({"messages": [ai_message]})
```

### ValidationNode

`langgraph-prebuilt` provides an [implementation](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_validator.ValidationNode) of a node that validates tool calls against a pydantic schema - `ValidationNode`:

```python
from pydantic import BaseModel, field_validator
from langgraph.prebuilt import ValidationNode
from langchain_core.messages import AIMessage


class SelectNumber(BaseModel):
    a: int

    @field_validator("a")
    def a_must_be_meaningful(cls, v):
        if v != 37:
            raise ValueError("Only 37 is allowed")
        return v

validation_node = ValidationNode([SelectNumber])
validation_node.invoke({
    "messages": [AIMessage("", tool_calls=[{"name": "SelectNumber", "args": {"a": 42}, "id": "1"}])]
})
```

## Agent Inbox

The library contains schemas for using the [Agent Inbox](https://github.com/langchain-ai/agent-inbox) with LangGraph agents. Learn more about how to use Agent Inbox [here](https://github.com/langchain-ai/agent-inbox#interrupts).

```python
from langgraph.types import interrupt
from langgraph.prebuilt.interrupt import HumanInterrupt, HumanResponse

def my_graph_function():
    # Extract the last tool call from the `messages` field in the state
    tool_call = state["messages"][-1].tool_calls[0]
    # Create an interrupt
    request: HumanInterrupt = {
        "action_request": {
            "action": tool_call['name'],
            "args": tool_call['args']
        },
        "config": {
            "allow_ignore": True,
            "allow_respond": True,
            "allow_edit": False,
            "allow_accept": False
        },
        "description": _generate_email_markdown(state) # Generate a detailed markdown description.
    }
    # Send the interrupt request inside a list, and extract the first response
    response = interrupt([request])[0]
    if response['type'] == "response":
        # Do something with the response
    ...
```

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `1.2.4` | 2026-06-02 | High | Changes since 1.2.3  * release(langgraph): 1.2.4 (#7991) * test(sdk-py): add factory-graph integration test exercising the server factory path (#7978) * fix(langgraph): keep _on_started backward-compatible with overrides predating cause (#7987) |
| `sdk==0.4.0` | 2026-05-28 | High | Changes since sdk==0.3.15  * release(sdk-py): 0.4.0 (#7923) * feat(sdk-py): add thread stream helpers (#7833) * feat(sdk-py): wire websocket stream selection (#7832) * feat(sdk-py): add websocket stream transports (#7830) * feat(sdk-py): harden streaming reconnects (#7829) * feat(sdk-py): add sync scoped subgraphs (#7828) * feat(sdk-py): add sync messages and tool calls (#7827) * feat(sdk-py): add sync thread stream core (#7826) * feat(sdk-py): add async stream reconnect support (#7825) * feat(s |
| `1.2.1` | 2026-05-21 | High | Changes since 1.2.0  * release(langgraph): 1.2.1 (#7883) * feat(langgraph): add `before_builtins` opt-in for stream transformers (#7882) * chore(deps): bump idna from 3.11 to 3.15 in /libs/langgraph (#7866) * fix(langgraph): keep tool results out of v3 messages (#7838) * chore(deps): bump langsmith from 0.7.31 to 0.8.0 in /libs/langgraph (#7788) |
| `1.2.0` | 2026-05-12 | High | Changes since 1.2.0a7  * release: bump alpha packages to official versions (#7775) * feat(langgraph): durable error-handler resume across host crashes (#7773) * feat(langgraph): add set_node_defaults() to StateGraph (#7747) * chore(deps): bump urllib3 from 2.6.3 to 2.7.0 in /libs/langgraph (#7766) * chore(deps): bump mistune from 3.2.0 to 3.2.1 in /libs/langgraph (#7733) * chore(langgraph): bump langchain-core to 1.4.0 (#7767) * feat(checkpoint): force delta channel snapshot after max supersteps |
| `cli==0.4.25` | 2026-05-07 | High | Changes since cli==0.4.24  * release: bump cli version (#7734) * feat(cli): support studio deploy (#7394) * chore(deps): bump the minor-and-patch group in /libs/cli with 4 updates (#7674) * chore(deps): bump the minor-and-patch group in /libs/cli/js-examples with 8 updates (#7673) * chore(deps): bump the minor-and-patch group in /libs/cli/js-monorepo-example with 7 updates (#7671) * chore: update x links to langchain_oss (#7645) |
| `1.2.0a5` | 2026-05-01 | High | Changes since 1.2.0a4  * release: alpha bump prebuilt 1.1.0a2, langgraph 1.2.0a5 (#7682) * fix(langgraph): coerce dict/str writes in _messages_delta_reducer (#7680) |
| `1.1.10` | 2026-04-27 | High | Changes since 1.1.9  * release(prebuilt): 1.0.12, langgraph 1.1.10 (#7623) * Revert "chore: node-level timeouts" (#7627) * release(checkpoint): 4.0.3 (#7625) * chore(deps): bump nbconvert from 7.17.0 to 7.17.1 in /libs/langgraph (#7573) * chore(deps): bump python-dotenv from 1.2.1 to 1.2.2 in /libs/langgraph (#7574) * chore: node-level timeouts (#7599) * release(prebuilt): 1.0.11 (#7610) * feat(prebuilt): allow ToolNode tools to return list[Command \| ToolMessage] (#7596) |
| `cli==0.4.24` | 2026-04-22 | High | Changes since cli==0.4.23  * chore: mixup cli formatting (#7585) * chore(deps): bump the pip group across 3 directories with 1 update (#7537) |
| `1.0.10` | 2026-04-21 | Low | Imported from PyPI (1.0.10) |
| `1.1.9` | 2026-04-21 | High | Changes since 1.1.8  * chore(langgraph): bump version 1.1.8 -> 1.1.9 (#7563) * fix(langgraph): don't propagate ReplayState to subgraphs on plain resume (#7561) * chore(langgraph): undo unnecessary changes in stream handler (#7536) |

## Citation

- HTML: https://www.freshcrate.ai/projects/langgraph-prebuilt
- Markdown: https://www.freshcrate.ai/projects/langgraph-prebuilt.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/langgraph-prebuilt/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
