Skip to main content
This page is for the code path - building or extending an agent by hand. To build one without code, start with Build your first agent. @duraton/agent-kit is the authoring layer on top of step.ai.loop. You declare a model, some instructions and some tools; the kit composes the model call for each turn. Everything durable stays where it already was - one step per turn, one per tool call, reused on replay - so an agent written with the kit is an ordinary durable run.

A first agent

That run records agent:iter:0, agent:iter:0:tool:<callId>, agent:iter:1, and so on - the same step names a hand-written loop writes, which is why an agent needs no special handling to show up in the console as an agent.

What is in the kit

Agents and tools

agent() and tool(): model, instructions, tools, behaviour hints, and what the model sees.

Approvals in the loop

Gate a tool call on a person, cap the decisions an agent may ask for, check its arguments.

Structured output

Answer in a declared shape, validated and recorded as a durable step.

Providers and MCP

Bring your own provider, attach an external MCP server, expose your tools over MCP.

The kit adds no loop

agent() holds no iteration counter, no history and no retry logic. step.ai.loop already owns all three, and its turn is the extension point the kit fills. That is what keeps an agent resumable after a crash, free of repeated model calls on replay, and visible in the console with nothing extra to configure.