memex: trusted engineering context for agentic software engineering
Open-source MCP server and hook service that keeps Claude Code and Codex engineering context current as the code changes, and holds edits whose evidence changed.
Potencialize seu agente
O comando do próprio publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
npx -y [email protected]O Claude Code não tem link de instalação para um comando local. Copie o comando abaixo e execute-o em um terminal.
NEO4J_URI=<value> NEO4J_USER=<value> NEO4J_PASSWORD=<secret> GEMINI_API_KEY=<secret> claude mcp add stifler7-memex -- npx -y stifler-memex-mcp@1.0.3Execute em um terminal.
{ "mcpServers": { "stifler7-memex": { "command": "npx", "args": [ "-y", "[email protected]" ], "env": { "NEO4J_URI": "<value>", "NEO4J_USER": "<value>", "NEO4J_PASSWORD": "<secret>", "GEMINI_API_KEY": "<secret>" } } }}claude_desktop_config.json
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
Open-source MCP server and hook service that keeps Claude Code and Codex engineering context current as the code changes, and holds edits whose evidence changed.
Persistent memory for AI coding agents via MCP: a bitemporal knowledge graph of your codebase, served to Claude Code, Cursor, Gemini CLI, and any MCP client. Tree-sitter and Gemini Flash into Neo4j via Graphiti. 14 MCP tools, hierarchical clusters, three-regime confidence decay.
A daemon, hook service and MCP server that turn commits and file changes into structured engineering knowledge and deliver it to agents with freshness and provenance preserved, without making memex a source of personal memory or raw session state.
memex builds a bitemporal knowledge graph of your repository (modules, symbols, decisions, problems, evidence, and code evolution). In v1 it also hooks into Claude Code and Codex: each session starts with the right context, each edit is checked against the current code, and the agent is told exactly what changed.
Evaluation record in BENCHMARK.md, release history in CHANGELOG.md, reporting process in SECURITY.md, and how to work on it in CONTRIBUTING.md.
memex v1 in 60 seconds. If the player does not load, download the video.
Coding agents work from a snapshot of the code. A teammate pushes, another agent edits a file, a branch moves, and the agent keeps acting on what it read earlier. v1 keeps that snapshot current, inside Claude Code and Codex:
uv tool install memex-mcp # installs the `memex` command
cd your-repo
memex v1 doctor # what is set up, what is missing, what to do next
memex v1 install claude # hooks in .claude/settings.json; global settings untouched
memex v1 install codex --neo4j-uri bolt://localhost:7687 # optional, for Codex
memex needs a Neo4j 5 server you already run (Docker is not required). Hooks go only into the checkout's own project configuration, and memex never asks for or stores your client credentials. Full guide, host recipes and rollback: docs/v1/25_ONBOARDING.md.
flowchart LR
A[Your repository<br/>files + git] --> B[memex watcher<br/>tree-sitter + Gemini]
B --> C[Neo4j graph<br/>bitemporal facts]
C --> D[memex core<br/>ContextPacket selection]
D --> H[Hook service<br/>session start · edit checks · resume notice]
D --> E[Hermes MemoryProvider<br/>automatic read-only prefetch]
D --> F[MCP tools<br/>explicit lookup]
H --> G[Claude Code / Codex]
E --> G
F --> G
style B fill:#cfe8ff,stroke:#0066cc,color:#000
style C fill:#fff4cf,stroke:#cc9900,color:#000
style H fill:#d4f5d4,stroke:#2d8f2d,color:#000
/plugin marketplace add STiFLeR7/claude-plugins
/plugin install memex-mcp@stifler-marketplace
Restart your Claude Code session.
The first start after installing or upgrading downloads memex's Python dependencies (about 40 seconds), which can exceed Claude Code's MCP connect timeout once. Warm it up first, then restart:
npx -y stifler-memex-mcp --help # one-time download; later starts take a few seconds
If Claude Code still shows a connection timeout, open /mcp and reconnect
memex. If a tool says memex cannot reach Neo4j, start Neo4j (for example
docker start memex-neo4j); the tools recover without a restart.
docker compose -f docker/docker-compose.yml up -d
cat > .env <<EOF
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=memex-local
GEMINI_API_KEY=your-key-here
EOF
npx stifler-memex-mcp init --repo .
npx stifler-memex-mcp watch --repo .
npx stifler-memex-mcp serve --repo .
The Hermes integration is read-only. Hermes retains personal memory, raw
session state, and execution state. memex supplies repository engineering
context through a bounded ContextPacket; it does not ingest Hermes
state.db, transcripts, prompts, or tool results.
Add the memex provider to Hermes' profile configuration:
memory:
provider: memex
plugins:
memex:
repo_path: /absolute/path/to/repository
prefetch_timeout_seconds: 7
max_items: 8
max_chars: 12000
If Hermes is not installed, use the same context selector through the MCP
get_engineering_context tool. Both paths share the protocol-neutral memex
core and fail open when retrieval is unavailable.
For a shared team setup (one Neo4j + one memex-server, auth on by default, Neo4j's ports never exposed to the host):
bash docker/bootstrap-team-env.sh
docker compose -f docker/docker-compose.team.yml up -d
See docker/TEAM-DEPLOY.md for the full flow, capturing the
initial admin key, and the down -v footgun to avoid.
flowchart TD
Init[memex init<br/>extract baseline] --> Watch[memex watch<br/>daemon + git hooks]
Watch -->|commit| Extract[tree-sitter extract<br/>symbols, imports, lockfile]
Extract --> Synth[Gemini Flash<br/>diff → Decision nodes]
Synth --> Write[Graphiti add_episode<br/>+ post-hoc bitemporal SET]
Write --> Decay[Scheduler<br/>nightly confidence decay]
Decay -->|stale edges| Archive[expired_at = now]
Serve[memex serve<br/>MCP stdio/HTTP] -.->|reads| Write
Agent[AI agent] -->|14 MCP tools| Serve
Serve -->|record_decision / record_problem| Write
Cluster[memex cluster<br/>Leiden over hybrid edges] -.->|every N commits| Write
style Init fill:#e8f4ff,color:#000
style Watch fill:#fff4cf,color:#000
style Synth fill:#ffe0cc,color:#000
style Serve fill:#d4f5d4,color:#000
14 tools: eight read, four write, two analytic.
Confidence is not a stored number that mutates. It is computed at query time from base_confidence, validation status, time since last reinforcement, and access count.
flowchart LR
Edge[Edge created<br/>base_confidence] --> Q{Validated by<br/>a human?}
Q -->|yes| Slow[Slow regime<br/>half-life ~139d]
Q -->|no| Fast[Fast regime<br/>stale at exactly 30d]
Slow --> Score[Composite score<br/>conf × recency × rehearsal]
Fast --> Score
Score -->|below floor| Stale[get_stale_context surfaces it]
Score -->|access| Bump[last_reinforced_at updated]
Bump --> Score
style Slow fill:#d4f5d4,color:#000
style Fast fill:#ffd4d4,color:#000
memex cluster runs hierarchical Leiden over a hybrid edge graph:
memex tracks token reduction metrics and human review actions locally in a SQLite database (~/.config/memex/telemetry.db).
You can query your savings at any time using the CLI:
memex stats
Or view the raw JSON payload:
memex stats --json
Or target a specific repository scope:
memex stats --repo /path/to/repo
This returns an aggregation of:
today, last 7 days, last 30 days, and lifetime.The same statistics are exposed via the HTTP MCP transport:
GET /stats?repo=/path/to/repo
Authorization: Bearer <your-key>
Marketplace install above does this for you. Manual wiring in .claude/settings.json:
{
"mcpServers": {
"memex": {
"type": "stdio",
"command": "npx",
"args": ["-y", "stifler-memex-mcp", "serve", "--repo", "."]
}
}
}
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"memex": {
"command": "npx",
"args": ["-y", "stifler-memex-mcp", "serve", "--repo", "."]
}
}
}
Add to ~/.gemini/settings.json:
{
"mcpServers": {
"memex": {
"command": "npx",
"args": ["-y", "stifler-memex-mcp", "serve", "--repo", "."]
}
}
}
Add to ~/.codex/config.toml:
[mcp_servers.memex]
command = "npx"
args = ["-y", "stifler-memex-mcp", "serve", "--repo", "."]
memex can back Claude's native memory tool: agents read from a per-session graph projection plus a writable scratch zone.
memex memory-tool serve --repo . # in-process
memex memory-tool serve --repo . --transport http # FastAPI on :7464
from memex.memory_tool import MemexAsyncMemoryTool
memory_tool = MemexAsyncMemoryTool(repo_root=".")
client.beta.messages.run_tools(..., tools=[memory_tool])
memex/
├── memex/
│ ├── extractor/ tree-sitter + lockfile parsers
│ ├── graph/ Neo4j writes, confidence, archive, cluster engine
│ ├── synthesizer/ Gemini Flash → Decision nodes
│ ├── mcp_server/ 14 MCP tools (read + write + analytic)
│ ├── memory_tool/ Anthropic memory_20250818 adapter
│ ├── watcher/ daemon + git hooks
│ └── cli.py init / watch / serve / review / graph / cluster
├── tests/ unit, integration, and objective evaluation suites
├── docker/ Neo4j compose
├── npm/ npx wrapper (publishes as stifler-memex-mcp)
└── Dockerfile introspection-only image for MCP directory sandboxes
MIT. See LICENSE.
Hill Patel (@STiFLeR7)
Open an issue or PR. uv sync --all-extras installs the development toolchain.
Run uv run pytest -m "not integration" for the offline suite and uv run ruff check . before opening a PR. Version bumps must update pyproject.toml,
npm/package.json, server.json, and the team Docker image tag together.
Release history is in CHANGELOG.md. The v1 design and
evaluation records are under docs/v1/, and the v0.9 architecture
under docs/architecture/v0.9/.
Vannevar Bush, 1945: "Consider a future device for individual use, which is a sort of mechanized private file and library. It needs a name, and to coin one at random, memex will do."
Persistent memory for AI coding agents via MCP: a bitemporal knowledge graph of your codebase, served to Claude Code, Cursor, Gemini CLI, and any MCP client. Tree-sitter and Gemini Flash into Neo4j vi
{ "mcpServers": { "stifler7-memex": { "command": "npx", "args": [ "-y", "[email protected]" ], "env": { "NEO4J_URI": "<value>", "NEO4J_USER": "<value>", "NEO4J_PASSWORD": "<secret>", "GEMINI_API_KEY": "<secret>" } } }}Visão geral
Persistent memory for AI coding agents via MCP: a bitemporal knowledge graph of your codebase, served to Claude Code, Cursor, Gemini CLI, and any MCP client. Tree-sitter and Gemini Flash into Neo4j via Graphiti. 14 MCP tools, hierarchical clusters, three-regime confidence decay.
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
O publicador lista estas variáveis de ambiente: NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD, GEMINI_API_KEY.
Memex roda localmente via stdio.
Última verificação: 2026-10-28. Persistent memory for AI coding agents via MCP: a bitemporal knowledge graph of your codebase, served to Claude Code, Cursor, Gemini CLI, and any MCP client. Tree-sitter and Gemini Flash into Neo4j via Graphiti. 14 MCP tools, hierarchical clusters, three-regime confidence decay.