Memory for crews on CrewAI.
NiadraCrew gives you before_kickoff, which puts the pack in the crew's inputs as niadra_context, after_kickoff, which records the final answer, and tools. The crew's short-term, long-term and entity memory stays CrewAI's; Niadra is the company's memory of the customer, shared with every other agent.
CrewAI's memory belongs to the crew: what its agents saw and learned, in the stores it keeps itself. It serves the crew. It does not serve another vendor's voice agent that will take the same customer tomorrow, nor the billing agent acting in the ERP, and it does not receive what those did.
With Niadra, the crew receives at kickoff the context the company has of the customer, through the niadra_context input, which the task's description or the agent's backstory uses after your text. The crew's final answer goes back into the memory, and any agent, from any vendor, reads what it decided.
pip install 'niadra[crewai]' # crewai 1.15 or newer, below 2; Python 3.11 to 3.13"""A CrewAI crew whose task reads the customer's context."""
from crewai import Agent, Crew, Task
from niadra import Niadra, phone
from niadra.integrations.crewai import NiadraCrew
niadra = Niadra(channel="chat")
memory = NiadraCrew(niadra.conversation("thread-81", subject=phone("+5511912345678")))
support = Agent(role="Support", goal="Help the customer", backstory="You work for Acme.", tools=memory.tools)
answer = Task(
description="Answer the customer: {message}\n\nWhat the company knows:\n{niadra_context}",
expected_output="A short, specific answer.",
agent=support,
)
crew = Crew(
agents=[support],
tasks=[answer],
before_kickoff_callbacks=[memory.before_kickoff],
after_kickoff_callbacks=[memory.after_kickoff],
)
print(crew.kickoff(inputs={"message": "Where is my replacement lid?"}).raw)- Python
The same code is in examples/crewai_crew.py in the SDK repositories, where it runs in CI against the framework's real types and Niadra's emulator. To try it without Niadra's cloud, niadra-mock and NIADRA_BASE_URL=http://127.0.0.1:8765.
How the adapter wires in
The five primitives of every Niadra integration, in this framework's extension points.
- Context
- before_kickoff adds niadra_context to the crew's inputs: the agent's notes (with agent_memory=), the pack and the turn_block. Place {niadra_context} in a task's description or an agent's backstory, after your own text.
- Turns
- The input under message (or message_key=) is the customer's turn, recorded before the crew starts; the crew's final answer is the agent's turn, recorded when it ends.
- Tools
- tools: CrewAI tools whose argument schema is the kit's, bound to the customer.
- Verification
- conversation.verify() before the kickoff.
- Handoff
- transferred_to_agent() and transferred_to_human() record the transfer.
What the agent receives
The context is compiled when the memory changes and served ready, with no AI model on the read. What another channel said during the conversation arrives as a delta, at the end of the prompt.
- Who the customer is, by what the conversation has proven: the verification level decides what goes in
- Facts, open items and promises, with the date and the channel they came from
- What other agents did inside the company, confirmed by the system of record
- Patterns computed by rule, with the evidence and the expiry
- The three history tools: search, timeline and open an item, bound to the customer in your code
- A receipt of every read, chained by SHA-256
What the adapter does not do
- The crew's own memory (short-term, long-term, entity) stays CrewAI's; Niadra is the company's memory of the customer, shared with every other agent.
- Python 3.11 to 3.13 only: CrewAI's vector store depends on onnxruntime, which has no wheels for 3.10. The crewai, pipecat and openai-agents extras pin incompatible versions of a shared dependency: install one per environment.
- Only the crew's final answer is recorded as the agent's turn, not each step.
- Tested against crewai 1.15 with the model replaced by a fake and Niadra on the emulator.
Frequently asked questions
Should I switch off CrewAI's memory?
No need. The crew's memory keeps what its agents learned about the tasks; Niadra keeps what the company knows of each customer, from every channel. One complements the other, and the crew keeps running as it does today.
How does the crew's agent find the context?
Through the niadra_context input, which before_kickoff adds. The task's description says {niadra_context} after your text, like any interpolated CrewAI input. The history tools go in tools, for the agent to look up what the context does not answer.
Does every step of the crew become a turn?
No. Only the crew's final answer is recorded as the agent's turn, and the input under message as the customer's turn. That is what other agents need to know: what the customer asked and what the crew decided.
Do I have to change my model, my prompt or my vendor?
No. The adapter places the context after your instructions and the delta at the end of the prompt, in the extension points the framework already has. Your model, your prompt and your vendor stay the same, and switching any of them later does not erase the memory.
Where does the data live, and what does it cost?
The data stays in a single region, stated in the contract, encrypted with AES-256-GCM under a key exclusive to your company and protected in a FIPS 140-3 HSM. The price is per conversation or task in which an agent read the memory: US$ 2 to 3 per thousand, by volume, with reads, searches and system events included. Niadra is opening to companies by request, before the public launch.
Tell us what you are building.
A work email and two lines about your agents are enough. The people who write the code reply, with an early-access proposal for your case.
Rather tell us more about your company? Use the full form