Prebuilt
In this sectionPrebuilt 10xGraph agents (ReAct, RAG, supervisor, swarm, plan-act-reflect, structured output, audio) and tools you can use as they are or extend.
- 12 pages
- About 48 min to read all
Prebuilt agents are ready-made StateGraph patterns in tenxgraph.prebuilt.agent. Prebuilt tools are plain functions in tenxgraph.prebuilt.tools that you pass to an agent. Both are ordinary 10xGraph code, so they compile, checkpoint and serve through the API server like a graph you wrote yourself. Use them to skip the boilerplate for common shapes, and move to a custom StateGraph when your routing stops fitting.
Prebuilt agents
| Agent | Use it when |
|---|---|
| ReactAgent | One model calls tools in a loop until it has an answer. The default starting point |
| PlanActReflectAgent | Tasks need a plan and a critic that decides whether to iterate again |
| RAGAgent | Answers must come from your documents, with optional reranking by CohereReranker or CrossEncoderReranker |
| StructuredOutputAgent | Output must match a Pydantic schema, with automatic repair of invalid JSON |
| SupervisorTeamAgent | One coordinator routes work to specialist workers defined with WorkerConfig |
| SwarmAgent | Peer agents hand control to each other through transfer_to_X tools, with no central supervisor |
| AudioAgent | Realtime audio-to-audio sessions through Gemini Live |
Prebuilt tools
- Web tools:
fetch_url,google_web_searchandvertex_ai_search.fetch_urlblocks private and loopback addresses. - File tools:
file_read,file_writeandfile_search, confined to a workspace root. - Memory tools:
memory_toolplus user and agent memory tools. They need a configured store. - Calculator:
safe_calculator, which evaluates arithmetic without running code. - Handoff tools:
create_handoff_toolandis_handoff_tool, used to route between agents.
How to extend one
Pass your own functions next to the prebuilt ones. A support agent can combine safe_calculator with lookup_order(order_id: str) and refund_order(order_id: str, amount: float):
from tenxgraph.prebuilt.agent import ReactAgent
from tenxgraph.prebuilt.tools import safe_calculator
agent = ReactAgent(
model="gpt-4o-mini",
tools=[lookup_order, refund_order, safe_calculator],
)
app = agent.compile(checkpointer=checkpointer)Constructor options such as system_prompt, memory and fallback_models tune behavior without code changes. When an agent no longer fits, read its page for the graph it builds and recreate it as a StateGraph. The concepts section explains tools and graphs, and Add a tool walks through writing one.
All pages in Prebuilt
Agents
- ReactAgentReactAgent runs the ReAct MAIN/TOOL loop, executing tool calls in parallel until the LLM returns a final answer.4 min
- PlanActReflectAgentPlanActReflectAgent loops through PLAN, ACT, and REFLECT nodes, critiquing its own output before deciding to iterate or stop.5 min
- SwarmAgentSwarmAgent lets peer agents hand off control directly via transfer_to_X tools, with no central supervisor coordinating routing.6 min
- SupervisorTeamAgentSupervisorTeamAgent routes work through a SUPERVISOR node to specialist worker agents, generating its routing prompt from the worker registry.5 min
- RAGAgentRAGAgent retrieves documents with vector search, optionally reranks with CohereReranker or CrossEncoderReranker, then synthesizes an answer.5 min
- StructuredOutputAgentStructuredOutputAgent validates LLM output against a Pydantic schema and auto-repairs invalid JSON through a GENERATE/REPAIR loop.5 min
- AudioAgentAudioAgent wraps a Gemini Live LiveAgent for realtime audio-to-audio sessions, driven via arealtime() or realtime().7 min
Tools
- Web Toolsfetch_url, google_web_search, and vertex_ai_search — prebuilt tools for fetching web pages and running grounded searches.2 min
- File Toolsfile_read, file_write, and file_search — workspace-scoped prebuilt tools for reading, writing, and searching files.3 min
- Memory Toolsmemory_tool, user_memory_tool, and agent_memory_tool give an agent long-term memory to store, search, update, and delete facts.3 min
- Calculator Toolsafe_calculator evaluates arithmetic expressions with Python's ast module, safely exposing math to an LLM without code execution.1 min
- Handoff Toolscreate_handoff_tool and is_handoff_tool build and detect transfer_to_X tools used to route control between agents in a swarm.2 min