Tutorials
In this sectionStep-by-step 10xGraph tutorials built from the repository examples, covering agents, tools, streaming, MCP, memory, multi-agent handoff, testing and evaluation.
- 21 pages
- About 79 min to read all
10xGraph tutorials are guided walkthroughs of the example code in the repository’s examples/ folder. They sit between the quickstart pages and the reference: each one explains a working script, covering agents, custom state, tools, streaming, MCP, memory, multimodal input, multi-agent handoff, skills, testing and evaluation. They are for developers who learn best by reading and running real code.
Start here
Begin with the Agent Class pattern, the smallest useful graph. Continue with Custom state and the Tool decorator to see how state and tools are modeled, then assemble the loop in the ReAct agent tutorial.
For real-time output, React streaming and Stop stream cover token streaming and cancellation. For connecting outside systems, see MCP ReAct agent and Memory. The Testing and Evaluation tutorials show how to check an agent before release, and Graceful shutdown covers stopping cleanly.
Tutorials teach the library. To run an agent as a service, with auth and deployment, use the how-to guides and the beginner path.
Tutorial track
flowchart LR
A[Agent Class] --> B[Custom State]
A --> C[Tool Decorator]
A --> D[ReAct Agent]
A --> E[Google GenAI Adapter]
D --> F[ReAct Agent with Validation]
D --> G[React Streaming]
G --> H[Synchronous Streaming]
H --> I[Stop Stream]
I --> J[Dependency Injection]
J --> K[MCP Server]
K --> L[MCP Client]
L --> M[MCP ReAct Agent]
M --> N[GitHub MCP]
N --> O[MCP File Download]
O --> P[Memory]
P --> Q[Qdrant Memory]
Q --> R[Multimodal]
R --> S[Multiagent]
S --> T[Handoff]
T --> U[Skills]
U --> V[Skills Chat]
V --> W[Testing]
W --> X[Evaluation]
X --> Y[Graceful Shutdown]
From examples
These tutorials are based on code in examples/:
- Agent Class Pattern
- Custom State
- Google GenAI Adapter
- Tool Decorator
- ReAct Agent
- ReAct Agent with Validation
- React Streaming
- Stop Stream
Advanced integrations
- Dependency Injection
- MCP Server
- MCP Client
- MCP ReAct Agent
- GitHub MCP
- Memory
- Multimodal
- Multiagent
- Handoff
- Skills
- Testing
- Evaluation
- Graceful Shutdown
How to use this section
If you are new to 10xGraph, follow the pages in the order shown above. The tutorials are designed to build on each other:
- Start with
Agent Class Patternto learn the smallest useful graph. - Move to
Custom StateandTool Decoratorto understand how state and tools are modeled. - Use
ReAct Agentto assemble the core graph loop. - Add
ReAct Agent with Validationfor safer input handling. - Finish with the streaming tutorials to learn real-time output and cancellation patterns.
- Continue into the advanced section for MCP, memory, multimodal input, and multi-agent coordination.
- Finish with the sprint 9 tutorials to learn skills, testing, evaluation, and clean shutdown behavior.
Before you start
Most tutorials assume:
- Python 3.12 or later
- 10xGraph installed (
pip install 10xgraph) - Environment variables loaded from
.env - A provider key such as
GEMINI_API_KEYfor Google-based examples
Related docs
All pages in Tutorials
From examples
- Agent Class PatternBuild a weather-aware assistant using the Agent class, ToolNode, and conditional routing in a StateGraph.4 min
- Custom StateExtend AgentState with domain-specific fields and learn how partial state updates work at invoke time.4 min
- Google GenAI AdapterUse the GoogleGenAIConverter to integrate raw google-genai SDK calls into 10xGraph's message format, including streaming.3 min
- Tool DecoratorUse the @tool decorator to attach metadata, tags, and capabilities to Python functions before registering them with a ToolNode.5 min
- ReAct AgentBuild a persistent ReAct agent with an InMemoryCheckpointer, injectable tool parameters, and custom state.4 min
- ReAct Agent with ValidationAdd input validators — prompt-injection guard, content safety, and custom business rules — to a ReAct agent using CallbackManager.4 min
- React StreamingStream graph responses token-by-token using astream with ResponseGranularity, and understand the difference between invoke and stream.5 min
- Stop StreamGracefully stop a running 10xGraph stream from the caller by using app.stop(config).4 min
- Dependency InjectionUse InjectQ with 10xGraph to inject shared services such as checkpointers, stores, callbacks, and app-specific dependencies into graph nodes and tools.3 min
- MCP ServerExpose tools over Model Context Protocol using FastMCP so 10xGraph and other MCP clients can call them remotely.2 min
- MCP ClientConnect to MCP servers with FastMCP Client, list remote tools, inspect metadata, and invoke tools directly.2 min
- MCP ReAct AgentConnect 10xGraph ToolNode to MCP servers so a ReAct graph can call remote tools as part of normal agent execution.3 min
- GitHub MCPUse a remote GitHub MCP server from 10xGraph so an agent can list commits and download repository files such as README.md through MCP tools.3 min
- MemoryGive a 10xGraph agent long-term memory with Agent(memory=MemoryConfig(...)), backed by QdrantStore or a Mem0 store, scoped per user.4 min
- MultimodalSend images, audio, video, and documents to 10xGraph using media blocks, MediaRef, a media store, and multimodal model configuration.3 min
- MultiagentRoute work between multiple specialized nodes in a single 10xGraph graph using conditional edges and a coordinator-style main node.3 min
- HandoffBuild a multi-agent 10xGraph graph where specialized agents transfer control to each other using handoff tools.3 min
- SkillsBuild a 10xGraph graph that loads Agent Skills (SKILL.md) on demand and combines them with normal tools.7 min
- TestingUse QuickTest to write low-boilerplate, deterministic tests for 10xGraph graphs without hitting a live model.4 min
- EvaluationUse 10xGraph's evaluation framework to score tool use, response quality, trajectories, simulation goals, and reporting workflows.5 min
- Graceful ShutdownBuild a long-running 10xGraph service that handles SIGINT and SIGTERM cleanly, protects initialization and cleanup, and closes graph resources safely.4 min