Memory types in CrewAI

CrewAI implements a multi-tier memory system. Short-term memory stores the most recent interactions and task results within a crew run, making recent context available to agents that need it without requiring them to receive every previous task output explicitly. Long-term memory persists information to an external storage backend that survives across crew runs — allowing an agent to recall relevant information from previous sessions when working on a related task days or weeks later. Entity memory tracks specific named entities — people, organizations, projects, concepts — maintaining accumulated facts about them across interactions. Contextual memory is a retrieval layer that queries all available memory sources and returns the most relevant information for a given task context.

Configuring and enabling memory

CrewAI memory is disabled by default and must be explicitly enabled when creating a crew. Short-term and entity memory are enabled with a flag; long-term memory requires configuring an external storage backend — typically a vector store or database that CrewAI can write to and query. Once enabled, memory collection is largely automatic: agents' outputs and the information they process are stored without explicit save calls in the agent code. Retrieval is also automatic: when an agent begins a task, the memory system retrieves relevant context from available memory sources and includes it in the agent's context. Custom memory configurations allow control over storage backends, retention policies, and retrieval parameters.

Privacy and data management considerations

Enabling long-term memory means the crew stores information about interactions in persistent external storage. For applications that process personal information, this creates data handling obligations: what is stored, for how long, who can access it, and how it can be deleted. CrewAI does not enforce data retention policies — those are the application developer's responsibility to implement through the storage backend's capabilities. Memory stored about individual users may be subject to privacy regulations including the right to erasure, which requires a path to identify and delete all stored data about a specific individual — a capability that must be designed into the storage architecture before memory is enabled for user-facing applications.