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/:

Advanced integrations

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 Pattern to learn the smallest useful graph.
  • Move to Custom State and Tool Decorator to understand how state and tools are modeled.
  • Use ReAct Agent to assemble the core graph loop.
  • Add ReAct Agent with Validation for 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_KEY for Google-based examples

All pages in Tutorials

From examples

  1. Agent Class PatternBuild a weather-aware assistant using the Agent class, ToolNode, and conditional routing in a StateGraph.4 min
  2. Custom StateExtend AgentState with domain-specific fields and learn how partial state updates work at invoke time.4 min
  3. Google GenAI AdapterUse the GoogleGenAIConverter to integrate raw google-genai SDK calls into 10xGraph's message format, including streaming.3 min
  4. Tool DecoratorUse the @tool decorator to attach metadata, tags, and capabilities to Python functions before registering them with a ToolNode.5 min
  5. ReAct AgentBuild a persistent ReAct agent with an InMemoryCheckpointer, injectable tool parameters, and custom state.4 min
  6. ReAct Agent with ValidationAdd input validators — prompt-injection guard, content safety, and custom business rules — to a ReAct agent using CallbackManager.4 min
  7. React StreamingStream graph responses token-by-token using astream with ResponseGranularity, and understand the difference between invoke and stream.5 min
  8. Stop StreamGracefully stop a running 10xGraph stream from the caller by using app.stop(config).4 min
  9. 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
  10. MCP ServerExpose tools over Model Context Protocol using FastMCP so 10xGraph and other MCP clients can call them remotely.2 min
  11. MCP ClientConnect to MCP servers with FastMCP Client, list remote tools, inspect metadata, and invoke tools directly.2 min
  12. MCP ReAct AgentConnect 10xGraph ToolNode to MCP servers so a ReAct graph can call remote tools as part of normal agent execution.3 min
  13. 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
  14. MemoryGive a 10xGraph agent long-term memory with Agent(memory=MemoryConfig(...)), backed by QdrantStore or a Mem0 store, scoped per user.4 min
  15. MultimodalSend images, audio, video, and documents to 10xGraph using media blocks, MediaRef, a media store, and multimodal model configuration.3 min
  16. MultiagentRoute work between multiple specialized nodes in a single 10xGraph graph using conditional edges and a coordinator-style main node.3 min
  17. HandoffBuild a multi-agent 10xGraph graph where specialized agents transfer control to each other using handoff tools.3 min
  18. SkillsBuild a 10xGraph graph that loads Agent Skills (SKILL.md) on demand and combines them with normal tools.7 min
  19. TestingUse QuickTest to write low-boilerplate, deterministic tests for 10xGraph graphs without hitting a live model.4 min
  20. EvaluationUse 10xGraph's evaluation framework to score tool use, response quality, trajectories, simulation goals, and reporting workflows.5 min
  21. Graceful ShutdownBuild a long-running 10xGraph service that handles SIGINT and SIGTERM cleanly, protects initialization and cleanup, and closes graph resources safely.4 min