$git clone https://github.com/mex-memory/mex<br>
| 1 | <div align="center"> |
| 2 | |
| 3 | <img src="mascot/mex-mascot.svg" alt="mex mascot" width="80"> |
| 4 | |
| 5 | <br> |
| 6 | |
| 7 | <img src="mascot/mex-ascii.svg" alt="MEX ASCII logo" width="520"> |
| 8 | |
| 9 | **Persistent project memory for AI coding agents.** |
| 10 | |
| 11 | **English** | [简体中文](README.zh-CN.md) | [Español](README.es.md) | [Português (Brasil)](README.pt-BR.md) |
| 12 | |
| 13 | [](https://www.npmjs.com/package/mex-agent) |
| 14 | [](https://www.npmjs.com/package/mex-agent) |
| 15 | [](https://github.com/theDakshJaitly/mex/stargazers) |
| 16 | [](https://mexmemory.com) |
| 17 | [](https://discord.gg/VG7ySSMQM) |
| 18 | [](LICENSE) |
| 19 | [](https://github.com/theDakshJaitly/mex/actions/workflows/ci.yml) |
| 20 | [](package.json) |
| 21 | [](package.json) |
| 22 | [](README.md) |
| 23 | [](#mcp-server) |
| 24 | |
| 25 | </div> |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | AI agents forget everything between sessions. mex gives them permanent, navigable project memory so every session starts with the right context instead of a cold prompt dump. |
| 30 | |
| 31 | > **Release status:** npm and `main` remain on stable v0.6.3. The AST/Tree-sitter code graph is an unreleased v0.7.0 developer preview on `code-graph-preview`; it is not published to npm yet. |
| 32 | |
| 33 | 💬 **Join the Mex community on Discord** — discuss ideas, get help, share feedback, and contribute to the project. |
| 34 | |
| 35 | [Join the Discord →](https://discord.gg/VG7ySSMQM) |
| 36 | |
| 37 | ```bash |
| 38 | npx mex-agent setup |
| 39 | ``` |
| 40 | |
| 41 | <p align="center"> |
| 42 | <img src="screenshots/mex-DashNew.jpg" alt="mex operational memory dashboard" width="640"> |
| 43 | </p> |
| 44 | |
| 45 | ## Why mex? |
| 46 | |
| 47 | Most agent memory setups become one giant instruction file. That works for a while, then it floods the context window, burns tokens, and drifts away from the real codebase. |
| 48 | |
| 49 | | Without mex | With mex | |
| 50 | |-------------|----------| |
| 51 | | Giant `CLAUDE.md` / rules files | Small anchor file plus routed context | |
| 52 | | Agents forget decisions and conventions | Decisions, patterns, and project state persist | |
| 53 | | Docs silently drift from code | `mex check` catches stale or broken scaffold claims | |
| 54 | | Every session starts cold | Agents load only the files relevant to the task | |
| 55 | | Repeated work stays tribal | New patterns grow from real tasks | |
| 56 | |
| 57 | ## What It Does |
| 58 | |
| 59 | mex creates a structured markdown scaffold for agent memory: |
| 60 | |
| 61 | - `AGENTS.md` / `CLAUDE.md` — tiny tool-loaded anchor |
| 62 | - `ROUTER.md` — routing table for task-specific context |
| 63 | - `context/` — architecture, stack, setup, decisions, conventions |
| 64 | - `patterns/` — reusable task guides with gotchas and verification steps |
| 65 | - `.mex/events/decisions.jsonl` — append-only notes through `mex log` |
| 66 | |
| 67 | The CLI keeps that scaffold honest. It checks paths, commands, dependencies, pattern indexes, staleness, and script coverage without spending AI tokens. When drift appears, `mex sync` builds targeted prompts so the agent fixes only the stale pieces. |
| 68 | |
| 69 | ## Quick Start |
| 70 | |
| 71 | The stable npm release is v0.6.3. Install it with Node.js 20 or newer: |
| 72 | |
| 73 | The npm package is named `mex-agent` because `mex` was already taken. The CLI command is still `mex`. |
| 74 | |
| 75 | ```bash |
| 76 | npx mex-agent setup |
| 77 | ``` |
| 78 | |
| 79 | To test or contribute to the code-graph preview, use Node.js 22.5 or newer and build `code-graph-preview` from source: |
| 80 | |
| 81 | ```bash |
| 82 | git clone https://github.com/theDakshJaitly/mex.git |
| 83 | cd mex |
| 84 | git switch code-graph-preview |
| 85 | npm install |
| 86 | npm run build |
| 87 | ``` |
| 88 | |
| 89 | Setup creates the `.mex/` scaffold, asks which AI tool you use, pre-scans your codebase, and generates a targeted pr |