Skip to main content
Version: 2.0

Create agent

POST 

/v2/agents

Creates an agent. An agent is defined by three things: the instructions it follows, the steps it executes when it receives an input, and the tools it can call. Instructions are attached to each step and determine the agent's behavior on that step.

Define the steps in the steps map. Set first_step_name to the name of the entry step. A step transitions to other steps through its next_steps conditions. The first_step field also accepts an inline entry step, but it is deprecated.

To invoke an agent, create a session and send events to it. Each event produces a response from the agent.

LLM configuration

Each agent is bound to one LLM, configured under model:

  • name: the LLM to use (see GET /v2/llms).
  • parameters: LLM parameters such as temperature and max tokens.
  • retry_configuration: retry behavior applied to failed LLM calls.

Retry configuration

The agent retries failed LLM calls with exponential backoff:

  • max_retries: maximum number of retries after the initial call. Defaults to 3.
  • initial_backoff_ms: delay in milliseconds before the first retry. Defaults to 1000.
  • backoff_factor: multiplier applied to the delay after each retry. Defaults to 2.0.
  • max_backoff_ms: upper bound on the delay between retries. Defaults to 30000.

When retry_configuration is not set, the agent retries with the default configuration. Set enabled to false to disable retries.

Request

Responses

The complete agent configuration, including the platform-generated agent key, creation timestamp, and update timestamp.