PrerequisitesYour 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:src/inngest/client.ts
src/inngest/tools/research-web.ts
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-webstep in parallel.
Using the multi-steps tool in your AgentKit network
We can now add ourresearchWebTool to our AgentKit network:
src/inngest/agent-network.ts
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.
Going further
Configuring Multitenancy
Learn how to configure user-based capacity for your AgentKit network.
Customizing the retries
Learn how to customize the retries of your multi-steps tools.