Skip to main content
In Python, NiadraAgentsMemory gives you run_config() (the filter that injects the context before each model call), hooks (which record the turns) and tools. In JavaScript, @niadra/sdk/openai-agents brings NiadraSession, niadraInstructions(), niadraTools() and niadraRunHooks().

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/openai_agents_run.py and examples/openai-agents.ts.

Agent memory

In Python, agent_memory=True (or {"write": True, "max_tokens": 300, "tags": [...]}) puts the agent’s own notes after the instructions and before the customer’s context, and search_agent_memory (and remember, with write) join tools. In JavaScript, agentMemory in the options. See Agent memory.

Limits

  • The Python adapter does not implement the SDK’s Session: a Session stores the agent’s own items, and Niadra keeps derived memory, not a copy of each item. Use any Session next to it. In JavaScript, NiadraSession wraps the session you choose.
  • Nothing here fails a run: Niadra slow or down leaves the instructions yours alone.
  • In Python, the openai-agents extra pins versions incompatible with livekit, crewai and litellm; install one per environment.
  • Tested against openai-agents 0.22.3 and @openai/agents 0.18.0 with the model replaced by a fake and Niadra on the emulator.

Next steps

History navigation

the three tools the agent receives.

OpenAI and Azure OpenAI

the client wrap(), for those not on the Agents SDK.