Core APIs
Steps APIs
Reference for steps in Agenite
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
- Step chaining: Design steps that can be chained together through the
next
property - State management: Use the
state
object in return values to share data between steps - Proper typing: Use TypeScript generics for type safety
- Error handling: Implement proper error handling in each step
- Reusability: Design steps to be reusable across different agents
Next steps
- Learn about middleware
- See examples
- Read about core concepts