Key Concepts
Understanding MemFuse's memory architecture
Key Concepts in MemFuse
MemFuse provides a sophisticated memory architecture for AI agents, enabling human-like interactions and evolutionary learning. This document explains the core concepts that form the foundation of the framework.
What is a Memory?
In MemFuse, a memory is fundamentally owned by an AI agent. A memory can be created or exist within multiple optional contexts, offering extensive flexibility:
- Agent-only context: Memories injected directly into an agent without interaction.
- Conversation context: Episodic memories created during interactions between agents and users.
- User context: Memories tied specifically to interactions or information from individual users.
- Multi-user context: Shared memories representing common knowledge or interactions involving multiple users.
- Agent-to-agent sharing: Memories shared directly between AI agents without a conversational intermediary, enabling efficient agent-to-agent communication.
This comprehensive setup allows agents to dynamically manage diverse forms of memory, creating a rich, layered context for meaningful AI interactions.
Types of Memory
MemFuse deals with various kinds of memories:
Semantic Memory: Facts and Knowledge
MemFuse uses a Knowledge Graph to manage facts and knowledge, which updates itself as new facts are added and reconciles when conflicting facts are present. Semantic Memory also includes:
- Profiles: Stores memories of the agent about users
- Personalities: Represents the personality of the agent, shaped by past system prompts and words said by the agent
These components allow developers to create more human-like agents that evolve with the users they've interacted with. For example, if an agent receives a system prompt to act like Doraemon, the personality of the agent will adopt those characteristics. The agent maintains that personality and can only be updated gradually, unless the Personality is explicitly deleted.
Episodic Memory: Past Experiences
Episodic memory preserves successful interactions as learning examples that guide future behavior. Unlike semantic memory which stores facts, episodic memory captures the full context of an interaction—the situation, the thought process that led to success, and why that approach worked. These memories help the agent learn from experience, adapting its responses based on what has worked before.
Reflective Memory: Higher-Level Understanding
Reflective memory synthesizes information from other memory types to create higher-level insights, patterns, and abstractions. It represents the agent's ability to contemplate its own knowledge and experiences, similar to how humans reflect on their past to form deeper understanding. Through reflective memory, the agent can:
- Generate insights by connecting information across different memories
- Recognize patterns in user behavior and preferences
- Perform advanced reasoning about complex situations
- Resolve conflicts between contradictory memories
This introspective capability allows agents to continuously evolve their understanding and provide more contextually appropriate responses.
Levels of Memories: Three-Level Memory Architecture
MemFuse employs a hierarchical 3-level structure designed to efficiently handle context, knowledge, and insights:
Level 0 – Conversations (Verbatim Memory)
Stores the exact transcript of interactions between users and the AI, enabling immediate retrieval for reference and clarity.
Level 1 – Semantic & Episodic Memories
- Semantic Memory: Stores structured facts, concepts, and general knowledge derived from past interactions, forming a knowledge base for quick, accurate reference.
- Episodic Memory: Retains contextual recollections of events, interactions, and situations from past sessions, allowing the AI to recall specifics such as who, what, where, and when.
Level 2 – Reflective Memory
Synthesizes information from Levels 0 and 1, creating higher-level insights, patterns, and abstractions. This enables advanced reasoning, conflict resolution among memories, and generation of informed, context-aware decisions. Reflective Memory represents the agent's ability to contemplate its own knowledge and experiences, similar to how humans reflect on their past to form deeper understanding.