This release is a pre-release and may not be stable for production use.
10xGraph (formerly Agentflow) is a Python framework for multi-agent AI systems that stay correct under failure: replay-safe tool calls that are not re-executed after a crash, versioned state writes, real node and tool timeouts, and two-tier Redis plus PostgreSQL checkpointing. MIT licensed, self-hosted, any model (OpenAI, Google Gemini, Anthropic). Pair it with 10xgraph-api to generate the production server around your graph.
pip install 10xgraph==1.0.0rc4 Copy PIP instructions
Formerly Agentflow. 10xGraph by 10xScale: graph engineering for production AI agents.
10xGraph is an open-source Python framework for building multi-agent AI systems and running them in production. You write the agent as a graph of nodes and tools. 10xGraph keeps tool calls from running twice after a crash, guards state writes, enforces timeouts, and, with the 10xgraph-api package, generates the API server around the graph.
This repository is the core engine (PyPI 10xgraph, import tenxgraph). The docs live at 10xgraph.com.
2. The production server ships in the box (10xgraph-api, MIT)
10xgraph-api generates the production server around your compiled graph: REST, NDJSON streaming, WebSocket and realtime-audio endpoints; JWT or custom auth; scoped authorization on every endpoint; thread ownership isolation; rate limiting; and Docker Compose and Kubernetes files. You drive it with the 10xgraph command (10xgraph init, 10xgraph api, 10xgraph build). See the ecosystem table.
Also included (standard for agent frameworks, listed as facts): graph orchestration and the ReAct tool-calling loop, parallel tool execution, OpenAI, Google Gemini and Anthropic support, MCP tools, streaming, and checkpointing to a database.
pip install 10xgraph Provider SDKs and infrastructure integrations are optional extras. Install only what you use:
pip install "10xgraph[google-genai,openai,anthropic,mcp,pg_checkpoint]" Then set your provider key. A .env file in the working directory is loaded automatically.
export GEMINI_API_KEY=... # Google Gemini export OPENAI_API_KEY=sk-... # OpenAI, or any OpenAI-compatible endpoint export ANTHROPIC_API_KEY=sk-... # Anthropic Claude Requires Python 3.12 or newer. Tested on 3.12, 3.13, 3.14 and 3.15.
lookup_order reads data. refund_order moves money, so it pauses for a human decision with interrupt() before it acts. With a checkpointer, a crash or retry after the refund does not issue it twice.
from tenxgraph.core.state import Message from tenxgraph.prebuilt.agent import ReactAgent from tenxgraph.storage.checkpointer import InMemoryCheckpointer from tenxgraph.utils import interrupt def lookup_order(order_id: str) -> dict: """Look up an order by id.""" return {"order_id": order_id, "status": "delivered", "total": 42.00} def refund_order(order_id: str, amount: float) -> str: """Refund an order. Requires approval.""" decision = interrupt({"amount": amount}, message=f"Refund ${amount}?") if not decision.get("approved"): return "Refund declined by reviewer." return f"Refunded ${amount} for order {order_id}." app = ReactAgent( model="gemini/gemini-2.5-flash", system_prompt=[{"role": "system", "content": "You are a support agent for an online store."}], tools=[lookup_order, refund_order], ).compile(checkpointer=InMemoryCheckpointer()) config = {"thread_id": "1"} result = app.invoke( {"messages": [Message.text_message("Order A-1001 arrived broken, please refund it.")]}, config=config, ) # The run pauses inside refund_order. After a reviewer approves: result = app.invoke({"resume": {"approved": True}}, config) Swap ReactAgent for RAGAgent, SwarmAgent, SupervisorTeamAgent or PlanActReflectAgent and the shape stays the same. Use PgCheckpointer (Postgres plus Redis) in production, or SqliteCheckpointer for local work.
async for chunk in app.astream( {"messages": [Message.text_message("Where is order A-1001?")]}, config={"thread_id": "2"}, ): print(chunk.model_dump()) Add MCP tools by passing a fastmcp client; remote tools join your local ones:
from fastmcp import Client mcp_client = Client({ "mcpServers": { "orders": {"url": "http://127.0.0.1:8000/mcp", "transport": "streamable-http"}, } }) app = ReactAgent( model="gemini/gemini-2.5-flash", tools=[lookup_order], client=mcp_client, ).compile() Building your own graph Prebuilt agents are graphs. When you need custom control flow, build one directly:
from tenxgraph.core.graph import Agent, StateGraph, ToolNode from tenxgraph.core.state import AgentState from tenxgraph.utils.constants import END graph = StateGraph() graph.add_node("MAIN", Agent( model="gemini/gemini-2.5-flash", system_prompt=[{"role": "system", "content": "You are a support agent."}], tool_node="TOOL", )) graph.add_node("TOOL", ToolNode([lookup_order, refund_order])) def route(state: AgentState) -> str: if state.context and state.context[-1].tools_calls: return "TOOL" return END graph.add_conditional_edges("MAIN", route, {"TOOL": "TOOL", END: END}) graph.add_edge("TOOL", "MAIN") graph.set_entry_point("MAIN") app = graph.compile() Nodes can be plain functions too, so you can call a provider SDK directly. See examples/react/.
Live audio-to-audio sessions over Gemini Live. The provider owns the turn loop, so the session runs through arealtime: you push into an input queue and consume normalized events.
from tenxgraph.prebuilt.agent import AudioAgent from tenxgraph.core.realtime import LiveInputQueue, RealtimeConfig app = AudioAgent( "gemini-3.8-live", realtime_config=RealtimeConfig(model="gemini-3.8-live", voice="Puck"), tools=[lookup_order], ).compile() queue = LiveInputQueue() queue.send_audio(pcm16_bytes) # non-blocking, safe to call from an audio callback async for event in app.arealtime(queue, {"thread_id": "t1"}): ... # AudioDeltaEvent / transcripts / ToolCallEvent / ... queue.close() Barge-in, persisted transcripts (raw audio is never stored), automatic reconnect with session resumption, and image/video frame input are handled for you. system_prompt, skills, and memory work as they do on any other agent. Needs pip install "10xgraph[realtime]".
10xGraph is the new name of Agentflow. The framework, license and maintainers are the same. 10xscale-agentflow 0.10.1 is its last release.
pip uninstall 10xscale-agentflow pip install 10xgraph Uninstall first: both distributions provide the agentflow module and must not be installed side by side.
# before from agentflow.core.graph import StateGraph # after from tenxgraph import StateGraph The import name is tenxgraph because a Python identifier cannot start with a digit. All canonical paths are the old ones with agentflow replaced by tenxgraph (for example tenxgraph.core.graph, tenxgraph.storage.checkpointer, tenxgraph.prebuilt.agent). import agentflow keeps working as a deprecated alias until 2.0, with one DeprecationWarning.
Other renamed identifiers (old values still work where noted):
pip install 10xgraph-api # pulls in 10xgraph 10xgraph init --path my-agent && cd my-agent 10xgraph api # REST and WebSocket API on :8000 10xgraph play # server plus playground 10xgraph build --docker-compose --k8s A production scaffold with JWT auth and Redis rate limiting:
10xgraph init --path my-agent --yes --template production --auth jwt --rate-limit redis Examples Runnable scripts in examples/:
export GEMINI_API_KEY=... # or OPENAI_API_KEY python examples/react/react_single_class.py Some examples still use pre-rename import paths; the canonical paths are listed in CLAUDE.md.
Every person above shipped code that now runs inside production agents. Merge one pull request and you join them, here and on the contributor page at 10xgraph.com/maintainers.
Your first pull request can be small. These are real, self-contained, and useful today:
git clone https://github.com/10xGraph/10xGraph.git cd 10xGraph uv sync --dev uv run pytest uv run ruff check . uv run mypy tenxgraph/ Draft pull requests are welcome, so open early and ask questions in the PR. For bigger changes, start a thread in Discussions first so the work does not overlap. CONTRIBUTING.md has the full workflow, and the Code of Conduct applies everywhere.
Found a vulnerability? Do not open a public issue. Follow the process in SECURITY.md.
google-genai realtime openai anthropic anthropic-vertex anthropic-bedrock pg-checkpoint sqlite-checkpoint mcp images cloud-storage redis kafka rabbitmq qdrant mem0 a2a-sdk otel logfire langsmith observability all-publishers all
agent agents ai-agents multi-agent multi-agent-systems agentic-ai agent-framework agent-orchestration workflow-engine state-machine stategraph graph llm llm-framework llm-orchestration genai generative-ai production self-hosted fault-tolerance idempotency durable-state checkpointing human-in-the-loop redis postgresql openai anthropic claude gemini google-genai mcp model-context-protocol tool-use function-calling react-agent rag memory vector-store qdrant mem0 a2a realtime-audio opentelemetry kafka 10xgraph agentflow
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




