Skip to main content

Overview

Steps in Agenite define the sequence of actions an agent takes to accomplish a task. Each step can include prompts, tool calls, and state management.

Step interface

Return values

Steps should return a BaseReturnValues object that includes the next step to execute and state updates:

Step context

The step context provides access to the agent’s state and execution details:

Built-in steps

LLM call step

Sends messages to the LLM and processes the response.

Tool call step

Executes tools called by the LLM and handles the results.

Agent call step

Executes nested agent calls and integrates the results.

Tool result step

Processes tool execution results.

Custom steps

You can create custom steps by implementing the Step interface:

Example: Data transformation step

Using custom steps with an agent

Best practices

  1. Step chaining: Design steps that can be chained together through the next property
  2. State management: Use the state object in return values to share data between steps
  3. Proper typing: Use TypeScript generics for type safety
  4. Error handling: Implement proper error handling in each step
  5. Reusability: Design steps to be reusable across different agents

Next steps