Library with high-level APIs for creating and executing LangGraph agents and tools.
Actively maintained. Last release 11 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install langgraph-prebuiltLangGraph Prebuilt
To help you ship LangGraph apps to production faster, check out LangSmith. LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.
Quick Install
uv add langgraph
🤔 What is this?
This library defines high-level APIs for creating and executing LangGraph agents and tools. It includes prebuilt components such as create_react_agent, ToolNode, validation helpers, and Agent Inbox schemas.
📖 Documentation
For full documentation, see the API reference. For conceptual guides and tutorials, see the LangGraph Docs.
[!IMPORTANT] This library is bundled with
langgraph; most users should installlanggraphinstead of installinglanggraph-prebuiltdirectly.
Agents
langgraph-prebuilt provides an implementation of a tool-calling ReAct-style agent - create_react_agent:
uv add 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"}]},
)