Get started
In this section10xGraph turns a Python agent into a production server and keeps it correct when a run crashes mid-tool. Start here for install, first agent and client.
- 4 pages
- About 16 min to read all
10xGraph is an open-source Python framework for production multi-agent AI. You write the agent. 10xGraph generates the production server around it (REST, SSE streaming and WebSocket endpoints, auth, owner-only threads, scoped access control, rate limits, Docker and Kubernetes files) and keeps runs correct under failure: a crashed run does not execute a finished tool twice.
What you write
A graph of agents and tools in plain Python. Use the prebuilt ReactAgent for the standard tool-calling loop, or build your own StateGraph.
from tenxgraph.prebuilt.agent import ReactAgent
from tenxgraph.storage.checkpointer import InMemoryCheckpointer
def lookup_order(order_id: str) -> dict:
"""Look up an order by id and return its status and total."""
return {"order_id": order_id, "status": "delivered", "total": 59.0}
def refund_order(order_id: str, amount: float) -> str:
"""Refund an order. This moves money, so it must run exactly once."""
return f"Refunded {amount:.2f} for order {order_id}"
app = ReactAgent(
model="google/gemini-2.5-flash",
provider="google",
system_prompt=[{"role": "system", "content": "You are a support agent for an online shop."}],
tools=[lookup_order, refund_order],
).compile(checkpointer=InMemoryCheckpointer())Point the server at it:
{
"agent": "agent:app",
"env": ".env"
}10xgraph apiWhat 10xGraph generates
| Piece | What you get |
|---|---|
| API server | REST, SSE streaming, WebSocket and realtime audio endpoints on port 8000, with Swagger UI at /docs |
| Security | JWT or custom auth, owner-only threads, role scopes on every endpoint, rate limits |
| Reliability | Replay-safe tools, versioned state writes, node and tool timeouts |
| Deployment | 10xgraph build --docker-compose --k8s writes a Dockerfile, docker-compose.yml and k8s.yaml |
| Client | An official typed TypeScript client, and a playground via 10xgraph play |
Core library features such as graph orchestration, MCP tools, streaming and checkpointing are in the box too. They are the foundation, not the reason to pick the framework.
Try it without client code
Open http://localhost:8000/docs for the interactive Swagger UI, run 10xgraph play for the playground, or call the invoke endpoint with curl:
curl -X POST "http://localhost:8000/v1/graph/invoke" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": [{"type": "text", "text": "Where is order 1042?"}]}],
"config": {"thread_id": "test-001"}
}'Build your way
Six prebuilt agents cover common patterns, and all of them compile to a graph you can serve.
| Agent | Pattern |
|---|---|
ReactAgent |
Reason-Act loop, the standard tool-calling agent |
RAGAgent |
Retrieval-augmented generation with your vector store |
SupervisorTeamAgent |
A supervisor that routes tasks to specialist sub-agents |
SwarmAgent |
Peer agents that hand off to each other based on context |
PlanActReflectAgent |
Plan, execute, reflect, and revise until the goal is met |
StructuredOutputAgent |
Agent that returns a typed, validated response schema |
When a prebuilt is too rigid (custom state, non-linear routing), build the graph yourself with StateGraph. See StateGraph.
10xGraph was published as Agentflow until 2026. Python code now imports from tenxgraph, for example from tenxgraph.core.graph import StateGraph. The old agentflow import stays available as a deprecated alias until 2.0.
Prerequisites
- Python 3.12 or newer
- A key for one LLM provider:
OPENAI_API_KEY,GEMINI_API_KEY(orGOOGLE_API_KEY) orANTHROPIC_API_KEY
Golden path
| Step | Page | What you will have at the end |
|---|---|---|
| 1 | Installation | Python packages, optional extras and the TypeScript client |
| 2 | Quickstart | A running agent served over HTTP and called from curl and TypeScript |
| 3 | Project structure | Every file the production template generates |
All pages in Get started
- IntroductionWhat 10xGraph is, what it generates for you, and where to start. An open-source Python framework for production multi-agent AI.5 min
- InstallationInstall 10xGraph and the API server with pip on Python 3.12 or newer, add provider extras and a checkpointer, verify the CLI, and install the TypeScript client.3 min
- QuickstartInstall 10xGraph, build a support agent in Python, serve it with the API server, then call it with curl and the TypeScript client.4 min
- Project structureThe files that 10xgraph init --template production generates, what each one does, and what every key in the generated 10xgraph.json controls.4 min