# SimpleMem

> Lifelong memory for LLM agents, across text, image, audio and video

- Category: Agents & Automation / Agent Memory
- Language: Python
- Licence: MIT
- Repository: https://github.com/aiming-lab/SimpleMem
- Canonical page: https://ai-tldr.dev/tools/simplemem/

## In short

SimpleMem is a long-term memory system for LLM agents. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python and licensed MIT. To get started: install.

## Overview

SimpleMem is a long-term memory system for LLM agents. It turns dialogue and facts into structured, atomic memories, indexes them with semantic embeddings and structured metadata, and retrieves them by meaning rather than keywords — so an agent can recall what happened in an earlier session without replaying the whole history into the context window.

The project ships as one `simplemem` package with three backends behind a single import. The default `mode="auto"` picks the backend from the first method you call: `add_dialogue()` routes to the text backend, while `add_text()`, `add_image()`, `add_audio()` or `add_video()` route to Omni-SimpleMem, which handles multimodal memory. A third component, EvolveMem, exposes a self-evolution loop through `simplemem.optimize(...)` that uses LLM-driven closed-loop diagnosis to tune the retrieval infrastructure itself.

It is designed to plug into tools you already run rather than to be the agent. A hosted MCP server at mcp.simplemem.cloud gives text memory to any MCP client — Claude Desktop, Cursor, LM Studio, Cherry Studio and others — while full multimodal memory is used through the Python package. The backend LLM is configured through an OpenAI-compatible `OPENAI_BASE_URL`, so it runs against hosted or self-hosted models. SimpleMem is MIT-licensed, published on PyPI, and accompanied by an arXiv paper (2601.02553) and an ICML'26 acceptance.

## What it does

- Three-step memory loop — store as structured atomic memories, index with semantic embeddings and metadata, retrieve by meaning
- One package, three backends: SimpleMem (text), Omni-SimpleMem (text, image, audio, video) and EvolveMem (self-evolving retrieval)
- mode="auto" picks the backend from the first call you make, so there is no manual configuration to get started
- MCP server for text memory, usable from Claude Desktop, Cursor, LM Studio, Cherry Studio or any other MCP client
- Python API with add_dialogue / add_text / add_image / add_audio / add_video, a finalize step, and ask() or query() retrieval
- OpenAI-compatible backend configuration, so memory construction, retrieval and judging can run on any compatible endpoint

## Getting started

Install the package, then write memories and ask questions. The default auto mode chooses the text or multimodal backend for you based on which method you call first.

1. Install

   SimpleMem is on PyPI as a single unified package.

```bash
pip install simplemem
```

2. Store a dialogue and ask about it

   Calling add_dialogue() selects the text backend. finalize() commits the memories; ask() answers from them.

```python
from simplemem import SimpleMem

mem = SimpleMem()  # mode="auto" — backend chosen by first call

mem.add_dialogue(
    "Alice",
    "Bob, let's meet at Starbucks tomorrow at 2pm",
    "2025-11-15T14:30:00",
)
mem.add_dialogue(
    "Bob",
    "Sure, I'll bring the market analysis report",
    "2025-11-15T14:31:00",
)
mem.finalize()

answer = mem.ask("When and where will Alice and Bob meet?")
```

3. Or store multimodal memories

   Calling add_text(), add_image(), add_audio() or add_video() selects the Omni backend. Tags group items into a session, and query() returns the top matches.

```python
from simplemem import SimpleMem

mem = SimpleMem()  # auto mode

mem.add_text(
    "User loves hiking in the Rocky Mountains.",
    tags=["session_id:D1"],
)
mem.add_image("photo.jpg", tags=["session_id:D1"])
mem.add_audio("voice_note.wav", tags=["session_id:D1"])

result = mem.query("What does the user enjoy?", top_k=5)
```

4. Wire it into an MCP client

   Text memory is available over MCP from the project's hosted server, so Claude Desktop, Cursor, LM Studio, Cherry Studio or any other MCP client can use it without the Python package. See the MCP/README.md in the repository for client configuration.

```text
https://mcp.simplemem.cloud
```

5. Point it at a model backend

   Memory construction, retrieval and judging run against an OpenAI-compatible endpoint. Set OPENAI_BASE_URL and the API key for whichever provider or self-hosted server you use.

```bash
export OPENAI_BASE_URL=...
export OPENAI_API_KEY=...
```

## When to use it

- Give a chat assistant recall across sessions so users do not have to restate context every time
- Add memory to an existing MCP client — Claude Desktop, Cursor, LM Studio — without changing the client itself
- Build an agent that remembers images, voice notes and video alongside text in one store
- Keep long-running agent context out of the prompt by retrieving only the relevant memories per query
