How-to guides

In this sectionTask-focused recipes for the Python library, production, the CLI and the TypeScript client.

  • 56 pages
  • About 264 min to read all

All pages in How-to guides

Python library

  1. How to build a graphStep-by-step guide to constructing, compiling, and executing a StateGraph with Agent and ToolNode nodes.4 min
  2. How to configure AgentReference for the Agent constructor, including model, provider, system_prompt, tool_node, reasoning_config, retry_config, fallback_models, and output_schema.6 min
  3. How to use the @tool decoratorGuide to marking Python functions as tools with name, description, tags, provider, capabilities, and metadata using the @tool decorator.3 min
  4. How to use custom stateGuide to subclassing AgentState to add application-specific fields and understanding context reducers.4 min
  5. How to set up checkpointingSet up checkpointing: InMemoryCheckpointer for development, SqliteCheckpointer for client agents, and PgCheckpointer (Redis and Postgres) for production.9 min
  6. How to stream graph responsesGuide to streaming token-by-token output from a compiled graph using astream(), StreamChunk format, ResponseGranularity, and interrupt patterns.5 min
  7. How to pause a graph for human input with interrupt()Use interrupt() inside a node or tool to stop a graph for an approval, a correction, or a choice, then resume it with the answer.3 min
  8. How to write custom nodesWrite graph nodes as plain Python functions without the Agent class. Covers state and config auto-injection, InjectQ service injection, and return types.7 min
  9. Choosing the right abstractionWhen to use prebuilt agents, the Agent class in a custom graph, or plain function nodes.4 min
  10. How to use the memory storeGuide to using QdrantStore and Mem0Store for long-term vector memory, factory helpers, and enabling agent-level memory with MemoryConfig.4 min
  11. How to use prebuilt agentsGuide to ReactAgent, PlanActReflectAgent, StructuredOutputAgent, SupervisorTeamAgent, SwarmAgent, and RAGAgent as compiled graph factories.6 min
  12. How to use prebuilt toolsUse the prebuilt tools in tenxgraph.prebuilt.tools: fetch_url, file tools, safe_calculator, web search, memory tools, and create_handoff_tool.4 min
  13. How to use publishersEmit structured events during graph execution with ConsolePublisher, RedisPublisher, KafkaPublisher, RabbitMQPublisher, CompositePublisher, and OtelPublisher.5 min
  14. How to send traces to Logfire and LangSmithSend 10xGraph graph, node, LLM, and tool spans to Pydantic Logfire or LangSmith over OpenTelemetry using Python helpers, publishers, or 10xgraph.json.3 min
  15. How to use dependency injectionGuide to using InjectQ for binding services and injecting them into node functions, tool functions, and agents via Inject[T] parameter defaults.4 min
  16. How to use MCP toolsConnect 10xGraph agents to MCP servers with fastmcp.Client over local stdio or HTTP, and pass user context through to the MCP tools.4 min
  17. How to give an agent skillsAdd Agent Skills (SKILL.md folders with scripts, references and assets) to an 10xGraph Agent, validate them, and observe when the model uses them.5 min
  18. Manage conversation contextHow to keep the message history within your LLM's context window using BaseContextManager and MessageContextManager.2 min
  19. Protect against prompt injectionHow to use CallbackManager and PromptInjectionValidator to guard your agent against prompt injection, jailbreak, and other OWASP LLM01:2025 attacks.2 min
  20. Emit Tool Progress UpdatesLearn how to send live progress, errors, and status updates from tools during streaming execution.7 min
  21. Run work in the backgroundHow to fire-and-forget async tasks from inside a node without blocking the graph using BackgroundTaskManager.2 min
  22. Change the ID strategyHow to control the format of thread IDs and run IDs generated by the framework using BaseIDGenerator.2 min
  23. Route between agents with handoffHow to use create_handoff_tool and Command to transfer control between agents in a multi-agent graph.3 min
  24. How to build a realtime audio agentBuild a live audio-to-audio agent with AudioAgent and Gemini Live: arealtime sessions, LiveInputQueue, image input, reconnection, and the WebSocket bridge.8 min

