Library with high-level APIs for creating and executing LangGraph agents and tools.
Project Links
Meta
Requires Python: >=3.10
Classifiers
Development Status
- 5 - Production/Stable
Programming Language
- Python
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
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 of a tool-calling ReAct-style agent - create_react_agent:
pip install langchain-anthropic
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 of a node that executes tool calls - ToolNode:
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 of a node that validates tool calls against a pydantic schema - ValidationNode:
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 with LangGraph agents. Learn more about how to use Agent Inbox here.
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
...
1.0.9
Apr 03, 2026
1.0.8
Feb 19, 2026
1.0.7
Jan 22, 2026
1.0.6
Jan 12, 2026
1.0.5
Nov 20, 2025
1.0.4
Nov 13, 2025
1.0.3
Nov 13, 2025
1.0.2
Oct 29, 2025
1.0.1
Oct 20, 2025
1.0.0
Oct 17, 2025
0.7.0rc1
Oct 17, 2025
0.7.0a2
Sep 02, 2025
0.7.0a1
Aug 27, 2025
0.6.5
Oct 21, 2025
0.6.4
Aug 07, 2025
0.6.3
Aug 03, 2025
0.6.2
Jul 30, 2025
0.6.1
Jul 29, 2025
0.6.0
Jul 28, 2025
0.6.0a1
Jul 25, 2025
0.5.2
Jun 30, 2025
0.5.1
Jun 27, 2025
0.5.0
Jun 26, 2025
0.5.0rc0
Jun 17, 2025
0.2.3
Jun 26, 2025
0.2.2
May 28, 2025
0.2.1
May 23, 2025
0.2.0
May 22, 2025
0.1.8
Apr 03, 2025
0.1.7
Mar 26, 2025
0.1.6
Mar 25, 2025
0.1.5
Mar 25, 2025
0.1.4
Mar 21, 2025
0.1.3
Mar 13, 2025
0.1.2
Mar 06, 2025
0.1.1
Feb 27, 2025
0.1.0
Feb 27, 2025