# YourMemory

Adds persistent memory to coding agents using forgetting curves and entity graphs. Keeps project context intact between sessions without bloating the context window.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 270
- Author: sachitrafa
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sachitrafa/YourMemory
- Updated: 2026-09-19
- HTML: https://affpapa.org/en/nevibecode/mcp/yourmemory

## What it does

YourMemory stores facts and working context locally inside `~/.yourmemory/`. DuckDB serves as the default zero-config storage engine, while teams can route shared memories to Postgres using `pgvector`. As facts pile up, the engine summarizes related entries into single records and archives the source items.

The retrieval layer blends vector search, BM25 keyword matching, and an entity relationship graph. Unused memories fade over time following the Ebbinghaus forgetting curve, whereas recalled knowledge stays fresh. Read, write, and deletion events get recorded in a hash-chained audit log.

Running the tool requires Python 3.11 to 3.14 alongside an activation token from `yourmemoryai.xyz`. Without initial token setup in the CLI, the server will not function.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `PYTHONIOENCODING` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PYTHONIOENCODING=<PYTHONIOENCODING> --transport stdio yourmemory -- uvx yourmemory
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>

### Codex

**Platform CLI**
```bash
codex mcp add yourmemory --env PYTHONIOENCODING=<PYTHONIOENCODING> -- uvx yourmemory
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "yourmemory": {
            "command": "uvx",
            "args": [
                "yourmemory"
            ],
            "env": {
                "PYTHONIOENCODING": "<PYTHONIOENCODING>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "yourmemory": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "yourmemory"
            ],
            "env": {
                "PYTHONIOENCODING": "<PYTHONIOENCODING>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PYTHONIOENCODING=<PYTHONIOENCODING> yourmemory uvx yourmemory
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>

## When to use it
- retain user preferences across agent resets
- compress redundant project facts into consolidated summaries
- trace related entities during multi-hop lookups
- audit memory operations via a tamper-evident log

## Example prompts
- Recall our architectural decisions regarding database migrations from earlier sessions.
- Store the new deployment guidelines for our backend microservices.
- Purge deprecated API credentials and old notes from agent memory.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
