Quick Use
npm install @inngest/agent-kit inngest @anthropic-ai/sdk zod- Use
createAgent({ ... })to define agents and tools - Wrap in
inngest.createFunction({}, {}, async ({step}) => agent.run(...))for durability
Intro
Inngest Agent Kit is the typed agent layer on top of Inngest's durable execution. Build agents with createAgent(), give them tools, run them inside inngest.createFunction() — automatic retry, state checkpoints, observability, and parallel sub-agent calls. Best for: production agents that need to survive crashes, retries, and timeouts. Works with: Inngest 3.x, TypeScript 5+. Setup time: 5 minutes.
Define an agent
import { createAgent, anthropic } from "@inngest/agent-kit";
const researchAgent = createAgent({
name: "Researcher",
description: "Searches the web and summarizes findings",
model: anthropic({ model: "claude-3-5-sonnet-20241022" }),
system: "You are a research assistant. Search aggressively, cite sources.",
tools: [
{
name: "web_search",
description: "Search the web",
parameters: z.object({ query: z.string() }),
handler: async ({ query }) => {
return await fetch(`https://api.tavily.com/search?q=${query}`)
.then(r => r.json());
},
},
],
});Run it inside an Inngest function
inngest.createFunction(
{ id: "research" },
{ event: "research.requested" },
async ({ event, step }) => {
const { topic } = event.data;
// Each agent step is a checkpoint — survives crashes
const findings = await step.run("research", () =>
researchAgent.run(`Research ${topic}`));
return findings;
},
);Network of agents
import { createNetwork } from "@inngest/agent-kit";
const network = createNetwork({
agents: [researchAgent, writerAgent, editorAgent],
defaultModel: anthropic({ model: "claude-3-5-haiku-20241022" }),
router: ({ network, callCount }) => {
if (callCount === 0) return researchAgent;
if (network.state.kv.get("draft") === undefined) return writerAgent;
return editorAgent;
},
});
const final = await network.run("Write a 500-word brief on agent frameworks");The router function decides which agent runs next, given the network state. Use it to build supervisor-worker patterns or sequential pipelines.
FAQ
Q: Is Inngest free? A: Yes — Inngest is open-source under Apache-2.0. The Agent Kit is also open-source. Inngest Cloud has a free tier (50K runs/mo); paid plans for higher concurrency and longer retention.
Q: Why use Agent Kit vs raw Inngest? A: Raw Inngest functions are great for general background jobs. Agent Kit adds typed agent primitives — tools, system prompts, networks of agents — without re-rolling them yourself. Both can be used in the same project.
Q: Does it work with Anthropic and OpenAI?
A: Yes — Agent Kit ships adapters for anthropic(), openai(), gemini(), and any OpenAI-compatible endpoint (so you can plug in LiteLLM Proxy or Together).
Source & Thanks
Built by Inngest. Licensed under Apache-2.0.
inngest/agent-kit — ⭐ Active