Skip to main content
An agent is a reusable configuration for answering prompts: a set of instructions, the knowledge it can draw on, and the tools it can use. Once created, you run an agent by passing its agent_id to Converse. This guide walks through creating an agent, configuring it, and running it. For the full field reference, see the Agents API reference.

Before you begin

Make sure you have an API key and an SDK installed. See the Quickstart if you haven’t set those up yet.

Create your first agent

Every field on POST /agents is optional, so the smallest useful agent is just a name and some instructions.
The response is an Agent object. Keep its id — you’ll pass it to Converse to run the agent.

Configure instructions

Agents have three instruction fields, each with a distinct purpose:

Add knowledge with corpus

By default an agent can use all knowledge your organization or teamspace can access. To scope it to specific sources, pass a corpus array. Each item is either a knowledge base or a page.
For predictable behavior and to avoid exposing more knowledge than intended, set corpus explicitly instead of relying on the all-knowledge default. See Knowledge and corpus for details.

Enable tools

Tools let an agent do more than answer from knowledge — search the web, analyze data, extract from documents, and more. Pass a tools array of tool names. If you omit tools, a default set is used; passing [] disables all tools.
To see every available tool, use the List tools endpoint. You can also pass disabled_tools to remove specific tools from the default set.

Generate an agent from natural language

Instead of authoring fields by hand, you can describe the agent you want and get a suggested configuration back. This is a three-step flow:
  1. Generate a template from a prompt (POST /agents/generate).
  2. Claim the template with the returned token to retrieve its config (POST /agents/claim).
  3. Create the agent from the template fields (POST /agents).
agents.generate returns a claim_token that expires after 7 days. Claiming retrieves the template — it does not create the agent, so you still call agents.create to persist it.
The generate response lists tools as { "tool": "<name>" } objects, while agents.create expects tool names (strings). Map them as shown above (t.tool / t => t.tool).

Run your agent

Pass the agent’s id as agent_id on a Converse call. The agent’s stored instructions, corpus, and tools are applied automatically.
You can override any part of the agent’s configuration for a single turn by passing config on the Converse call — this does not change the stored agent.

Update and delete

Update an agent with the same fields you used to create it (a partial update — only the fields you pass change):
Delete an agent when you no longer need it:

Next steps