WorkflowsMay 7, 2026·3 min read

Inngest Agent Kit — Build AI Agents with Tools

Inngest Agent Kit gives typed multi-step agents with retry, state, tool use. Drops into Inngest jobs for durable, observable agent runs.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Needs Confirmation · 52/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: New
Entrypoint
Asset
Universal CLI install command
npx tokrepo install 56ac925d-060c-4d74-9169-0593d6e87408
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).


Quick Use

  1. npm install @inngest/agent-kit inngest @anthropic-ai/sdk zod
  2. Use createAgent({ ... }) to define agents and tools
  3. 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

🙏

Source & Thanks

Built by Inngest. Licensed under Apache-2.0.

inngest/agent-kit — ⭐ Active

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets