developer resources

Documentation

Everything you need to build production-ready agents with AgentFlow

/
code example

Define your graph in a few lines

AgentFlow gives you a clean, declarative API to define nodes, edges, and conditional routing. Build complex agent workflows with minimal boilerplate.

# Define a simple agent graph
from agentflow import StateGraph, END
# Create the graph
graph = StateGraph(AgentState)
# Add nodes
graph.add_node("agent", call_model)
graph.add_node("tools", run_tools)
# Set entry point
graph.set_entry_point("agent")
# Add conditional edges
graph.add_conditional_edges(
"agent",
should_continue,
{
"continue": "tools",
"end": END,
}
)
# Connect tools back to agent
graph.add_edge("tools", "agent")
# Compile and run
app = graph.compile()
result = app.invoke({"messages": [user_input]})