Entity Memory

intermediate
Memory TypesLast updated: 2025-01-15

What is Entity Memory?


Entity memory is a memory system that maintains structured information about specific entities (people, organizations, locations, concepts, etc.) that have been mentioned or discussed during agent interactions. Rather than storing raw conversation text, entity memory extracts and organizes facts about entities in a structured format, enabling efficient lookup of "what do we know about X?" queries and supporting entity-centric reasoning.


The memory system typically uses entity extraction to identify entity mentions in conversations or documents, then stores attributes, facts, and relationships associated with each entity. For example, when a user mentions "Alice works at OpenAI as a researcher," the entity memory would create or update entities for "Alice" and "OpenAI," recording Alice's job title and her employment relationship. This structured storage enables the agent to answer questions like "Where does Alice work?" or "Who works at OpenAI?" efficiently.


Entity memory is particularly valuable for agents that need to track information about multiple people, projects, or concepts over extended interactions. It complements other memory types: while conversation memory tracks dialogue flow and vector memory handles semantic retrieval, entity memory provides structured, queryable knowledge. LangChain and other frameworks often implement entity memory as part of their memory module offerings, sometimes backed by graph databases or structured stores for efficient entity-relationship queries.


Related Terms