Memory Modules Overview

Complete guide to MemOS memory systems - from lightweight text memory to advanced graph structures, choose the right memory module for your needs

Memory Modules Overview

MemOS provides a rich set of memory modules to meet various needs from rapid prototyping to production environments. This guide helps you quickly find the most suitable memory solution.

🎯 Quick Selection Guide

Not sure which to choose? Follow this decision tree:


πŸ“š Memory Module Categories

I. Textual Memory Series

Focused on storing and retrieving text-based memories, suitable for most application scenarios.

NaiveTextMemory: Simple Textual Memory

Use Cases: Rapid prototyping, demos, teaching, small-scale applications

Core Features:

  • βœ… Zero dependencies, pure in-memory storage
  • βœ… Keyword-based retrieval
  • βœ… Minimal API, get started in 5 minutes
  • βœ… File persistence support

Limitations:

  • ❌ No vector semantic search
  • ❌ Not suitable for large-scale data
  • ❌ Limited retrieval precision

πŸ“– View Documentation

GeneralTextMemory: General-Purpose Textual Memory

Use Cases: Conversational agents, personal assistants, knowledge management systems

Core Features:

  • βœ… Vector-based semantic search
  • βœ… Rich metadata support (type, time, source, etc.)
  • βœ… Flexible filtering and querying
  • βœ… Suitable for medium to large-scale applications

Technical Requirements:

  • Requires vector database (Qdrant, etc.)
  • Requires embedding model

πŸ“– View Documentation

PreferenceTextMemory: Preference Memory

Use Cases: Personalized recommendations, user profiling, intelligent assistants

Core Features:

  • βœ… Automatic detection of explicit and implicit preferences
  • βœ… Preference deduplication and conflict detection
  • βœ… Filter by preference type and strength
  • βœ… Vector semantic retrieval

Specialized Functions:

  • Dual preference extraction (explicit/implicit)
  • Preference strength scoring
  • Temporal decay support

πŸ“– View Documentation

TreeTextMemory: Hierarchical Structured Memory

Use Cases: Knowledge graphs, complex relationship reasoning, multi-hop queries

Core Features:

  • βœ… Graph database-based structured storage
  • βœ… Support for hierarchical relationships and causal chains
  • βœ… Multi-hop reasoning capabilities
  • βœ… Deduplication, conflict detection, memory scheduling

Advanced Features:

  • Supports MultiModal Reader (images, URLs, files)
  • Supports Internet Retrieval (BochaAI, Google, Bing)
  • Working memory replacement mechanism

Technical Requirements:

  • Requires graph database (Neo4j, etc.)
  • Requires vector database and embedding model

πŸ“– View Documentation


II. Specialized Memory Modules

Memory systems optimized for specific scenarios.

KVCacheMemory: Activation Memory

Use Cases: LLM inference acceleration, high-frequency background knowledge reuse

Core Features:

  • ⚑ Pre-computed KV Cache, skip repeated encoding
  • ⚑ Significantly reduce prefill phase computation
  • ⚑ Suitable for high-throughput scenarios

Typical Use Cases:

  • FAQ caching
  • Conversation history reuse
  • Domain knowledge preloading

How It Works: Stable text memory β†’ Pre-convert to KV Cache β†’ Direct injection during inference

πŸ“– View Documentation

ParametricMemory: Parametric Memory

Status: 🚧 Under Development

Design Goals:

  • Encode knowledge into model weights (LoRA, expert modules)
  • Dynamically load/unload capability modules
  • Support multi-task, multi-role architecture

Future Features:

  • Parameter module generation and compression
  • Version control and rollback
  • Hot-swappable capability modules

πŸ“– View Documentation


III. Graph Database Backends

Provide graph storage capabilities for TreeTextMemory.

Neo4j Graph DB

Recommendation: ⭐⭐⭐⭐⭐

Features:

  • Complete graph database functionality
  • Support for vector-enhanced retrieval
  • Multi-tenant architecture (v0.2.1+)
  • Compatible with Community Edition

πŸ“– View Documentation

Nebula Graph DB

Features:

  • Distributed graph database
  • High availability
  • Suitable for large-scale deployment

πŸ“– View Documentation

PolarDB Graph DB

Features:

  • Alibaba Cloud PolarDB graph computing
  • Cloud-native architecture
  • Enterprise-grade reliability

πŸ“– View Documentation


πŸ“Š Feature Comparison Table

FeatureNaiveGeneralPreferenceTreeKVCache
Search MethodKeywordVector SemanticVector SemanticVector+GraphN/A
Metadata Support⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐-
Relationship ReasoningβŒβŒβŒβœ…-
Deduplication❌⭐⭐⭐⭐⭐⭐⭐⭐-
ScalabilitySmallMedium-LargeMedium-LargeLarge-
Deployment ComplexityMinimalMediumMediumHigherMedium
Inference Acceleration----⭐⭐⭐⭐⭐

πŸ› οΈ Usage Scenario Recommendations

Scenario 1: Rapid Prototyping

Recommended: NaiveTextMemory

from memos.memories import NaiveTextMemory
memory = NaiveTextMemory()
memory.add("User likes coffee")
results = memory.search("coffee")

Scenario 2: Chatbot Memory

Recommended: GeneralTextMemory

  • Supports semantic search
  • Filter by time, type, source
  • Suitable for conversation history management

Scenario 3: Personalized Recommendation System

Recommended: PreferenceTextMemory

  • Automatic user preference extraction
  • Preference conflict detection
  • Strength scoring and filtering

Scenario 4: Knowledge Graph Applications

Recommended: TreeTextMemory

  • Multi-hop relationship queries
  • Hierarchical structure management
  • Complex reasoning scenarios

Scenario 5: High-Performance LLM Services

Recommended: KVCacheMemory

  • FAQ systems
  • Customer service bots
  • High-volume request processing

πŸ”— Advanced Features

MultiModal Reader (Multimodal Reading)

Supported in TreeTextMemory for processing:

  • πŸ“· Images in conversations
  • 🌐 Web URLs
  • πŸ“„ Local files (PDF, DOCX, TXT, Markdown)
  • πŸ”€ Mixed mode (text+images+URLs)

πŸ‘‰ View Examples

Internet Retrieval

Fetch real-time information from the web and add to memory:

  • πŸ” BochaAI search
  • 🌍 Google search
  • πŸ”Ž Bing search

πŸ‘‰ View Examples


πŸš€ Quick Start

  1. Choose Memory Module - Select the appropriate module based on the guide above
  2. Read Documentation - Click the corresponding link to view detailed documentation
  3. Hands-On Practice - Each module has complete code examples
  4. Production Deployment - Refer to the best practices section


Beginner Suggestion: Start with NaiveTextMemory, understand the basic concepts, then explore GeneralTextMemory and TreeTextMemory.