What are Agents?
Agents let you build AI workflows in which a model selects tools and sequences calls based on a goal. Unlike Flows, Agents adapt the sequence to the task instead of following a fixed sequence that you define.
How Agents differ from Flows
The following table summarizes the difference between Agents and Flows.
Kinds of Agents
Most Agents are one of two kinds:
- Build an Agent on Runtype. Choose a model, write a system prompt, and attach tools. Runtype runs the model and its tool calls.
- Connect an external Agent. Register an agent that you already run elsewhere by its endpoint or A2A agent card. Runtype sends messages to it like any other Agent. For setup, see Bring your own agent.
The rest of this page describes Agents that you build on Runtype.
How Agents work
During a run, the model works from three kinds of input. The following list shows where you set each one:
- Goal: The outcome that you want. Describe it in the System prompt or in the message that starts the run.
- Tools: The functions that the model can call. Attach them to the Agent.
- Context: The instructions and information for the task. Put standing instructions in the System prompt, and pass task data in the message or in variables.
The model follows this cycle during a turn:
- Analyze the goal and context.
- Select one or more available tools.
- Call the selected tools with parameters.
- Use the results to produce a response or call another tool.
A single turn can include several tool calls, up to the Max tool calls limit. By default, a run ends after one turn. To let a run continue into another turn, for example after a turn reaches Max tool calls, open the Agent editor and turn on Agent loop in the Loop section. The run still ends when the model returns an answer, or when it reaches Max turns. For both settings, see Creating and configuring agents.
The model selects tools on its own, but you can keep a person in control of sensitive actions. Turn on Tool approval to pause the run before a selected tool runs. Runs with no one to answer the prompt, such as Schedules, Batches, Evals, and Webhooks, are refused when a tool requires approval. For details, see Safety.
See an Agent in action
Alex is a product manager at Example Organization. They compile competitive intelligence reports each Monday. Their stakeholders want summaries of what competitors shipped during the previous week. The information is scattered across blog posts, release notes, and documentation sites.
Alex tried building a Flow, but each competitor publishes updates in a different place. Some use blogs, some use documentation, and some use social posts. A fixed sequence cannot adapt to those differences without additional branching.
Alex builds an Agent with the following configuration:
- System prompt: The goal (research competitor releases from the previous week and summarize key features), the competitor domains, and the keywords to track.
- Tools: Exa for web search, Firecrawl for page extraction, and a custom JavaScript tool for report formatting.
- Agent loop: Turned on, so the run can continue if one turn reaches Max tool calls.
When Alex runs the Agent for Example Organization, the model can follow this path:
- Search Exa for recent articles about each competitor and its launches.
- Use Firecrawl to extract a matching blog post.
- Use Firecrawl again when the post mentions a documentation page.
- Analyze both sources and identify three features.
- Use the custom tool to format a Markdown report.
- Return the summary to Alex.
Alex does not script these steps. The model selects them from the task, tool descriptions, and results. If Exa returns no recent results, the model can take a different path, such as searching documentation first.
When to use Agents
Choose an Agent when the model must select the next action from the available tools, such as research across scattered sources or tasks in which the next action depends on an earlier result. Choose a Flow when you know the required steps and their order.
You can also combine them. An Agent can call a published Flow as a tool, and a Flow can run an Agent with an Execute Agent step. For the decision criteria and hybrid designs, see Choosing between a flow and an agent.
Available tools
Agents support several tool types. The following list shows the common ones. For an overview of every type, see What are Tools?.
- Built-in tools: Use tools such as GPT Image 2.5, Exa, Firecrawl, and Semantic Search.
- Custom tools: Run JavaScript, TypeScript, or Python code that you write. The available languages depend on the runtime that you select. For details, see Creating custom tools.
- External tools: Call HTTP API endpoints.
- Flow tools: Call published Flows as tools.
- MCP tools: Connect to Model Context Protocol (MCP) servers.
- Subagent tools: Delegate a focused task to a child Agent with a subset of tools and isolated context.
- Skills: Load instructions and reference material when the task needs them. For details, see Agent Skills.
Where Agents run
You can run an Agent from these places:
- The Agent editor, with Test agent, while you build it.
- The API, with
POST /v1/agents/{id}/execute. It streams Server-Sent Events by default, or returns JSON when you setstreamResponsetofalse. - A Product, which makes the Agent reachable through Surfaces such as chat, API, MCP, and messaging channels.
- A Flow, with an Execute Agent step.
Next steps
Continue with these pages:
- Creating and configuring agents: build, test, and add an Agent to a Product.
- Agent versioning and publishing: save snapshots of an Agent configuration and restore them.
- Manage agents as code: version-control Agent definitions and converge them at deploy time.
- Agent tools: configure tool selection and limits.
- Agent Skills: give an Agent loadable instructions and reference material.
- Importing conversations: continue a transcript from another system in Runtype.
- Choosing between a flow and an agent: decide which to build and how to combine them.
- Built-in tools: explore tools provided by Runtype.
- Agent and flow templates: start with an example Agent or Flow.
- Steer an active agent execution: send another message to an Agent while it runs.
- Improving your agents from production traces: turn production runs into Agent improvements.
- Marathon: long-running agent tasks (CLI): run an Agent across multiple CLI sessions.