# Repository Briefing: aiming-lab/SimpleMem
> Source: https://repoforai.com/repo/aiming-lab/SimpleMem (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/aiming-lab/SimpleMem
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (65/100 · Maintenance 12/35 · Adoption 19/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v0.3.0 (2026-05-21) — https://github.com/aiming-lab/SimpleMem/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP
- **Momentum**: 3,883 ★ total (+2 24h / +3 7d) · 417 forks
- **Topics**: `agent`, `audio`, `compression`, `knowledge-graph`, `lifelong-memory`, `llm`, `mcp`, `memory`, `multimodal`, `python`, `rag`, `retrieval`
- **When to Use**: Best for: Long-running assistants that need compact recall from conversation history, with text clients using MCP and multimodal applications integrating through Python. Skip if: You mainly need a general-purpose vector database, verbatim transcript recovery without a separate archive, or full multimodal ingestion through MCP.

## Overview
```text
### Architecture & Core Mechanics
SimpleMem is an application-level memory layer, not a general-purpose vector database. In v0.3.0, `from simplemem import SimpleMem` exposes two backends behind one entry point: in auto mode `add_dialogue()` selects text, while `add_text()` and the media ingestion methods select Omni. The text pipeline turns dialogue into self-contained facts with resolved references and absolute timestamps, consolidates related fragments, then plans retrieval around query intent. The text example calls `finalize()` after ingestion and `ask()` for recall.

The MCP service persists LanceDB data and `users.db`. Omni uses a separate retrieval design, combining FAISS and BM25 with progressive token-budget expansion and a knowledge graph for cross-modal hops. EvolveMem is exposed through `simplemem.optimize(...)`, an offline evaluation and tuning path that produces a loadable `Config` rather than changing production retrieval automatically. The Python dependency list includes `accelerate` and `huggingface-hub`; the server extra adds MCP and FastAPI.

### Key Capabilities & Differentiators
Text retrieval combines semantic search, keyword matching, and metadata filtering. Memory construction and retrieval each have parallel settings with separate worker limits. The Python Omni API accepts text, images, audio, and video and applies modality-specific filtering before indexing. EvolveMem uses development questions with reference answers to evaluate settings such as `top_k`, fusion, answer verification, and reflection rounds, with rollback when proposed settings regress on the evaluation.

The text-only MCP surface supports token authentication, per-user tables, and Streamable HTTP using MCP 2025-03-26 and JSON-RPC 2.0. The Python setup accepts OpenAI-compatible endpoints; the supplied examples pair `gpt-4.1-mini` with `Qwen/Qwen3-Embedding-0.6B`. On LoCoMo, the project reports a 26.4% average F1 gain over prior systems and roughly 30-fold lower inference-time token consumption for text memory. Those results do not establish equivalent savings for ingestion, multimodal workloads, or production latency.

### Trade-offs & Limitations
Compared with indexing raw transcripts directly in LanceDB or FAISS, SimpleMem takes on fact extraction, consolidation, and query planning, so agents can retrieve compact context rather than whole dialogue chunks. This moves work into LLM-driven memory construction and makes recall sensitive to extraction errors, especially unresolved references and wrong timestamps. Semantic compression is not verbatim preservation. Keep source records separately when provenance, replay, or auditability matters.

MCP reduces client integration work for text, but Omni still requires Python and adds modality processing and indexes to size. Hosted inference shifts model compute off the service host while introducing provider charges, network dependency, and data-boundary considerations. EvolveMem adds offline evaluation cost and can tune to an unrepresentative development set; validate on held-out conversations before promotion. Per-user tables and token authentication are useful controls, but do not by themselves establish tenant-isolation guarantees or operational readiness.

### Hardware & Deployment Guide
Use Python 3.10+ with `pip install simplemem` or `pip install -e .` for source development; `pip install -e ".[server]"` adds MCP/HTTP dependencies. Set `OPENAI_API_KEY`, `OPENAI_BASE_URL`, and model names in `config.py` for the Python setup. The release sequence moved from text-only v0.1.0 to multimodal v0.2.0 and a unified package with auto-routing in v0.3.0. That package unification does not extend the MCP service to multimodal ingestion.

For self-hosted text MCP, populate `.env` and run `docker compose --env-file .env up -d`. The supplied Compose file publishes port 8000 and mounts the named volume `simplemem_data` at `/app/MCP/data`. Plan backups around that volume, not the `./data` bind mount described in the quick start. Replace the default `JWT_SECRET_KEY` and `ENCRYPTION_KEY` before exposure. Compose defaults to OpenRouter; the host Ollama option uses `http://host.docker.internal:11434/v1` for the LLM. Local service hosting alone does not establish offline operation: verify the paths for embedding and any other model calls too.
```

## Key Capabilities
```text
- Routing: One Python import dispatches dialogue ingestion to text memory and media-oriented ingestion methods to Omni.
- Text memory: Self-contained facts use resolved references and absolute timestamps; retrieval combines semantics, keywords, and metadata filters.
- Multimodal retrieval: Omni combines FAISS and BM25, progressively expands the token budget, and supports graph-based cross-modal hops.
- Offline tuning: EvolveMem searches retrieval settings on labeled development questions and saves the result as a reusable Config.
- Client integration: Text MCP supports Streamable HTTP with MCP 2025-03-26 and JSON-RPC 2.0; the deployment guide also lists an SSE endpoint.
- Persistence: Compose mounts the simplemem_data volume at /app/MCP/data for LanceDB and the users.db file.
```

## Quick Start / Clone
```bash
# 📥 Clone repository
git clone https://github.com/aiming-lab/SimpleMem.git
cd SimpleMem

# 📦 Install dependencies (pinned versions)
pip install -r requirements.txt

# — OR — install as an editable package
pip install -e .                  # default: text + multimodal + evolver
pip install -e ".[server]"        # + MCP / HTTP server (mcp, fastapi, ...)
pip install -e ".[all]"           # everything, including dev tools

# ⚙️ Configure API settings
cp config.py.example config.py
# Edit config.py with your API key and preferences
```
