
Memex
io.github.STiFLeR7由 GitHub 账号 STiFLeR7 发布v1.0.3更新于 Oct 26, 2026
Temporal engineering context for agents via MCP.
概览
本地 MCP 服务器,为代码仓库构建双时态 Neo4j 知识图谱,并向编码代理提供工程上下文、决策与问题记录。
- 可以做什么
- 读取仓库上下文:项目简报、符号调用与被调用关系、近期决策、未解决问题、过期事实、混合检索
- 解释与预测:基于提交差异给出有依据的说明,按文件路径返回受影响模块的排序预测
- 记录与维护知识:记录决策并支持佐证或取代语义,记录与解决问题,使失效事实作废
- 通过 Claude Code 与 Codex 钩子保持会话上下文最新:会话开始时的工作集、编辑前检查、恢复时的变更提示、按工作树独立视图
- 提供令牌节省与验证统计,并可用图谱投影支撑 Anthropic 原生记忆工具
- 适用场景
- 适合持续数周乃至数月、架构决策不断累积、且多名代理或开发者共用同一代码库的项目。一次性脚本、临时原型,或小到可直接粘贴进提示词的项目则不太必要。
- 运行要求
- 以本地进程运行,可通过 npm(stifler-memex-mcp)或 PyPI(memex-mcp,uvx)安装,需要 Node.js 或 Python 及 uv/pip。需要自备 Neo4j 5 服务器,并配置 NEO4J_URI、NEO4J_USER、NEO4J_PASSWORD,以及用于实体抽取的 GEMINI_API_KEY。仅限桌面端;首次启动会下载 Python 依赖,可能超出客户端的连接超时。
安装
在 SourceWeft 中
- 打开 控制台中的 Memex,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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.
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.
[Website] [PyPI] [PyPI downloads] [npm] [npm downloads] [Claude Code marketplace] [memex MCP server] [GitHub stars] [Tests] [CodeQL] [OpenSSF Scorecard] [License: MIT]
Where memex lives
Evaluation record in BENCHMARK.md, release history in CHANGELOG.md, reporting process in SECURITY.md, and how to work on it in CONTRIBUTING.md.
https://github.com/user-attachments/assets/b14e3185-ea36-4ae5-bd18-2d34e6bf7be4
memex v1 in 60 seconds. If the player does not load, download the video.
Live context (v1)
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:
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.
Install
Via Claude Code 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:
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.
Manual
Hermes integration
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:
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.
Self-hosted team deployment
For a shared team setup (one Neo4j + one memex-server, auth on by default, Neo4j's ports never exposed to the host):
See docker/TEAM-DEPLOY.md for the full flow, capturing the
initial admin key, and the down -v footgun to avoid.
At a glance
The lifecycle
MCP tools
14 tools: eight read, four write, two analytic.
Read
Write
Bitemporal confidence
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.
Hierarchical clusters
memex cluster runs hierarchical Leiden over a hybrid edge graph:
Measure Your Savings
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:
Or view the raw JSON payload:
Or target a specific repository scope:
This returns an aggregation of:
- Period Summaries: Calls, tokens returned, naive tokens (size of files requested), tokens saved, and token reduction percentage across
today,last 7 days,last 30 days, andlifetime. - Top Tools: The most valuable tools sorted by total tokens saved.
- Agent Clients: Active agents (Claude Code, Gemini CLI, Cursor, Codex) and their token saving distribution.
- Validation Health: Total validated, unvalidated, and corroborated nodes, along with the elapsed days since the last review.
The same statistics are exposed via the HTTP MCP transport:
Connect your agent
Claude Code
Marketplace install above does this for you. Manual wiring in .claude/settings.json:
Cursor
Add to ~/.cursor/mcp.json:
Gemini CLI
Add to ~/.gemini/settings.json:
Codex
Add to ~/.codex/config.toml:
Anthropic memory tool (memory_20250818)
memex can back Claude's native memory tool: agents read from a per-session graph projection plus a writable scratch zone.
Operating principles
When to use memex
Project structure
Commands
License
MIT. See LICENSE.
Author
Hill Patel (@STiFLeR7)
Core Contributors & Maintainers
- Hill Patel (@STiFLeR7), architect and maintainer
- Nirvaan Lagishetty (@Nirvaan05), lead contributor and maintainer
Contributing
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."
来源:README.md,提交 62d1f88
工具
0版本历史
4- v1.0.3最新Oct 26, 2026
- v1.0.2Oct 8, 2026
- v1.0.1Oct 6, 2026
- v0.9.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分