StackMap
Subscribe
Explore / mex
mex-memory

mex

A living wiki for your codebase, written by your coding agents: a Tree-sitter graph grounds structured Markdown notes, task-aware routing loads only what's needed, and drift checks catch stale claims.

1,510 104 TypeScript MITupdated yesterday
View on GitHubDispute this mapping →
Curator's take

The answer to the instruction file that grew to 2,000 lines: knowledge lives in a routed `.mex/` wiki instead of one giant prompt, claims can be grounded to exact graph nodes by fingerprint, and `mex check` validates paths, commands, links, indexes and symbols spending zero tokens before `mex sync` sends the agent to repair only what drifted. Code stays the source of truth; the wiki is its maintained explanation. Limits worth knowing: the deterministic graph covers TypeScript/TSX, JavaScript/JSX, Python and Rust, so a polyglot monorepo outside that set gets a thinner spine — and the wiki is only as good as what your agents write into it, so it needs review like any other docs.

Mapped by ShipWithAI editors · links verified
README.md
mex mascot
MEX ASCII logo

A living wiki for your codebase, maintained by your AI coding agents.

English | 简体中文 | Español | Português (Brasil)

npm version npm downloads GitHub stars Website Discord License: MIT CI Node.js >=22.5 TypeScript Agent memory MCP


mex maps your code, turns what agents learn into structured Markdown, and keeps that knowledge connected to the implementation it describes.

Every coding session starts with relevant architectural context instead of another full-repository scan.

New in v0.7.2: source-backed one-call graph retrieval with compiler-resolved TypeScript flows, deterministic evidence, and hard output budgets.

💬 Join the mex community on Discord — discuss ideas, get help, share feedback, and contribute to the project.

Join the Discord →

npx mex-agent setup

mex operational memory dashboard

Your codebase knows more than its documentation

Architecture, conventions, edge cases, and past decisions are scattered across source code, pull requests, chat histories, and individual contributors.

AI coding agents rediscover that knowledge every session. A giant instruction file helps at first, but eventually floods the context window, becomes stale, and drifts away from the implementation.

mex creates a living, repo-local wiki that grows as agents work:

  • agents document what they learn in readable Markdown
  • a deterministic code graph connects that knowledge to exact symbols
  • task-aware routing loads only the context needed for the current job
  • drift checks identify knowledge affected by code changes
  • completed work adds decisions, patterns, and current project state back into the wiki

The code remains the source of truth. The wiki becomes its maintained explanation.

Ordinary project documentation The mex living wiki
Written once and gradually forgotten Grows from real coding work
Disconnected from the implementation Claims can point to exact code symbols
Loaded as one giant instruction file Context is routed by task
Refactors silently invalidate docs Changed, moved, and missing symbols are detected
Every agent rediscovers the architecture Agents inherit previous discoveries and decisions
Knowledge disappears between sessions Decisions and reusable patterns persist in the repository

How it works

1. Map the codebase

mex builds a deterministic local code graph using Tree-sitter and SQLite. It indexes symbols and relationships across TypeScript, TSX, JavaScript, JSX, Python, and Rust, including framework-aware Express route-to-handler relationships.

mex graph

2. Build the wiki

During setup, your coding ag

Continue your stack

What teams reach for next — and why each earns a place beside mex. Ranked by curator confidence.