CrewAI: Agent Memory Is a Cognitive, Not Storage, Problem—Resolving Contradictions and Gating Recall via Confidence in a Single Table
In a blog post on the LanceDB vendor site, CrewAI CEO Joao Moura outlined a restructuring of its agent memory architecture: redefining memory from passive storage retrieval to an active cognitive system. By implementing conflict detection during encoding, threshold-based resolution during consolidation, and composite scoring during recall, the system completes tasks previously requiring coordination between two separate systems within a single LanceDB table.
CrewAI's previous memory architecture consisted of two components: a vector database responsible for embedding storage and similarity retrieval, and another database handling structured memory states. Long-term memory, short-term memory, entity memory, and embedding-backed tools all routed through this combination. CEO Joao Moura described a specific failure mode: an agent learns one thing on Monday and a contradictory thing on Friday, then remembers both.
Moura framed the core judgment of this restructuring as: memory is not a storage problem, but a cognitive problem. This means the system must decide what to remember, how to handle contradictions, and when to forget at the time of writing, rather than pushing these decisions to the application layer.
At the implementation level, the new system includes five cognitive operations: encoding, consolidation, recall, extraction, and forgetting. During the encoding phase, the system analyzes content, assigns scope and category, and assigns importance weights on a 0–1 scale before writing. When a new memory conflicts with a stored one exceeding a 0.85 threshold, the consolidation operation intervenes: the old record is updated, context is preserved, and outdated facts are removed. The recall phase no longer uses static similarity lookup; instead, it uses composite scoring: score = (similarity × w_sim) + (recency × w_rec) + (importance × w_imp). A critical architectural decision from six months ago can outrank a casual mention from yesterday. When confidence is insufficient, the system searches deeper before returning, rather than directly providing nearest-neighbor results.