CrewAI Persistent Memory Backend
Your CrewAI agents forget everything between runs. Dakera gives them persistent, cross-run memory with namespace isolation per crew member, hybrid retrieval, and knowledge graphs.
Why CrewAI Needs Better Memory
CrewAI crews are powerful for multi-agent workflows, but their built-in memory resets between kickoff() calls. For crews that run repeatedly — customer support, research, monitoring — this means starting from scratch every time.
Dakera provides:
- Persistent cross-run memory — crews retain knowledge indefinitely
- Namespace isolation — each agent gets its own memory space
- Shared crew knowledge — agents can read from shared namespaces
- Hybrid retrieval — HNSW vector + BM25 + cross-encoder reranking
- Knowledge graphs — track entities and relationships discovered by any agent
How It Works
Install Dependencies
pip install dakera crewai
Create a Memory-Aware Tool
Build a CrewAI tool that stores and recalls from Dakera.
Assign to Your Crew Agents
Each agent uses the memory tool with its own namespace for isolation.
Code Example: CrewAI + Dakera
from crewai import Agent, Task, Crew
from crewai.tools import tool
from dakera import Dakera
memory = Dakera(base_url="http://localhost:3300", api_key="dk-...")
@tool("recall_memory")
def recall_memory(query: str, agent_name: str) -> str:
"""Recall relevant memories for this agent."""
results = memory.memory.recall(
query=query,
namespace=agent_name,
top_k=5
)
return "\n".join([r["content"] for r in results["results"]])
@tool("store_memory")
def store_memory(content: str, agent_name: str) -> str:
"""Store a new memory for this agent."""
memory.memory.store(
content=content,
namespace=agent_name,
metadata={"source": "crewai"}
)
return f"Memory stored for {agent_name}"
# Create agents with persistent memory
researcher = Agent(
role="Research Analyst",
goal="Research topics and remember findings across runs",
tools=[recall_memory, store_memory],
backstory="You are a researcher who builds on previous findings."
)
writer = Agent(
role="Content Writer",
goal="Write content informed by research history",
tools=[recall_memory, store_memory],
backstory="You are a writer who maintains consistent style and builds on past work."
)
# Tasks that leverage persistent memory
research_task = Task(
description="Research {topic}. First recall what you already know, then find new information and store it.",
agent=researcher,
expected_output="Research summary with new findings stored to memory"
)
write_task = Task(
description="Write about {topic} using research findings. Store the final piece to memory.",
agent=writer,
expected_output="Written content that builds on previous work"
)
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff(inputs={"topic": "AI agent architectures"})
Multi-Agent Memory Architecture
| Namespace | Access | Purpose |
|---|---|---|
| researcher | Researcher agent only | Research findings, sources, hypotheses |
| writer | Writer agent only | Style preferences, past outputs, editorial decisions |
| crew-shared | All agents (read) | Project requirements, user preferences, shared context |
What Dakera Adds to CrewAI
| Feature | CrewAI Built-in | CrewAI + Dakera |
|---|---|---|
| Persistence | Per-kickoff only | Permanent, disk-backed |
| Retrieval | Basic embedding | Hybrid (HNSW + BM25 + reranking) |
| Agent isolation | Limited | Full namespace isolation with scoped keys |
| Knowledge graphs | No | GLiNER entity extraction + BFS traversal |
| Temporal queries | No | Time-aware recall |
| Memory decay | No | 6 configurable strategies |
| Encryption | No | AES-256-GCM at rest |
Frequently Asked Questions
Install the Dakera Python SDK (pip install dakera) and use it within your CrewAI crew's task callbacks or custom tools. Each agent in the crew can store and recall memories from its own namespace, providing persistent context across runs.
Yes. Dakera namespaces provide complete memory isolation. Each crew agent can write to its own namespace while having read access to shared namespaces — enabling both private agent memory and shared crew knowledge.
Yes. Unlike CrewAI's built-in short-term memory which resets per kickoff, Dakera persists all memories to disk with AES-256-GCM encryption. Your crew retains knowledge across every run indefinitely.
CrewAI's built-in memory provides basic short-term and long-term memory. Dakera adds hybrid retrieval (vector + BM25 + reranking), knowledge graphs, memory decay, temporal reasoning, and cross-session persistence — scoring 87.6% on the LoCoMo benchmark.
Give Your CrewAI Agents Persistent Memory
Crews that learn and improve with every run. Self-hosted, encrypted, production-ready.
Get Started