Kazdell/Mem0ai---Rust

Mem0ai but using Pure Rust instead Python

Rust

0

6 commits

updated Jun 3, 2026

See the code

README

Mem0 Local (Rust Standalone) v1.0.0

Offline, in-process, long-term memory layer for AI agents — Built 100% in Rust. No Docker. No API keys.

A lightweight standalone implementation of Mem0 designed to run entirely on your local machine. Stores vector embeddings in a plain JSON file and exposes them via CLI, Web Dashboard, or MCP (Model Context Protocol) for AI editor integration.


✨ Features

FeatureDetails
Offline EmbeddingsUses glowrs (Rust Sentence Transformers via Hugging Face Candle) — pure CPU, no GPU needed
Zero Dependencies at RuntimeSingle .exe file. No Docker, no Python, no external services
MCP ServerStdIO JSON-RPC server compatible with Cursor, Windsurf, Claude Desktop
Web DashboardEmbedded HTTP server with Glassmorphism UI for managing memories visually
CLI Subcommandsadd, search, list, delete, clear for scripting and automation
Interactive MenuAuto-launched when no subcommand is given — prevents window self-closing on Windows
Bilingual UIToggle between English and Vietnamese in the interactive menu
Multi-User SupportSeparate memory namespaces per user_id

🖥️ System Requirements

RequirementDetails
OSWindows 10/11 x64 (primary), Linux/macOS (build from source)
RAM≥ 4 GB recommended (embedding model uses ~100–200 MB)
Disk~30 MB for the .exe + model files (auto-downloaded on first run)
InternetOnly needed on first run to download the embedding model from HuggingFace (then fully offline)

To build from source: Requires Rust toolchain (rustup) + windres and ar (from MinGW-w64) in your PATH on Windows.


🚀 Quick Start

Option 1: Download Pre-built Binary

Download mem0_rust_server.exe from the Releases page and run:

.\mem0_rust_server.exe

The interactive menu will launch. On first use, the embedding model is automatically downloaded from HuggingFace (~90 MB).

Option 2: Use a Local Model (Fully Offline)

Place the model files in a model\ folder next to the .exe:

mem0_rust_server.exe
model\
  model.safetensors
  config.json
  tokenizer.json

The app detects the local model automatically and skips the network download.

Option 3: Build from Source

git clone https://github.com/mem0ai/mem0
cd mem0
cargo build --release
.\target\release\mem0_rust_server.exe

📁 Data Storage

All memories are stored in:

~/.mem0_rust/db.json

User preferences (language setting) are stored in:

~/.mem0_rust/config.json

🔧 CLI Reference

# Add a new memory
.\mem0_rust_server.exe add "User prefers Rust for backend development" --user alice

# Semantic search
.\mem0_rust_server.exe search "favorite programming language" --user alice --limit 5

# List all memories for a user
.\mem0_rust_server.exe list --user alice

# Delete a memory by ID
.\mem0_rust_server.exe delete <uuid>

# Clear all memories for a user
.\mem0_rust_server.exe clear --user alice

# Launch Web Dashboard on port 8899
.\mem0_rust_server.exe dashboard --port 8899

# Launch MCP StdIO Server
.\mem0_rust_server.exe mcp

Default --user value: default (used when --user is not specified).


🌐 Web Dashboard

Launch with:

.\mem0_rust_server.exe dashboard

Then open your browser at: http://localhost:8899

Features:

  • View, search, and delete memories in a Glassmorphism UI
  • Real-time semantic search
  • Dark/Light mode toggle

🤖 MCP Integration (for AI Editors)

Claude Desktop / Cursor / Windsurf

Add to your MCP config file (e.g., claude_desktop_config.json or .cursor/mcp.json):

{
  "mcpServers": {
    "mem0": {
      "command": "C:/path/to/mem0_rust_server.exe",
      "args": ["mcp"]
    }
  }
}

Config file locations:

  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Cursor: .cursor/mcp.json in your project root or ~/.cursor/mcp.json globally
  • Windsurf: ~/.codeium/windsurf/mcp_config.json

Available MCP Tools

ToolDescriptionRequired Args
add_factAdd a new fact/memoryfact, user_id
search_factsSemantic search for memoriesquery, user_id
get_all_factsList all memories for a useruser_id
delete_factDelete a memory by IDfact_id
delete_all_factsClear all memories for a useruser_id

Example MCP Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_fact",
    "arguments": {
      "fact": "User prefers concise code reviews",
      "user_id": "alice"
    }
  }
}

🏗️ Architecture

src/
├── main.rs        — CLI entry point, DB path resolution, command routing
├── config.rs      — Language preference persistence
├── db.rs          — JSON flat-file database (load/save)
├── embedding.rs   — Sentence Transformer init + cosine similarity
├── mcp.rs         — StdIO MCP JSON-RPC server (5 tools)
├── dashboard.rs   — Embedded HTTP server + Glassmorphism HTML/CSS/JS UI
└── interactive.rs — Interactive terminal menu (bilingual EN/VI)
build.rs           — Windows resource compiler (icon embedding via windres)

🔗 References & Credits


📄 License

MIT License — See LICENSE for details.

Contributors

Kazdell

6 commits

