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
@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
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: aSessionstores the agent’s own items, and Niadra keeps derived memory, not a copy of each item. Use anySessionnext to it. In JavaScript,NiadraSessionwraps the session you choose. - Nothing here fails a run: Niadra slow or down leaves the instructions yours alone.
- In Python, the
openai-agentsextra pins versions incompatible withlivekit,crewaiandlitellm; install one per environment. - Tested against
openai-agents0.22.3 and@openai/agents0.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.
