# agentmem

Keeps an agent's notes across sessions and tracks which ones still hold. Useful when your assistant keeps repeating old mistakes.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: Thezenmonster
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Thezenmonster/agentmem
- Updated: 2026-04-17
- HTML: https://affpapa.org/en/nevibecode/mcp/agentmem

## What it does

agentmem is an MCP server that gives coding agents a shared memory. Every entry carries a status: hypothesis, active, validated, deprecated or superseded. Recall ranks validated and active entries above the rest and leaves deprecated and superseded ones out entirely.

The server also looks for entries that disagree. It measures topic overlap, matches negation at sentence level, and keeps duplicates apart from real contradictions. A separate check flags stale entries by age, by a missing source file, or by a hash that no longer matches. One more function scores the whole memory store from 0 to 100 based on conflicts, the share of stale entries and whether anything has been validated.

It runs through `uvx quilmem`, so `uvx` has to be on your machine. The Python API comes from the `quilmem` package, the MCP mode from `quilmem[mcp]`. Memory lives in a local database file, no external service involved.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add agentmem -- uvx quilmem
```
uvx runs the command named after the package; if the README names another one, use uvx --from quilmem <command>

### Codex

**Platform CLI**
```bash
codex mcp add agentmem -- uvx quilmem
```
uvx runs the command named after the package; if the README names another one, use uvx --from quilmem <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "agentmem": {
            "command": "uvx",
            "args": [
                "quilmem"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from quilmem <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "agentmem": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "quilmem"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from quilmem <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add agentmem uvx quilmem
```
uvx runs the command named after the package; if the README names another one, use uvx --from quilmem <command>

## When to use it
- stop the agent from repeating mistakes made in earlier sessions
- tell a current rule apart from an outdated one
- surface decisions in memory that contradict each other
- flag entries whose source file changed or disappeared
- fit the best entries into a token budget when building context

## Example prompts
- Save to memory: never apply loudnorm to the final mix, status validated
- Find conflicts in this project's memory and show which entries contradict each other
- Build context for the narration track task, stay within 2000 tokens

## 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