Kazdell/Mem0ai---Rust

Mem0ai but using Pure Rust instead Python

Rust

0

6 commits

updated Jun 3, 2026

See the code

README

Mem0 Local (Rust Standalone) v1.0.0

Offline, in-process, long-term memory layer for AI agents — Built 100% in Rust. No Docker. No API keys.

A lightweight standalone implementation of Mem0 designed to run entirely on your local machine. Stores vector embeddings in a plain JSON file and exposes them via CLI, Web Dashboard, or MCP (Model Context Protocol) for AI editor integration.


✨ Features

FeatureDetails
Offline EmbeddingsUses glowrs (Rust Sentence Transformers via Hugging Face Candle) — pure CPU, no GPU needed
Zero Dependencies at RuntimeSingle .exe file. No Docker, no Python, no external services
MCP ServerStdIO JSON-RPC server compatible with Cursor, Windsurf, Claude Desktop
Web DashboardEmbedded HTTP server with Glassmorphism UI for managing memories visually
CLI Subcommandsadd, search, list, delete, clear for scripting and automation
Interactive MenuAuto-launched when no subcommand is given — prevents window self-closing on Windows
Bilingual UIToggle between English and Vietnamese in the interactive menu
Multi-User SupportSeparate memory namespaces per user_id

🖥️ System Requirements

RequirementDetails
OSWindows 10/11 x64 (primary), Linux/macOS (build from source)
RAM≥ 4 GB recommended (embedding model uses ~100–200 MB)
Disk~30 MB for the .exe + model files (auto-downloaded on first run)
InternetOnly needed on first run to download the embedding model from HuggingFace (then fully offline)

To build from source: Requires Rust toolchain (rustup) + windres and ar (from MinGW-w64) in your PATH on Windows.


🚀 Quick Start

Option 1: Download Pre-built Binary

Download mem0_rust_server.exe from the Releases page and run:

.\mem0_rust_server.exe

The interactive menu will launch. On first use, the embedding model is automatically downloaded from HuggingFace (~90 MB).

Option 2: Use a Local Model (Fully Offline)

Place the model files in a model\ folder next to the .exe:

mem0_rust_server.exe
model\
  model.safetensors
  config.json
  tokenizer.json

The app detects the local model automatically and skips the network download.

Option 3: Build from Source

git clone https://github.com/mem0ai/mem0
cd mem0
cargo build --release
.\target\release\mem0_rust_server.exe

📁 Data Storage

All memories are stored in:

~/.mem0_rust/db.json

User preferences (language setting) are stored in:

~/.mem0_rust/config.json

🔧 CLI Reference

# Add a new memory
.\mem0_rust_server.exe add "User prefers Rust for backend development" --user alice

# Semantic search
.\mem0_rust_server.exe search "favorite programming language" --user alice --limit 5

# List all memories for a user
.\mem0_rust_server.exe list --user alice

# Delete a memory by ID
.\mem0_rust_server.exe delete <uuid>

# Clear all memories for a user
.\mem0_rust_server.exe clear --user alice

# Launch Web Dashboard on port 8899
.\mem0_rust_server.exe dashboard --port 8899

# Launch MCP StdIO Server
.\mem0_rust_server.exe mcp

Default --user value: default (used when --user is not specified).


🌐 Web Dashboard

Launch with:

.\mem0_rust_server.exe dashboard

Then open your browser at: http://localhost:8899

Features:

  • View, search, and delete memories in a Glassmorphism UI
  • Real-time semantic search
  • Dark/Light mode toggle

🤖 MCP Integration (for AI Editors)

Claude Desktop / Cursor / Windsurf

Add to your MCP config file (e.g., claude_desktop_config.json or .cursor/mcp.json):

{
  "mcpServers": {
    "mem0": {
      "command": "C:/path/to/mem0_rust_server.exe",
      "args": ["mcp"]
    }
  }
}

Config file locations:

  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Cursor: .cursor/mcp.json in your project root or ~/.cursor/mcp.json globally
  • Windsurf: ~/.codeium/windsurf/mcp_config.json

Available MCP Tools

ToolDescriptionRequired Args
add_factAdd a new fact/memoryfact, user_id
search_factsSemantic search for memoriesquery, user_id
get_all_factsList all memories for a useruser_id
delete_factDelete a memory by IDfact_id
delete_all_factsClear all memories for a useruser_id

Example MCP Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_fact",
    "arguments": {
      "fact": "User prefers concise code reviews",
      "user_id": "alice"
    }
  }
}

🏗️ Architecture

src/
├── main.rs        — CLI entry point, DB path resolution, command routing
├── config.rs      — Language preference persistence
├── db.rs          — JSON flat-file database (load/save)
├── embedding.rs   — Sentence Transformer init + cosine similarity
├── mcp.rs         — StdIO MCP JSON-RPC server (5 tools)
├── dashboard.rs   — Embedded HTTP server + Glassmorphism HTML/CSS/JS UI
└── interactive.rs — Interactive terminal menu (bilingual EN/VI)
build.rs           — Windows resource compiler (icon embedding via windres)

🔗 References & Credits


📄 License

MIT License — See LICENSE for details.

Contributors

Kazdell

6 commits

Languages

Rust

100.0%