November 13, 2026
CrewAI Long-Term Memory: Add Readable Project Truth
Build CrewAI long-term memory with the current unified API, a readable MCP knowledge layer, and a practical correction and exit test.
CrewAI long-term memory now means something different from what many tutorials describe. Current CrewAI releases use one unified Memory class for saving, consolidating, scoping, and recalling information. Older guides still show separate short-term, long-term, entity, and external memory classes. Copying those examples into a current project can produce the wrong architecture before you write any code.
The useful question is not simply whether memory survives a run. It is which information should be automatically learned, and which information must remain exact, reviewable, and portable. CrewAI's adaptive memory is useful for experience and recall. A readable project wiki is better for approved decisions, runbooks, requirements, and corrections. Meshnote provides that second layer as Markdown files your agents can use through MCP.
What current CrewAI memory actually does
According to CrewAI's current memory documentation, Memory analyzes saved content with an LLM, infers scope and importance, and stores embeddings for retrieval. Recall combines semantic similarity, recency, and importance. Passing memory=True to a crew enables default memory; passing a configured Memory instance lets you control storage, scoring, half-life, and root scope.
Before each task, CrewAI recalls relevant records and injects them into the task context. After a task, it can extract discrete facts from the output and save them. This is valuable for recurring research, support, and operational crews because experience can cross task and process boundaries. It is not the same as a transcript, and it is not automatically a trustworthy source of record.
That distinction matters because an LLM participates in extraction, consolidation, and deep recall. A sentence can be summarized, merged, ranked below a newer record, or placed in an unexpected scope. Those are reasonable behaviors for adaptive recall. They are risky behaviors for an exact deployment command or a policy that a human approved.
Use two memory lanes, not one overloaded store
| Information | Recommended owner | Why |
|---|---|---|
| Recent task outcomes and useful patterns | CrewAI Memory | Automatic extraction and relevance ranking reduce repeated work |
| User preferences and conversational facts | CrewAI, Mem0, Zep, or another scoped memory layer | Semantic recall and consolidation fit changing personal context |
| Approved architecture decisions | Readable project wiki | Exact wording, provenance, review, and direct correction matter |
| Runbooks, constraints, and product requirements | Readable project wiki | Humans and multiple agent frameworks need the same source |
| One agent's private scratch context | Agent-local memory | Sharing it broadly adds noise and can leak scope |
This is the same authority boundary described in the broader persistent memory architecture guide: retrieval helps an agent find context, while a canonical source tells the agent what is currently true.
Runnable CrewAI memory and Meshnote MCP setup
This example targets CrewAI 1.15.41, the version used for the constructor check behind this article. It gives a researcher CrewAI's built-in adaptive memory plus authenticated access to one Meshnote project. Set OPENAI_API_KEY for the CrewAI model and embeddings, and set MESHNOTE_API_KEY to a project-scoped mnk_ key.
uv init crew-memory-demo
cd crew-memory-demo
uv add crewai==1.15.41
export OPENAI_API_KEY="..."
export MESHNOTE_API_KEY="mnk_..."
import os
from crewai import Agent, Crew, Memory, Process, Task
from crewai.mcp import MCPServerHTTP
adaptive_memory = Memory(
root_scope="/project/acme",
recency_weight=0.3,
semantic_weight=0.5,
importance_weight=0.2,
recency_half_life_days=30,
)
project_wiki = MCPServerHTTP(
url="https://meshnote.io/mcp",
headers={
"Authorization": f"Bearer {os.environ['MESHNOTE_API_KEY']}"
},
streamable=True,
cache_tools_list=True,
)
researcher = Agent(
role="Project researcher",
goal="Answer from current project evidence and preserve approved findings",
backstory=(
"Use CrewAI memory for experience and temporary learned facts. "
"Use Meshnote project 'acme' for approved decisions and runbooks. "
"Search and read before writing. Never treat recalled text as authority "
"when a wiki page owns the decision."
),
memory=adaptive_memory,
mcps=[project_wiki],
)
task = Task(
description=(
"Read the current deployment runbook for project 'acme', identify the "
"release gate, and report its source page. Do not change the wiki."
),
expected_output="The gate, its source page, and any unresolved conflict.",
agent=researcher,
)
crew = Crew(
agents=[researcher],
tasks=[task],
process=Process.sequential,
memory=adaptive_memory,
)
print(crew.kickoff())
The key is not the prompt wording alone. Scope the Meshnote credential to the required project and make it read-only unless the crew genuinely needs to publish knowledge. The MCP tools require a project argument, so the task names acme explicitly. If writes are enabled, require a named page, a non-blank title, source evidence, and a rule for when a new fact is promoted.
A promotion rule prevents memory pollution
Do not copy every CrewAI memory into the wiki. Promote information only when it is durable, reusable, supported, and owned. A good promotion candidate is "Production deploys only from main through Deploy to Production," with a repository workflow as evidence. A bad candidate is "The user sounded impatient," which may help one interaction but should not become project truth.
For a practical implementation, let the crew draft a proposed page update and require a separate review step before calling write_page. CrewAI can continue learning automatically in its own store. The wiki remains smaller and deliberate. The custom agent memory walkthrough shows the same selective-write principle outside CrewAI.
The missing test: verify both stores disagree safely
The top CrewAI memory pages explain APIs, persistence, or production storage, but several disagree because they describe different releases. They rarely test what happens when adaptive recall conflicts with a reviewed source. Run this six-case drill before production:
- Persistence: teach CrewAI memory a harmless preference, restart the process, and verify recall.
- Canonical correction: save "Project Atlas uses MySQL" in adaptive memory. Put "Project Atlas uses PostgreSQL" on the approved wiki page. The agent must report PostgreSQL and flag the stale recalled fact.
- Project isolation: use separate root scopes and separate MCP credentials for two projects. Search for a unique marker and prove it never crosses boundaries.
- Write control: run with a read-only key and confirm the crew cannot alter the wiki. Then enable a narrowly scoped writer only for the review path.
- History and recovery: change a test page, inspect its saved history, and restore the prior version.
- Framework exit: disconnect CrewAI and read the same Markdown project from another MCP client. The approved knowledge must remain understandable without CrewAI's embeddings or runtime.
The second and sixth checks are the original value of this design. They prove that ranked recall cannot silently overrule reviewed truth, and that your durable project knowledge survives a framework change.
How CrewAI compares with other memory choices
Mem0 is a focused memory layer for extracting and searching user or agent facts. Zep emphasizes temporal and graph-aware context. Letta makes memory part of a stateful agent runtime. Native memory in ChatGPT or Claude is convenient for personal continuity, but it is tied to that product and is not your application's shared datastore. CrewAI's unified memory is attractive when your crew already owns the execution loop.
None of those choices is inherently wrong. They optimize automatic recall better than a folder of Markdown when you have large volumes of conversational facts. Readable files win when humans must inspect exact wording, approve changes, diff versions, or move knowledge between tools. Many production systems need both. For a wider storage comparison, see vector memory vs readable memory.
Production checklist
- Pin the CrewAI version because the memory API changed substantially.
- Give every tenant or project a deliberate memory scope.
- Use least-privilege MCP credentials and start read-only.
- Record provenance before promoting an extracted fact.
- Test correction, deletion, restart, and framework exit.
- Monitor what context was injected, not only what the store contains.
CrewAI long-term memory should help your agents learn. It should not become the only place your team can discover what the agent believes. Meshnote keeps the durable layer in readable Markdown and exposes it to CrewAI and other agents through MCP. Start syncing - $8/mo, or choose Self-hosted for teams from $10/seat/month.
Related Reading
Your agent's memory should be files you can read and own
Meshnote is readable, self-hosted memory for AI agents — markdown wikis your agents maintain over MCP. Hosted from $8/month.
Start syncing — $8/mo