Create agent
POST/v2/agents
Create a new agent. An agent is compromised as 3 main things of functionality:
- The instructions an agent follows. Known as a system in prompt in other platforms.
- The steps an agent follows when receiving an input.
- The tools an agent can use to resolve those steps and instructions.
Instructions are tied to each step, and should be precisely crafted so that the agent can perform the desired actions when given an input.
Be specific to exactly what you want the agent to do. For emphasis, use CAPS if you want the agent to follow a specific format. Negative prompts also help with precision such as saying DO NOT DO THIS.
To use an agent, create a new session (called thread or chat in other platforms), and send new inputs to the agent to get responses.
Only a single step is supported with no follow up steps. So the first_step will be only the only step. We will add multiple steps and step types to execute complex workflows, but many agents can work well with a single step.
LLM configuration
Agents use LLMs for reasoning and response generation. You can configure the following:
- Model: Choose from available models like GPT-4o.
- Parameters: Adjust temperature, max tokens, and other model-specific settings.
- Cost optimization: Balance performance with token usage.
- Retry configuration: Configure automatic retry behavior for transient failures.
Using retries to improve user experience
When agents interact with LLMs, transient failures like network interruptions can disrupt communication between the agent and the LLM. You can configure your agent to resume disrupted communication to ensure a smooth user experience.
max_retries: After an error, the agent will retry its request to the LLM this many times.initial_backoff_ms: This is how many milliseconds the agent will wait before retrying, to give the cause of the error time to resolve.backoff_factor: Every time the agent retries, it can multiply the last retry delay by this number, increasing the wait between retries. This is like giving a toddler a longer and longer timeout if it continues to misbehave.max_backoff_ms: The maximum time you want the agent to wait between retries, so the backoff_factor does not create an unreasonably long delay for your users.
Request
Responses
- 201
- 400
- 403
The response includes the complete agent configuration with system-generated fields including the unique agent key, creation timestamp, and update timestamp.
Agent creation request was malformed or contains invalid references.
Permissions do not allow creating agents.