MemOS Scenario Examples
Introduction
Cookbook Philosophy: Problem-Oriented Approach
Welcome to the MemOS Cookbook! This is not a traditional technical documentation, but a hands-on guide focused on solving real problems.
Why do we need this Cookbook?
In AI application development, we often encounter these challenges:
- π€ "How can I make my AI application remember user preferences?"
- π "How can I quickly retrieve relevant information from a large number of documents?"
- π‘ "How can I build an intelligent assistant with long-term memory?"
Traditional documentation tells you what it is, API references tell you how to call it, while this Cookbook focuses on telling you how to solve specific problems.
Core Philosophy of this Cookbook:
- Problem-Driven: Each recipe starts from a real use case scenario
- Practice-Oriented: Provides complete code examples that can be run directly
- Progressive Learning: From simple to complex, step by step
- Best Practices: Incorporates experience and recommendations from production environments
π Complete Chapter Navigation
Chapter 1: Getting Started: Your First MemCube
Core Skills: Environment configuration, MemCube basic operations, data import and management
- API Version
- Recipe 1.1: Configure MemOS Development Environment (API Version)
- Recipe 1.2: Build a Simple MemCube from Documents (API Version)
- Recipe 1.3: MemCube Basic Operations (API Version)
- Ollama Version
- Recipe 1.1: Configure MemOS Development Environment (Ollama Version)
- Recipe 1.2: Build a Simple MemCube from Documents (Ollama Version)
- Recipe 1.3: MemCube Basic Operations (Ollama Version)
Chapter 2: Structured Memory: TreeNodeTextualMemoryMetadata
Core Skills: Structured memory, metadata management, multi-source tracking
- API Version
- Recipe 2.1: Understanding Core Concepts of
TreeNodeTextualMemoryMetadata
- Recipe 2.2: Creating Basic Structured Memory (API Version)
- Recipe 2.3: Common Field Descriptions and Configuration
- Recipe 2.1: Understanding Core Concepts of
- Ollama Version
- Recipe 2.1: Understanding Core Concepts of
TreeNodeTextualMemoryMetadata
- Recipe 2.2: Creating Basic Structured Memory (Ollama Version)
- Recipe 2.3: Common Field Descriptions and Configuration
- Recipe 2.1: Understanding Core Concepts of
Chapter 3: Building an Intelligent Novel Analysis System with MemOS
Core Skills: Text preprocessing, AI-driven memory extraction, intelligent reasoning systems, creative application development
- Recipe 3.0: Text Preprocessing and API Environment Configuration
- Recipe 3.1: AI-Driven Character Recognition and Alias Unification
- Recipe 3.2: Structured Memory Content Extraction
- Recipe 3.3: Memory-Based Intelligent Reasoning System
- Recipe 3.4: Embedding Model Optimization Configuration
- Recipe 3.5: Memory Graph Structure Transformer
- Recipe 3.6: MemOS Integration and Query Validation
- Creative Showcase:
- Intelligent World Timeline System
- Dynamic Working Memory World Background
- MemOS-Driven Text MUD Game
π Coming Soon
- Chapter 4: Building Production-Grade Knowledge Q&A System with MemOS
π― Recommended Learning Paths
π’ Beginner Path (Total 4-6 hours)
Chapter 1 (API or Ollama version) β Chapter 2 (corresponding version)
For: Developers new to MemOS Goal: Master basic operations and structured memory
π‘ Intermediate Path (Total 8-12 hours)
Chapter 1 β Chapter 2 β Chapter 3 (Intelligent Novel Analysis System)
For: Developers with some AI development experience Goal: Master complex text processing, AI-driven memory extraction and intelligent reasoning systems
π΄ Advanced Path (Total 12-20 hours)
Complete learning of all chapters + creative extension practice
For: Developers who want to build production-grade applications Goal: Master advanced features and innovative application patterns of MemOS
How to Use This Cookbook Effectively
π Reading Suggestions:
- Beginners: Recommended to read in chapter order, practice each recipe hands-on
- Experienced developers: Can jump directly to recipes of interest
- Problem solvers: Use the directory above to quickly locate relevant recipes
- Path learners: Follow the learning paths above for systematic learning
π οΈ Practice Suggestions:
- Prepare environment: Ensure Python 3.10+ and related dependencies are installed
- Hands-on practice: Each recipe contains complete runnable code
- Experiment with variations: Try modifying parameters to observe different effects
- Problem solving: Check FAQ sections or seek community help when encountering issues
π§ Code Conventions:
# π‘ Tip: Important concepts or best practices
# β οΈ Note: Items requiring special attention
# π― Goal: Purpose of current step
π§ Environment Preparation
System Requirements
- Python 3.10+
- 8GB+ RAM (16GB recommended)
- 50GB+ available disk space
Dependency Installation
pip install MemoryOS
# Optional: Neo4j, Ollama, OpenAI API
Installation Verification
import memos
print(f"MemOS Version: {memos.__version__}")
Relationship with Other Documentation (Tutorials, API References, etc.)
Documentation Ecosystem:
- π Quick Start Tutorial: Helps you get started with MemOS basic features in 5 minutes
- π This Cookbook: In-depth practical recipes to solve specific problems
- π API Reference: Detailed technical specifications of functions and classes
- ποΈ Architecture Documentation: System design and extension guides
When to use which documentation:
Scenario | Recommended Documentation | Description |
---|---|---|
New to MemOS | Quick Start Tutorial | Learn basic concepts and core features |
Solving specific problems | This Cookbook | Find corresponding recipes and solutions |
Looking up function usage | API Reference | View parameter and return value details |
System design | Architecture Documentation | Understand internal mechanisms and extension methods |
π Getting Help
- GitHub Issues: Submit technical issues and bug reports at MemOS Issues
- GitHub Discussions: Exchange experiences and ask questions at MemOS Discussions
- Discord Community: Join MemOS Discord Server for real-time communication
- Official Documentation: Check MemOS Official Documentation for detailed usage guides
- API Reference: Check MemOS API Documentation for interface details
- WeChat Group: Scan QR Code to join WeChat technical exchange group
Let's start this exciting MemOS learning journey!
Parametric Memory
API
MemCube is the core component of MemOS, like a 'memory chip' in Cyberpunk 2077, allowing agents to load different 'memory packages' to gain different knowledge and abilities. In this chapter, we will help you master the basic operations of MemCube through three progressive recipes.<br/>Note that the MemOS system has two levels: OS level and Cube level. Here we first introduce the more basic Cube level. Many of the operations below, such as add and search operations, also exist at the OS level. The difference is: OS manages multiple Cubes and can perform overall search and operations on multiple Cubes, while Cube is only responsible for its own writing and querying.