niadraAgent(this, { niadra, subject }) returns one helper per Agent instance (a Durable Object), bound to a conversation whose id is the agent’s name (the id you route to, such as a chat or a user) unless you give another. Only web APIs and the AI SDK, which the agents package already requires: it runs on Workers as it is. TypeScript only.
Install
@niadra/sdk 0.3.0, ready on main and on npm when it is published; until then the npm package is 0.1.1.
The five primitives
Minimal example
Agent memory
niadraAgent(this, { ..., agentMemory: true }) puts the agent’s own notes before the customer’s context and adds the two tools. See Agent memory.
Limits
- The first call builds the helper; later calls on the same instance return the same one, so the conversation keeps its pinned pack and its deltas across turns.
channel: "voice"gives the voice budget and view;sessiontakes a conversation or a task you opened yourself, in place ofsubject.- Nothing here stops the agent: with Niadra slow or down, the model gets the messages as they came; with no customer found, everything passes through.
- Tested with the
agents0.24.0 types and, bundled with the AI SDK, running inside workerd (pnpm runtimes), with Niadra on the emulator.
Next steps
Vercel AI SDK
the middleware this adapter reuses.
TypeScript SDK
the client, the conversations and the tasks.