Production

  1. ProductionDeploy, configure and secure the 10xGraph API server in production: endpoints, config, auth, rate limiting, storage and environment variables.2 min
  2. 10xgraph.json in productionThe 10xgraph.json fields that matter in production: values to set for auth, persistence, and rate limiting, and defaults that are unsafe under real traffic.3 min
  3. Environment VariablesEvery environment variable the 10xGraph server reads: auth, CORS, logging, security headers, Snowflake IDs, OpenTelemetry, and media storage.9 min
  4. Auth and AuthorizationProduction guidance for securing an 10xGraph API with JWT auth, custom auth backends, and permission checks.10 min
  5. CheckpointingHow to choose, configure, and troubleshoot checkpointers for development and production 10xGraph deployments.3 min
  6. Multimodal and VisionSend images, audio, and documents to a 10xGraph agent over the API. Covers file upload, file_id rewriting, text extraction, and MEDIA_* environment variables.5 min
  7. Logging and MetricsEnable structured JSON logging with run correlation and secret redaction, and export 10xGraph counters and timers to OpenTelemetry.5 min
  8. DeploymentProduction deployment guidance for 10xGraph APIs, including containers, runtime settings, shared persistence, and release checks.3 min
  9. Deploy on KubernetesGenerate a Kubernetes Deployment and Service with 10xgraph build --k8s, and set grace periods, probes, and scaling so rolling deploys never cut off a run.4 min
  10. Backup and restoreWhat 10xGraph persists, how to back up the Postgres tables that hold threads and state, and how to restore or roll back a running deployment safely.4 min
  11. Production TroubleshootingA production-first troubleshooting guide for common 10xGraph deployment, runtime, and connectivity issues.4 min

CLI

  1. API & CLI OverviewOverview of the 10xGraph CLI commands. Install, scaffold, serve, test, evaluate, and deploy agents from the terminal.6 min
  2. Initialize a ProjectScaffold a new 10xGraph project with the 10xgraph init command, and see what it generates and which files to edit first.4 min
  3. Run the API ServerStart the 10xGraph API server with 10xgraph api for local development and for production, including the host, port, and 10xgraph.json settings.5 min
  4. Open the PlaygroundHow to use 10xgraph play to start the API and open the hosted playground.9 min
  5. Configure 10xgraph.jsonTask guide for setting the common 10xgraph.json keys, wiring a checkpointer, store and auth, and keeping separate configs per environment.4 min
  6. Add JWT authenticationTurn on JWT auth in 10xgraph.json, send bearer tokens, read the user in tools, and restrict each thread to its owner. Includes a custom BaseAuth option.3 min
  7. Configure Rate LimitingHow to enable and configure the built-in sliding-window rate limiter in the 10xGraph API.5 min
  8. Deploy with Docker and KubernetesGenerate a Dockerfile, docker-compose.yml and Kubernetes manifest with 10xgraph build, then ship them with a production environment checklist.3 min
  9. Install SkillsUse 10xgraph skills to install bundled coding-agent skills for Codex, Claude, and GitHub Copilot, and validate them against the Agent Skills spec.4 min
  10. Run TestsHow to run your 10xGraph project's test suite using 10xgraph test. Covers coverage, thresholds, keyword filters, and 10xgraph.json configuration.3 min
  11. Run EvaluationsRun agent evaluations with 10xgraph eval. Covers parallel runs, user simulation, EvalPresets, reports, thresholds, and 10xgraph.json configuration.9 min

TypeScript client

  1. Create and configure the clientStep-by-step guide to installing, instantiating, and verifying AgentFlowClient.4 min
  2. How to invoke the agentStep-by-step guide to calling client.invoke() and handling the response.3 min
  3. How to stream responsesStep-by-step guide to using client.stream() for real-time token-by-token output.6 min
  4. How to manage threadsStep-by-step guide to listing, inspecting, updating, and deleting conversation threads and messages.4 min
  5. How to use the memory APIStep-by-step guide to storing, searching, and managing long-term memories with AgentFlowClient.5 min
  6. How to upload filesStep-by-step guide to uploading images, audio, and documents and using them in multimodal messages.4 min
  7. How to send images and documentsSend images, PDFs, and other media to an agent from TypeScript with uploadFile, Message.withImage, Message.withFile, and Message.multimodal.6 min
  8. How to build a realtime audio sessionStep-by-step guide to capturing microphone audio, streaming it to a live agent with client.realtime(), and playing the agent's PCM16 reply back in the browser.8 min
  9. Register remote toolsDeclare trusted remote-tool schemas and register browser-side handlers.2 min
  10. How to use graph utilitiesUse graph(), graphTools(), graphStateSchema(), observability(), stopGraph(), and fixGraph() on the TypeScript client to inspect and control graphs.9 min