NiadraContext goes between the prompt builder and the chat generator, and NiadraReply after the generator. With an Agent, NiadraAgentHooks(conversation).hooks and history_tools(conversation) do the same. Python only; needs Haystack 3.2 or newer.
Install
The five primitives
Minimal example
examples/haystack_agent.py.
In a pipeline
Agent memory
NiadraContext(conversation, agent_memory=True), NiadraAgentHooks(conversation, agent_memory=True) and history_tools(conversation, agent_memory=True) put the agent’s own notes before the customer’s context and add the two tools. See Agent memory.
Limits
- The components and the hooks take
NiadraandAsyncNiadraconversations; withAsyncNiadra, run the pipeline or the agent withrun_async. - Nothing here stops the pipeline: with Niadra slow or down, the messages go on without the pack and a tool answers that the history is unavailable.
- Tested against
haystack-ai3.2.0 with the generator replaced by a fake and Niadra on the emulator.
Next steps
History navigation
the three tools the agent receives.
Context and views
what goes into the pack and why.

