# memex

memex keeps an agent’s repository context aligned with code changes. It helps when edits, branches, or linked worktrees move in parallel.

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

## What it does

memex turns repository files and commits into a bitemporal knowledge graph covering modules, symbols, decisions, problems, evidence, and code evolution. A daemon watches the repository, while the MCP server sends agents context together with freshness and provenance.

In Claude Code and Codex, memex supplies a bounded context at session start, checks the assumptions behind each edit, and names files to reread after a resumed session. Linked worktrees receive separate views. The system includes a tree-sitter and Gemini watcher, a Neo4j graph, hooks, and MCP tools.

You need a running Neo4j 5 instance plus `NEO4J_URI`, `NEO4J_USER`, `NEO4J_PASSWORD`, and `GEMINI_API_KEY`. Without Neo4j, the server cannot use its graph. Hook installation touches only project configuration, and memex does not request or store client credentials.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `NEO4J_URI`, `NEO4J_USER`, `NEO4J_PASSWORD`, `GEMINI_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add memex -e NEO4J_URI=<NEO4J_URI> -e NEO4J_USER=<NEO4J_USER> -e NEO4J_PASSWORD=<NEO4J_PASSWORD> -e GEMINI_API_KEY=<GEMINI_API_KEY> -- npx -y stifler-memex-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add stifler7-memex --env NEO4J_URI=<NEO4J_URI> --env NEO4J_USER=<NEO4J_USER> --env NEO4J_PASSWORD=<NEO4J_PASSWORD> --env GEMINI_API_KEY=<GEMINI_API_KEY> -- npx -y stifler-memex-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "stifler7-memex": {
            "command": "npx",
            "args": [
                "-y",
                "stifler-memex-mcp"
            ],
            "env": {
                "NEO4J_URI": "<NEO4J_URI>",
                "NEO4J_USER": "<NEO4J_USER>",
                "NEO4J_PASSWORD": "<NEO4J_PASSWORD>",
                "GEMINI_API_KEY": "<GEMINI_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "stifler7-memex": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "stifler-memex-mcp"
            ],
            "env": {
                "NEO4J_URI": "<NEO4J_URI>",
                "NEO4J_USER": "<NEO4J_USER>",
                "NEO4J_PASSWORD": "<NEO4J_PASSWORD>",
                "GEMINI_API_KEY": "<GEMINI_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e NEO4J_URI=<NEO4J_URI> -e NEO4J_USER=<NEO4J_USER> -e NEO4J_PASSWORD=<NEO4J_PASSWORD> -e GEMINI_API_KEY=<GEMINI_API_KEY> stifler7-memex npx -y stifler-memex-mcp
```
Replace <…> with your own values

## When to use it
- keep agent context current as repository files change
- check whether an edit still rests on current context
- name files that need rereading after a paused session
- give parallel worktrees separate repository views
- turn commits and file changes into Neo4j facts

## Example prompts
- Show the current working context for this repository task.
- Check whether the context behind this edit is still current.
- The session resumed after code changes; tell me which files to reread.

## Similar
- [open-memex](https://affpapa.org/en/nevibecode/mcp/open-memex.md) — MCP server · ★ 6
- [wiki-export](https://affpapa.org/en/nevibecode/skills/wiki-export.md) — skill · 3200 installs
- [mirofish-offline-simulation](https://affpapa.org/en/nevibecode/skills/mirofish-offline-simulation.md) — skill · 1400 installs
- [neo4j-document-import-skill](https://affpapa.org/en/nevibecode/skills/neo4j-document-import-skill.md) — skill · 923 installs
- [neo4j-getting-started-skill](https://affpapa.org/en/nevibecode/skills/neo4j-getting-started-skill.md) — skill · 888 installs
- [Knowledge Graph Builder](https://affpapa.org/en/nevibecode/skills/knowledge-graph-builder.md) — skill · 433 installs

## Other versions with the same name
- [memex · iamtouchskyer](https://affpapa.org/en/nevibecode/mcp/memex.md) — ★ 144
- [memex · dioniipereyraa](https://affpapa.org/en/nevibecode/mcp/dioniipereyraa-memex.md) — ★ 5

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