Multi-steps tools
Use multi-steps tools to create more complex Agents.
In this guide, we’ll learn how to create a multi-steps tool that can be used in your AgentKit Tools to reliably perform complex operations.
By combining your AgentKit network with Inngest, each step of your tool will be retried automatically and you’ll be able to configure concurrency and throttling.
Prerequisites
Your AgentKit network must be configured with Inngest.
Creating a multi-steps tool
Creating a multi-steps tool is done by creating an Inngest Function that will be used as a tool in your AgentKit network.
To create an Inngest Function, you’ll need to create an Inngest Client:
Then, we will implement our AgentKit Tool as an Inngest Function with multiple steps. For example, we’ll create a tool that searches for perform a research by crawling the web:
Our researchWebTool
Inngest defines 3 main steps.
- The
step.ai.infer()
call will offload the LLM requests to the Inngest infrastructe which will also handle retries. - The
step.run()
call will run thecrawl-web
step in parallel.
All the above steps will be retried automatically in case of failure, resuming the AgentKit network upon completion of the tool.
Using the multi-steps tool in your AgentKit network
We can now add our researchWebTool
to our AgentKit network:
We first import our researchWebTool
function and pass it to the deepResearchAgent
tools
array.
Finally, we also need to pass the researchWebTool
function to the createServer()
’s functions
array.