
MCP Light Memory
io.github.PeterPirog由 GitHub 账号 PeterPirog 发布v1.8.1更新于 Oct 24, 2026
Local-first persistent memory for coding agents and MCP clients.
发布方自己的服务:Memory.fit
概览
本地优先的持久记忆服务器,让编程助手在会话之间保存工作检查点,并检索过去的决策、陷阱与约束。
- 可以做什么
- 检索与任务相关的记忆,按相关度排序、去重并受 token 预算限制,支持按日期查询历史与时间线视图。创建、更新、取代、关联和归档持久记忆条目,以带 YAML 前置信息的 Markdown 文件保存。保存工作检查点,并通过任务栈恢复被中断的任务。查看状态、守卫、校验与诊断检查,以及配置和历史。通过注册表白名单和只读边界,用一个连接路由多个项目。
- 适用场景
- 适合在 git 仓库中进行长期编程工作、需要助手跨会话记住决策、约束和失败经验而不把完整历史放入上下文的场景。也适合希望记忆完全保存在本地磁盘并离线运行的团队。
- 运行要求
- 以本地 stdio 进程运行。需要 Python 3.8+ 和 Git,目标项目必须是 git 仓库。安装方式是克隆仓库并为受支持的客户端(Warp、OpenCode、JetBrains AI)运行安装脚本。可选的 sentence-transformers 和 numpy 包可提升语义检索效果。未声明任何 API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 MCP Light Memory,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MCP Light Memory
Lightweight local-first persistent memory for coding agents and MCP clients.
formerly internal-rag
[version] [license] [python] [deps] [mcp]
What is this?
MCP Light Memory is a lightweight, local-first, persistent memory system for coding agents and MCP clients (Warp, OpenCode, JetBrains AI Assistant / PyCharm, Claude Code, Cursor). It acts as a checkpoint + retrieval layer — it stores the minimum durable state needed to resume complex work across sessions, without keeping the full conversation in the model's context window.
When your agent starts a task, it calls context and gets back relevant past decisions, gotchas, constraints, and hypotheses — ranked, deduplicated, and trust-bounded. When it finishes, it checkpoints the working state. Next session, even after a restart, the memory is there.
Why use it?
How it works (mechanisms)
- Markdown is the source of truth. Every memory is a
.mdfile with YAML frontmatter (id,type,status,tags,sources,links,valid_from,valid_to,supersedes). Human-readable, diffable, durable. - SQLite is a rebuildable cache. BM25/FTS5 index + optional embedding vectors + usage tracking. Delete it and everything rebuilds from Markdown.
- Retrieval: pure-Python BM25 + optional dense embeddings → RRF fusion → MMR diversification → policy boosts (type/status/temporal) → token-budget cut. Adaptive mode: sparse first, dense only if weak.
- Lifecycle:
remember→update→supersede(links both directions, never deletes history) →forget(archives, never deletes) →timeline(temporal view).search --at YYYY-MM-DDfor historical queries. - Trust boundary: retrieved content is wrapped in
=== BEGIN/END INTERNAL_RAG MEMORY ===with aSECURITY NOTICEheader. Structured JSON/MCP carriestrust: untrusted+ optionalsecurity_flags: ["instruction_like_content"]. - Evidence freshness: each result includes
evidence_state(present/missing/unverifiable) for local path-like evidence — derived at retrieval time, never persisted. - Multi-project router: one MCP stdio server in front of many projects via a JSON registry.
write:falseblocks mutating tools before spawning a child. Per-call subprocess isolation (no shared state).
Setup
Prerequisites
- Python 3.8+ (uses
pylauncher,python, orpython3— the installer auto-detects the real interpreter and rejects the WindowsApps stub) - Git (the target project must be a git repo)
- Optional:
pip install sentence-transformers numpyfor better semantic retrieval
The current version is defined by the VERSION file — check it (or run mlm.py --version) instead of hard-coding an expected number.
Quick start
Clone this repo once, then install into any project:
The installer:
- copies skill files + creates
INTERNAL_RAG/+AGENTS.md - runs
init+checkpoint+validate(soguardisOKimmediately) - auto-registers the MCP server in the client config when it can do so safely (or reports
MANUAL_REQUIRED/ prints JetBrains instructions) - writes the absolute path to the verified Python interpreter (survives Windows PATH issues)
Installation matrix
One installer, four clients, two config scopes. Full guide: docs/INSTALLATION.md.
--globalchanges the scope of the CLIENT CONFIG (~/.warp/.mcp.jsonvs{repo}/.warp/.mcp.json,~/.config/opencode/opencode.jsonvs projectopencode.json). The server still points at the target project you installed into.- Need one global MCP endpoint for many repositories? Use the multi-project router — docs/MCP-MULTI-PROJECT.md.
- JetBrains/PyCharm is assisted, not fully automatic: the installer prepares the JSON + Working Directory; you add the server in Settings → Tools → AI Assistant → MCP and choose Server level = Project or Global.
- Manual setup (no installer) per client: docs/INSTALLATION.md + client pages (Warp · OpenCode).
Zero-shot: copy-paste prompts for Warp and OpenCode
You can paste one of these directly into the client agent. Replace C:\Projects\App with the real target repository path.
Warp — install for one project:
Warp — global client config for one project:
OpenCode — install for one project (stable/V1):
OpenCode — global client config for one project (stable/V1):
For OpenCode 2 / V2, use the same prompts but explicitly say OpenCode 2 / V2 and require --client opencode2. More variants: docs/ZERO-SHOT-SETUP-PROMPTS.md.
Configuration details
Warp
Warp reads MCP server configs from ~/.warp/.mcp.json (global, auto-spawns) or
{repo}/.warp/.mcp.json (project, requires a manual toggle per Warp docs).
Shape: mcpServers.<name> with command, args, working_directory (always set it — the memory store is resolved from it). See examples/warp.example.json and docs/WARP-SETUP.md.
OpenCode stable (V1)
OpenCode reads opencode.json/.jsonc in the project root, or
~/.config/opencode/opencode.json globally. V1 servers are flat under
mcp.<name> (no servers sub-key) with enabled: true and command as an
array — see examples/opencode-legacy.example.json and docs/OPENCODE.md.
OpenCode 2 (V2, beta)
Same config files, different shape: mcp.servers.<name>, command as an
array, and no enabled field (V2 disables via disabled: true) — see
examples/opencode-v2.example.jsonc and docs/OPENCODE.md.
JetBrains AI Assistant / PyCharm
PyCharm does NOT auto-read any MCP config file. The installer prints
ready-to-paste JSON + Working Directory; you add the server in
Settings → Tools → AI Assistant → MCP (STDIO) and choose Server level =
Project or Global. See examples/jetbrains.example.json.
Multi-project router
One MCP connection in front of many projects — registry allowlist, write:false hard boundary, per-call subprocess isolation.
Registry file (projects.json)
Warp config for the router
See docs/MCP-MULTI-PROJECT.md for details.
Workflow
Core commands (CLI alias: mlm.py or legacy irag.py):
Path mapping (rebrand: internal-rag → MCP Light Memory)
The on-disk folder INTERNAL_RAG/ and the skill directory .agents/skills/internal-rag/ are intentionally kept under their legacy names for zero-migration backward compatibility. See docs/MIGRATION-TO-MCP-LIGHT-MEMORY.md.
Durable memory (CRUD)
Types: decision, knowledge, constraint, gotcha, failure, hypothesis, session.
Task stack (interrupts)
Configuration (.irag.yml, optional)
mlm.py config shows the effective configuration. mlm.py config --init writes a template.
Optional embeddings (better retrieval)
When the package is available and .irag.yml has embeddings: auto (default), retrieval uses embeddings with fallback to BM25. Override at runtime with --embeddings on|off|auto.
Two retrieval profiles (see docs/EMBEDDINGS.md):
english-fast(default,all-MiniLM-L6-v2)multilingual(intfloat/multilingual-e5-small) — for Polish-English projects
Offline / air-gapped
See docs/OFFLINE.md for details.
Privacy & Git
The default install mode is local-only. The installer uses .git/info/exclude, not the project's .gitignore, so local memory and integration files are not accidentally committed.
Before publishing a project:
Expected: RESULT: PASS
Full removal from a project
The uninstaller creates a backup outside the repository, then removes INTERNAL_RAG and its integrations. Use --keep-memory to preserve the memory data.
Documentation
- Installation · Daily usage · CLI reference
- Architecture · Memory lifecycle · Recovery
- MCP · Multi-project MCP
- Architecture decisions (ADR) · Configuration
- Embeddings · Offline · Git hooks
- Privacy & Git · Uninstall · Troubleshooting
- Zero-shot setup prompts · Migration · Branding
Structure in a target project
Source of truth
- current user instructions, 2. current code/tests/configuration, 3. specifications/ADRs, 4. verified memory, 5. session notes, 6. hypotheses.
Memory can be stale. Code takes precedence.
License
MIT.
Changelog
1.8.0 — JetBrains manual setup
--client jetbrainsno longer writes a fake config file (PyCharm ignores MCP config files). Prints ready-to-paste JSON + IDE menu instructions instead.--unregister --client jetbrainsprints a reminder to remove in the IDE UI.
1.7.2 — JetBrains cwd + client-specific messages
- JetBrains: writes
working_directoryas a hint + printsWARNINGwith exact path to set inSettings → Tools → AI Assistant → MCP. - Client-specific restart messages (Restart PyCharm / Restart Warp / Restart OpenCode).
Memory store: <path>printed in install output for immediate verification.
1.7.1 — Windows Python stub fix
detect_python()rejects the WindowsApps 0-byte stub; preferspy -0p; verifies each candidate with--version.- Post-register verification: runs
--versionimmediately after writing the config and reportsPASS/FAIL. --unregisterdeletes empty config files + parent dirs (fixes dead.warp/.mcp.jsonskeleton →GUARD STALE).
1.7.0 — Rebrand to MCP Light Memory
- Total rebrand from
internal-ragto MCP Light Memory (mcp-light-memory). New CLI aliasmlm(mlm.py). Logo/icon assets. Migration doc. GitHub rebrand checklist. - Backward-compatible:
irag.py,INTERNAL_RAG/, old MCP server names preserved as deprecated aliases. - 18 rebrand consistency tests.
1.6.1 — Post-v1.6 hardening
- Mutation/lifecycle benchmark (11 scenarios). Trust boundary (ADR-015):
trust: untrusted+security_flags. Evidence freshness (ADR-016):evidence_state. Scale benchmark (100/1k/10k). Router security regressions (+12 tests). Docs consistency test. 249 tests pass.
1.6.0 — Retrieval quality + MCP 2026-07-28
- Memory-quality benchmark (37 cases). MCP
2026-07-28dual-era (server/discover,_meta,structuredContent,outputSchema). Registry strictwrite. Sources in chunk prefix. Adaptive retrieval. Link-aware context.consolidate --prepare. Router latency benchmark. ADR-010…016.
1.5.0 — Abstention gate + multi-project router
- Relevance/abstention gate (
--meta). FTS5 candidate prefilter. Multi-project MCP router. MCP protocol hardening (pure stdout, SDK-verified). 168 tests.
1.4.0 — Chunking + dedup + temporal lifecycle
- Section-aware chunking (schema v3). SimHash dedup. Multilingual PL/EN profile. Temporal lifecycle (
valid_from/valid_to/supersedes/--at).consolidate --dry-run.
1.3.0 — Persistent embedding cache
- Chunk-level float32 BLOBs in SQLite. Multiple models coexist.
index --vacuum/--embed-missing.
1.0.2 — Token budget + privacy
- Token budget enforcement. Stale memory detection. Duplicate detection. Privacy scan at write-time. Auto-checkpoint timer. Offline/air-gapped pack.
1.0.0 — Initial release
- BM25 + MMR retrieval. Full memory CRUD. Task stack. MCP server (JSON-RPC stdio). Git hooks. Diagnostics. Export/import. Token budget.
来源:README.md,提交 92af0e7
工具
0版本历史
1- v1.8.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Memory 集成

Memory.fit
fit.memory官方发布者
托管式 Memory.fit 服务器,让 AI 读取你的训练、睡眠、恢复与饮食数据,并写回每周计划、每日目标和饮食计划。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方发布者
pg.ddx.io: the PostgreSQL community's memory 的托管 MCP 服务,由 pg.ddx.io 发布;无需登录;Streamable HTTP;29 个工具。
var.gg Naming Memory
gg.var官方发布者
远程 MCP 服务器,可根据领域概念推荐并检索韩、日、中、越、英多语言的代码标识符名称,并提供 ERD 结构查询。

Counterparts
ai.counterparts
面向 Claude Code 与 Claude Desktop 的本地优先长期记忆:助手自行写下关于你和项目的笔记,并在之后的会话中回忆起来。

LAHZE - Persian AI Memory Platform
由 GitHub 账号 pedramgholizadeh 发布
以波斯语为先的地理记忆平台:发现地点,起草并发布仅限波斯语的记忆。AI 翻译