mem0 Memory System
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
✨ mem0 Memory System ✨
A flexible memory system for AI applications that can be used in two ways:
- As an MCP (Memory Capabilities Provider) server for integration with MCP-compatible applications
- As a direct library integration for embedding memory capabilities directly in your applications
Made with ❤️ by Pink Pixel
Features
- Multi-Provider Support: Use OpenAI, Anthropic, Google, DeepSeek, OpenRouter, or Ollama (local)
- Flexible Embedding Options: Choose from OpenAI, HuggingFace, or Ollama for embeddings
- Local Storage: Store memories locally with ChromaDB and SQLite
- Configurable: Customize data directories, models, and parameters
- Autonomous Memory: Automatically extracts, stores, and retrieves user information without explicit commands
- User Isolation: Support for multiple users with isolated memory spaces
- Two Integration Methods: Server-based (MCP) or direct library integration
Installation
There are multiple ways to install and set up the mem0 MCP server:
Method 1: Manual Installation
- Clone the repository and navigate to the directory:Copy
- Install dependencies:Copy
- Create a
.env
file from the example:Copy - Edit the
.env
file with your API keys and settings (see Environment Configuration Guide for details).
Method 2: Using the Installer Script
The project includes a convenient installer script that automates the setup process:
The installer script provides the following features:
- Creates a Python virtual environment
- Installs all dependencies
- Sets up environment configuration
- Provides a guided setup experience with visual feedback
You can also customize the installation with options:
Running the Server
There are multiple ways to run the mem0 MCP server:
Method 1: Using the Python Script Directly
Start the server with default settings:
The server will automatically find the next available port if port 8000 is already in use.
Or customize with command-line arguments:
Additional options:
Method 2: Using the Run Server Script
For a more convenient experience, use the included shell script:
This script supports the same options as the Python script:
Method 3: Using the Launcher for MCP-Compatible Applications
For integrating with command-line applications like Cursor that use MCP, use the launcher script:
This script is specifically designed for MCP integration and outputs the server information in the format expected by MCP clients. It supports the same options as the other methods:
Integration Methods
Method 1: MCP Server (for MCP-Compatible Applications)
The MCP server provides a RESTful API that can be used by any application that supports the Machine Communication Protocol (MCP).
API Endpoints
Endpoint | Method | Description |
---|---|---|
/configure | POST | Configure the memory provider |
/memory/add | POST | Add a memory |
/memory/search | POST | Search for memories |
/memory/chat | POST | Chat with the AI using memories |
/memory/{memory_id} | GET | Get a memory by ID |
/memory/{memory_id} | DELETE | Delete a memory by ID |
/memories | DELETE | Clear all memories |
/health | GET | Health check |
/providers | GET | List available providers |
Using the Client
Integration with MCP-Compatible Applications
To integrate with applications that support MCP servers:
- Start the mem0 MCP server using the launcher script:Copy
- The script will output MCP server information in the format expected by MCP clients:Copy
- Configure your application to use the MCP server URL
- Use the memory capabilities through your application's interface
For detailed instructions, see the MCP Integration Guide.
Method 2: Direct Library Integration (for Any Application)
You can directly integrate the memory system into your own applications without running a separate server:
For detailed instructions, see the Direct Integration Guide.
Autonomous Memory System
The mem0 memory system includes an autonomous memory feature that can:
- Automatically extract important information from user interactions
- Store memories without explicit commands
- Retrieve relevant memories when needed for context
- Enhances the AI's responses by injecting memories into the context
This creates a seamless experience where the AI naturally remembers details about the user without requiring explicit memory commands.
Try the Autonomous Memory Example
The repository includes an example of the autonomous memory system:
This example demonstrates:
- Automatic extraction of personal information
- Contextual retrieval of memories
- Natural incorporation of memories into responses
Environment Configuration
The mem0 memory system can be configured using environment variables or a .env
file:
For a complete list of configuration options, see the Environment Configuration Guide.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Made with ❤️ by Pink Pixel | GitHub
This server cannot be installed
A flexible memory system for AI applications that supports multiple LLM providers and can be used either as an MCP server or as a direct library integration, enabling autonomous memory management without explicit commands.
- Features
- Installation
- Running the Server
- Integration Methods
- Autonomous Memory System
- Environment Configuration
- Contributing
- License
- Acknowledgements