Configuring Retries
Configure retries for your AgentKit network Agents and Tool calls.
Using AgentKit alongside Inngest enables automatic retries for your AgentKit network Agents and Tools calls.
The default retry policy is to retry 4 times with exponential backoff and can be configured by following the steps below.
Prerequisites
Your AgentKit network must be configured with Inngest.
Configuring Retries
Configuring a custom retry policy is done by transforming your AgentKit network into an Inngest function.
Transforming your AgentKit network into an Inngest function
First, you’ll need to create an Inngest Client:
Then, transform your AgentKit network into an Inngest function as follows:
The network.run()
is now performed by the Inngest function.
Don’t forget to register the function with createServer
’s functions
property.
Configuring a custom retry policy
We can now configure the capacity by user by adding concurrency and throttling configuration to our Inngest function:
Your AgentKit network will now retry once on any failure happening during a single execution cycle of your network.