Skip to main content
NiadraHooks is a Strands Agents HookProvider: before each model call it places the pack in the system prompt and restores it afterwards; tools brings the history kit. In TypeScript, NiadraPlugin is a plugin for Strands Agents for TypeScript. Built for teams already on AWS.

Install

The TypeScript integration ships with @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

The same code is in examples/strands_agent.py.

In TypeScript

new NiadraPlugin(convo) goes in the Agent’s plugins: an input middleware of InvokeModelStage records the customer’s newest message once, adds the pack after your system prompt and folds the turn_block into the last user message (keeping the cache point before it, as Strands’ own context injector does), without touching agent.messages; an output middleware records the final answer with the model’s usage (Bedrock and Anthropic count cached tokens apart, the others inside); getTools() gives the kit when the session is fixed. The plugin takes the conversation or a function of the agent that finds it per call.

Agent memory

NiadraHooks(conversation, agent_memory=True) puts the agent’s own notes before the customer’s context and adds the two tools. See Agent memory.

Limits

  • Strands’ MemoryStore stores the agent’s own session; Niadra is not that store, so it plugs in through hooks, next to any session manager you use.
  • Nothing here fails the invocation: without a pack, the system prompt goes as you wrote it.
  • Strands for TypeScript needs Node 22 or later.
  • Tested against strands-agents 1.57 with the model replaced by a fake and Niadra on the emulator; in TypeScript, against @strands-agents/sdk 1.19.0, with a real Agent through its AI SDK model adapter.

Next steps

Amazon Bedrock

the Converse API wrap(), for those calling Bedrock directly.

Internal agents

tasks, objects and actions that close open items.