PROJECTMEM: A Local-First, Event-Sourced Memory and Judgment Layer for AI Coding Agents
English summary
PROJECTMEM is an open-source, local-first memory and judgment layer that logs AI coding agent development as an append-only, plain-text event stream and projects it into compact, AI-readable summaries via the Model Context Protocol (MCP). It includes a deterministic pre-action gate that warns the agent before it repeats a previously failed fix or edits a file with a record of fragility, framed as Memory-as-Governance. The system runs fully offline, serves as a provenance trail, and ships as a 3-dependency Python package with 14 MCP tools, 19 CLI commands, and 37 automated tests. A two-month self-study across 10 projects and 207 logged events demonstrates that it eliminates the 5,000–20,000 tokens typically spent re-deriving context each session and prevents redundant debugging attempts.
Chinese summary
PROJECTMEM是一个开源、本地优先的记忆与判断层,以追加式纯文本事件日志记录AI编码代理的开发过程,并通过模型上下文协议(MCP)将其投影为紧凑的AI可读摘要。系统内置确定性预动作门控,能在代理重复之前失败的修复或编辑已知脆弱文件前发出警告,提出“记忆即治理”理念。它完全离线运行,提供来源可追溯的审计轨迹,并以3项依赖的Python包形式发布,包含14个MCP工具、19条CLI命令和37项自动化测试。为期两个月的自研究覆盖10个项目和207个记录事件,证实其可消除每次会话重建上下文所需的5000–20000个token开销,并避免重复调试。
Key points
Local-first, event-sourced architecture: records development as an append-only, plain-text log of typed events (issues, attempts, fixes, decisions, notes) that deterministically produces compact summaries.
本地优先的事件溯源架构:以追加式纯文本日志记录类型化事件(问题、尝试、修复、决策、笔记),并确定性地生成紧凑摘要。
Memory-as-Governance via a pre-action gate: warns agent before it repeats a failed fix or modifies a file flagged as fragile, actively shaping next actions rather than only answering queries.
通过预动作门控实现“记忆即治理”:在代理重复失败修复或编辑被标记为脆弱的文件前发出警告,主动影响后续行为。
MCP integration: serves summaries through the Model Context Protocol, making memory portable across different coding agents and IDEs.
MCP集成:通过模型上下文协议提供摘要,使记忆可跨不同编码代理和IDE迁移。
Lightweight, offline, and test-backed: published as a Python package with only 3 dependencies, 14 MCP tools, 19 CLI commands, and 37 automated tests; runs without internet or telemetry.
轻量、离线、测试完备:作为Python包发布,仅3项依赖,包含14个MCP工具、19条CLI命令和37项自动化测试,无需联网或遥测。
Evaluation: a 2-month self-study on 10 real projects with 207 logged events showed elimination of 5,000–20,000 tokens of context reconstruction per session and prevention of repeated debugging.
评估:为期两个月的自研究,覆盖10个实际项目、207个事件,证实能消除每次会话重建上下文的5000–20000个token开销,并防止重复调试。