Framework deep dive: CrewAI memory and the 27 solutions
Nov 19, 2026 Β· Michael Chang Β· Status: β¬ not used in NurseOps Now (planned for restaurant-ai-platform, F14)
Show definitions in ( ) Β· hover a highlighted word for its meaning, click it for details Β· open with ?defs=1 to show definitions
Part of: Remembering the right things: state management in NurseOps Now Β· All 27 solutions Β· Other frameworks: LangGraph Β· AutoGen Β· LlamaIndex
Read in this order
- In plain words
- What it gives you for memory: from the current docs
- How to implement it (ServiceApps): code and output
- The 27 solutions with CrewAI: replace, complement or still yours
- Use both: what you still build
- In NurseOps Now, Trade-offs and Interview answer
In plain words
CrewAI builds a "crew" of role-playing agents (an AI that chooses which tools to use to answer) that work through tasks. Its memory is now one unified Memory class: agents (an AI that chooses which tools to use to answer) remember facts and recall the relevant ones before each task, organized in scopes like folders (/customer/acme, /agent/researcher).
In plain terms: a shared team wiki with folders, which every teammate searches before starting a task.
What it gives you for memory
From the official memory docs (CrewAI memory docs), checked on Nov 19, 2026:
- One
Memoryclass replaces the old short-term, long-term, entity and external memory types (working memory plus three long-term kinds: episodic, semantic, procedural). - Save and search:
remember(content, scope=..., categories=..., importance=..., source=..., private=...),recall(query, limit=..., scope=..., depth=...),extract_memories(text). - Storage: LanceDB in
./.crewai/memoryby default;storage=path or aStorageBackend; OpenAI embeddings (text turned into numbers so similar meanings sit close together) by default (configurableembedder). - Ranking: recency, semantic and importance weights; consolidation can merge or delete outdated records.
- Deleting:
memory.forget(scope=...),memory.reset(scope=...),crewai reset-memories; no TTL.
How to implement it (ServiceApps)
Illustrative example: made-up data, no ServiceApps (a company platform for IT tickets, HR requests and help-center articles) instance. The code is written from the current docs but not run (it needs an API key (a secret code that lets the app use a paid service)).
The scenario. ServiceApps (a company platform for IT tickets, HR requests and help-center articles) Assist's crew remembers facts per customer scope and recalls them before a task; one customer's memories are reset on request.
Steps.
- Create
Memory()(configureembedderandstoragefor production). - Save facts with a scope per customer or user, and
private=Truefor sensitive ones. - Pass memory to the crew (
Crew(..., memory=memory)) or give an agent (an AI that chooses which tools to use to answer) a scoped view. - Delete one customer's memories with
memory.reset(scope=...).
The code (Python):
from crewai import Agent, Crew, Memory, Task
memory = Memory(storage="./.crewai/memory") # LanceDB by default; set embedder= for production
memory.remember("Acme uses the corporate VPN profile v2", scope="/customer/acme", importance=0.8)
memory.remember("Acme's admin contact prefers email", scope="/customer/acme", private=True)
for m in memory.recall("how does acme connect to vpn", scope="/customer/acme", limit=3):
print(round(m.score, 2), m.record.content)
assist = Agent(role="ServiceApps Assist", goal="Answer IT questions from KB articles",
backstory="Cites KB numbers", memory=memory.scope("/customer/acme"))
crew = Crew(agents=[assist], tasks=[Task(description="Help Acme with VPN error 809",
expected_output="Steps with KB citations", agent=assist)], memory=memory)
memory.reset(scope="/customer/acme") # forget one customer
Output: not run. CrewAI's memory sends content to an embedding (text turned into numbers so similar meanings sit close together) model and an LLM (large language model: the AI that reads and writes text (here, Claude)) (OpenAI by default) on every save, so it needs an API key (a secret code that lets the app use a paid service). The code follows the current memory docs.
What to watch for.
- Memory content is sent to the configured LLM (large language model: the AI that reads and writes text (here, Claude)) for analysis: use a local model for sensitive data, as the docs suggest.
- Consolidation can change or remove records automatically: never keep exact facts only here.
- Scope design is your per-user isolation and deletion plan; decide it before you store anything.
The 27 solutions with CrewAI
π Replace = CrewAI does it, you configure it (9 of 27). π€ Complement = use both: CrewAI gives the mechanism, you add the rules (8). π Still yours = build it yourself (10). β = not a memory feature, so from general knowledge rather than the memory docs; check the current docs.
| Memory solution | With CrewAI | How | Solution |
|---|---|---|---|
| Three-Tier Memory: Short-Term (Context Window) (what the AI sees in the current call) | π€ Complement | Recalled memories are injected before each task; no chat-window setting on the memory page | Deep dive |
| Three-Tier Memory: Long-Term (Vector Store) (knowledge saved outside the model and searched when needed) | π Replace | Unified Memory: remember / recall with semantic search (LanceDB by default) | Deep dive |
| Three-Tier Memory: Episodic (Experience Log) (a record of what happened, step by step) | π€ Complement | Memory records carry source and time; the audit log (a permanent record of who did what and when) is yours | Deep dive |
| Agentic Outcome: Token Budgets (keeping each call within a planned size) | π Still yours | Not on the memory page | Deep dive |
| Agentic Outcome: Hybrid Memory Systems (recent chat in the window plus long-term search) | π Replace | One Memory recalled into every task | Deep dive |
| Agentic Outcome: Strict State Serialization (saving state so work can pause, crash and resume without loss) | π€ Complement | Memory is persistent; saving a run's state (everything the app must remember to continue correctly) isn't on the memory page | Deep dive |
| Token Counting Middleware (code that counts tokens before every AI call and acts when the window gets too full) | π Still yours | Not on the memory page | Deep dive |
| Dynamic Context Loading (giving the AI tools to fetch data only when it needs it, instead of putting everything in the prompt) | π Replace | Agent (an AI that chooses which tools to use to answer) tools (a function the AI can call, such as policy search) and knowledge sources are standard β | Deep dive |
| System Prompt Pinning (keeping the rules in a protected place that is sent on every call and never trimmed) | π Replace | Each agent (an AI that chooses which tools to use to answer)'s role, goal and backstory go into every task prompt (the instructions and text given to the AI) β | Deep dive |
| Textual Summarization (rewriting old conversation into short, dense notes) | π€ Complement | extract_memories() splits text into facts (not a summary) | Deep dive |
| Rolling Summaries (a short running summary that replaces old conversation turns) | π Still yours | Not built in | Deep dive |
| Entity Extraction (pulling key facts (names, dates, IDs) out of text into a structured record) | π Replace | remember analyzes content with an LLM (large language model: the AI that reads and writes text (here, Claude)) (categories, importance); extract_memories() | Deep dive |
| Vector Compression via RAG (storing text as vectors and pulling back only the parts that match) | π Replace | recall(query) over all saved memories | Deep dive |
| The Engineering Trade-off: Fidelity vs. Capacity (the trade-off between keeping every detail and fitting more in the window) | π Still yours | Consolidation can merge or delete records automatically: keep exact facts elsewhere | Deep dive |
| The Hot/Cold State Architecture (splitting memory into what is in the current call (hot) and what is saved for later (cold)) | π€ Complement | The prompt (the instructions and text given to the AI) is hot; Memory is cold | Deep dive |
| Structured Storage (SQL/Postgres) (a database with fixed tables for exact facts) | π Still yours | Memory is stored in LanceDB, not your records | Deep dive |
| Semantic Storage (Vector DB like Pinecone, Weaviate, or Chroma) (a vector database that finds text by meaning) | π Replace | LanceDB by default, or a custom StorageBackend | Deep dive |
| Session Caching (Redis/Key-Value) (saving a conversation's state so it can pause and resume) | π Still yours | No session or thread (one saved conversation, here one per user and case) concept (scopes instead) | Deep dive |
| The Rehydration Pattern (fetch saved state, keep only what's relevant, and put it back into the next call) | π Replace | Relevant memories are recalled into each task, filtered by scope | Deep dive |
| Sanitization layer (code that masks personal details and secrets before anything is saved) | π Still yours | No redaction; private flag; docs suggest a local LLM (large language model: the AI that reads and writes text (here, Claude)) for sensitive data | Deep dive |
| TTL (time-to-live) expiration (deleting saved data automatically after a set time) | π Still yours | Not built in; recency_half_life_days only affects ranking | Deep dive |
| GDPR Right to Be Forgotten (a person's right to have their stored data deleted (from the EU's GDPR law)) | π€ Complement | memory.reset(scope="/customer/...") clears one scope | Deep dive |
| Engineering Fix: Recursive Goal Injection (repeating a short reminder of the rules before every AI answer) | π€ Complement | Role and goal in every task prompt (the instructions and text given to the AI) act as an anchor β | Deep dive |
| Engineering Fix: Strict RAG and Citation Enforcement (answering only from retrieved sources, and flagging any answer without one) | π Still yours | Yours β | Deep dive |
| Input Filtering: Relevance Pruning (checking and trimming a question before the AI sees it) | π Still yours | Yours β | Deep dive |
| Process Control: Self-Correction Loop (checking the AI's answer and sending it back once to fix what failed) | π€ Complement | Task guardrails (checks that block unsafe or off-topic input and output) can reject output and retry β | Deep dive |
| Output Guardrails: Schema Enforcement (requiring the AI's answer to match a fixed shape, checked in code) | π Replace | Task output_pydantic / output_json β | Deep dive |
Use both: what you still build
Still yours with CrewAI:
- Agentic Outcome: Token Budgets (keeping each call within a planned size): Not on the memory page
- Token Counting Middleware (code that counts tokens before every AI call and acts when the window gets too full): Not on the memory page
- Rolling Summaries (a short running summary that replaces old conversation turns): Not built in
- The Engineering Trade-off: Fidelity vs. Capacity (the trade-off between keeping every detail and fitting more in the window): Consolidation can merge or delete records automatically: keep exact facts elsewhere
- Structured Storage (SQL/Postgres) (a database with fixed tables for exact facts): Memory is stored in LanceDB, not your records
- Session Caching (Redis/Key-Value) (saving a conversation's state so it can pause and resume): No session or thread (one saved conversation, here one per user and case) concept (scopes instead)
- Sanitization layer (code that masks personal details and secrets before anything is saved): No redaction;
privateflag; docs suggest a local LLM (large language model: the AI that reads and writes text (here, Claude)) for sensitive data - TTL (time-to-live) expiration (deleting saved data automatically after a set time): Not built in;
recency_half_life_daysonly affects ranking - Engineering Fix: Strict RAG and Citation Enforcement (answering only from retrieved sources, and flagging any answer without one): Yours
- Input Filtering: Relevance Pruning (checking and trimming a question before the AI sees it): Yours
Use both (complement), with your rules on top:
- Three-Tier Memory: Short-Term (Context Window) (what the AI sees in the current call): Recalled memories are injected before each task; no chat-window setting on the memory page
- Three-Tier Memory: Episodic (Experience Log) (a record of what happened, step by step): Memory records carry
sourceand time; the audit log (a permanent record of who did what and when) is yours - Agentic Outcome: Strict State Serialization (saving state so work can pause, crash and resume without loss): Memory is persistent; saving a run's state (everything the app must remember to continue correctly) isn't on the memory page
- Textual Summarization (rewriting old conversation into short, dense notes):
extract_memories()splits text into facts (not a summary) - The Hot/Cold State Architecture (splitting memory into what is in the current call (hot) and what is saved for later (cold)): The prompt (the instructions and text given to the AI) is hot;
Memoryis cold - GDPR Right to Be Forgotten (a person's right to have their stored data deleted (from the EU's GDPR law)):
memory.reset(scope="/customer/...")clears one scope - Engineering Fix: Recursive Goal Injection (repeating a short reminder of the rules before every AI answer): Role and goal in every task prompt (the instructions and text given to the AI) act as an anchor
- Process Control: Self-Correction Loop (checking the AI's answer and sending it back once to fix what failed): Task guardrails (checks that block unsafe or off-topic input and output) can reject output and retry
In NurseOps Now
Not used in NurseOps Now. CrewAI is planned as feature F14 in restaurant-ai-platform.
Trade-offs
- The least code for useful long-term memory, but the least control: LLM (large language model: the AI that reads and writes text (here, Claude)) analysis and consolidation change what's stored.
- No conversation thread (one saved conversation, here one per user and case) or token-window settings on the memory page; those are yours.
Interview answer
"CrewAI gives me one Memory with scopes: agents (an AI that chooses which tools to use to answer) remember and recall facts before each task, and I can reset one customer's scope for deletion. I'd keep exact facts in our own database, because CrewAI's LLM-based consolidation can rewrite memories, and I'd use a local model for anything sensitive."
All data in this post is made up.
Key terms
Every highlighted word in this post links here. Click β© Back to return to the spot you came from.
- agent
- An AI that chooses which tools to use to answer.Used in: In plain words, How to implement it (ServiceApps), The 27 solutions with CrewAI, Interview answerβ© Back to where you were
- agentic outcome: hybrid memory systems
- Recent chat in the window plus long-term search.Used in: The 27 solutions with CrewAIβ© Back to where you were
- agentic outcome: strict state serialization
- Saving state so work can pause, crash and resume without loss.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- agentic outcome: token budgets
- Keeping each call within a planned size.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- API key
- A secret code that lets the app use a paid service.Used in: How to implement it (ServiceApps)β© Back to where you were
- audit log
- A permanent record of who did what and when.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- dynamic context loading
- Giving the AI tools to fetch data only when it needs it, instead of putting everything in the prompt.Used in: The 27 solutions with CrewAIβ© Back to where you were
- embedding
- Text turned into numbers so similar meanings sit close together.Used in: How to implement it (ServiceApps)β© Back to where you were
- embeddings
- Text turned into numbers so similar meanings sit close together.Used in: What it gives you for memoryβ© Back to where you were
- engineering fix: recursive goal injection
- Repeating a short reminder of the rules before every AI answer.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- engineering fix: strict rag and citation enforcement
- Answering only from retrieved sources, and flagging any answer without one.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- entity extraction
- Pulling key facts (names, dates, IDs) out of text into a structured record.Used in: The 27 solutions with CrewAIβ© Back to where you were
- gdpr right to be forgotten
- A person's right to have their stored data deleted (from the EU's GDPR law).Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- guardrails
- Checks that block unsafe or off-topic input and output.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- input filtering: relevance pruning
- Checking and trimming a question before the AI sees it.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- LLM
- Large language model: the AI that reads and writes text (here, Claude).Used in: How to implement it (ServiceApps), The 27 solutions with CrewAI, Use both: what you still build, Trade-offsβ© Back to where you were
- memory types
- Working memory plus three long-term kinds: episodic, semantic, procedural.Used in: What it gives you for memoryβ© Back to where you were
- output guardrails: schema enforcement
- Requiring the AI's answer to match a fixed shape, checked in code.Used in: The 27 solutions with CrewAIβ© Back to where you were
- process control: self-correction loop
- Checking the AI's answer and sending it back once to fix what failed.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- prompt
- The instructions and text given to the AI.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- rolling summaries
- A short running summary that replaces old conversation turns.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- sanitization layer
- Code that masks personal details and secrets before anything is saved.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- semantic storage (vector db like pinecone, weaviate, or chroma)
- A vector database that finds text by meaning.Used in: The 27 solutions with CrewAIβ© Back to where you were
- ServiceApps
- A company platform for IT tickets, HR requests and help-center articles.Used in: How to implement it (ServiceApps)β© Back to where you were
- session caching (redis/key-value)
- Saving a conversation's state so it can pause and resume.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- state
- Everything the app must remember to continue correctly.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- structured storage (sql/postgres)
- A database with fixed tables for exact facts.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- system prompt pinning
- Keeping the rules in a protected place that is sent on every call and never trimmed.Used in: The 27 solutions with CrewAIβ© Back to where you were
- textual summarization
- Rewriting old conversation into short, dense notes.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- the engineering trade-off: fidelity vs. capacity
- The trade-off between keeping every detail and fitting more in the window.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- the hot/cold state architecture
- Splitting memory into what is in the current call (hot) and what is saved for later (cold).Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- the rehydration pattern
- Fetch saved state, keep only what's relevant, and put it back into the next call.Used in: The 27 solutions with CrewAIβ© Back to where you were
- thread
- One saved conversation, here one per user and case.Used in: The 27 solutions with CrewAI, Use both: what you still build, Trade-offsβ© Back to where you were
- three-tier memory: episodic (experience log)
- A record of what happened, step by step.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- three-tier memory: long-term (vector store)
- Knowledge saved outside the model and searched when needed.Used in: The 27 solutions with CrewAIβ© Back to where you were
- three-tier memory: short-term (context window)
- What the AI sees in the current call.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- token counting middleware
- Code that counts tokens before every AI call and acts when the window gets too full.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- tool
- A function the AI can call, such as policy search.Used in: The 27 solutions with CrewAIβ© Back to where you were
- ttl (time-to-live) expiration
- Deleting saved data automatically after a set time.Used in: The 27 solutions with CrewAI, Use both: what you still buildβ© Back to where you were
- vector compression via rag
- Storing text as vectors and pulling back only the parts that match.Used in: The 27 solutions with CrewAIβ© Back to where you were