Memory
CrewAI ships a unified Memory class instead of separate short-term / long-term / entity / external types. On save, an LLM infers scope, categories, and importance. Recall ranks by a composite of semantic similarity, recency, and importance.
Four ways to use it: standalone, with Crews, with Agents, or inside Flows.
Standalone
Tune recency_weight, semantic_weight, importance_weight, recency_half_life_days. extract_memories(long_text) splits atomic facts for individual remember calls.
If you omit scope, the LLM hangs the memory on a filesystem-like path (/project/decisions, /agent/researcher, …). recall searches that branch — more precise and faster. You can also remember(..., scope="/research/databases").
With Crews
memory=True creates a default Memory() and reuses the crew embedder. Without a custom embedder, memory defaults to OpenAI text-embedding-3-large (you need a working embeddings API). After each task, facts are extracted and stored; before the next task, relevant context is injected. Agents share crew memory unless they have their own.
With Agents (private scope)
The researcher only sees /agent/researcher. A writer with no memory= uses the crew’s shared memory. Useful for private drafts vs public write-up.
With Flows
Every Flow has self.remember(), self.recall(), and self.extract_memories().
Put facts you will retrieve later in Memory. Put this-run orchestration variables (current topic, QA pass/fail) on Flow state. State is workflow variables; Memory is retrievable knowledge.
vs LangChain checkpoints
LangChain memory centers on thread_id + a checkpointer (persisting chat messages). CrewAI Memory centers on cross-task facts and a scope tree. Resume long workflows with Flow @persist or Crew checkpoint — do not replace a state machine with remember alone.
Embedding cost, privacy, and keys are the same as any RAG stack — see RAG. Do not remember secrets or raw PII.