
Memini
io.github.lumayapartners由 GitHub 帳號 lumayapartners 發布v0.4.0更新於 Oct 24, 2026
Local-first project memory and mistake-prevention guardrails for AI coding agents.
概覽
Memini 是本地優先的專案記憶與防護欄伺服器,記錄失敗嘗試、脆弱檔案與決策,讓 AI 程式助理在重蹈覆轍前收到警告。
- 可以做什麼
- 以分類記憶記錄專案經驗:失敗嘗試、脆弱檔案、決策、架構、部署、客戶偏好與工作階段摘要,並關聯來源檔案與 git 狀態。召回專案脈絡並執行編輯前檢查,讓助理在改動檔案前看到已記錄的風險。工作階段開始時注入依嚴重程度排序的記憶摘要,結束時提示助理記錄可長期保留的經驗。搜尋、列出、檢視、封存與核准記憶,並統計哪些防護欄真正觸發過。標記所引用檔案已變更的過期記憶,並提示重複、矛盾或長期未觸發的防護欄供人工複核。
- 適用情境
- 當 AI 程式助理在同一儲存庫反覆做出相同的錯誤改動,而你希望這些經驗被強制執行而非依賴助理自覺時,值得安裝。適合希望擁有可審查、存放於儲存庫內的脆弱檔案與部署規則記憶的團隊。
- 執行需求
- 透過 npx 以本地 stdio 程序執行(需要 Node.js)。初始化會在儲存庫中建立 .memini 目錄,內含本地 SQLite 索引與 markdown 檢視,並可選安裝 git 與編輯器鉤子。未宣告任何帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Memini,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
memini
[npm version] [CI] [memini MCP server]
Never the same mistake twice. Mistake-prevention guardrails and persistent project memory for AI coding agents.
AI coding agents are stateless: every session starts with amnesia. The agent that broke your build editing vercel.json on Monday will happily try the exact same edit on Thursday. memini gives each repo a persistent memory of failed attempts, fragile files, decisions, and deployment rules — and force-feeds the relevant warning to the agent at the moment it's about to repeat history.
Not a notebook the agent may choose to read. A guardrail it can't skip.
[memini demo — an agent is stopped before repeating a recorded deploy mistake]
How it works
- Memories live in your repo — a
.memini/folder with a local SQLite index and human-readable, PR-reviewable markdown views. Local-first: nothing leaves your machine. - Hooks enforce guardrails — when the agent tries to edit a file with recorded risks, the edit is intercepted before it happens and the recorded lesson is injected:
[WARNING] Editing vercel.json broke the build (recorded 2026-07-03)— Tried changing buildCommand; deploy failed. Actual fix: move checkout server-side and setVITE_STRIPE_USE_SERVER=true.warnseverity: the agent is warned once per session, then may proceed.blockseverity: the edit is always denied until a human archives the memory.
- Session start injects a digest of the most important memories (severity-first, token-budgeted).
- MCP tools let the agent record what it learns:
remember_failed_attempt,remember_fragile_file,remember_decision,end_session_summary, plusrecall_project_contextandcheck_before_editing. - Git-aware staleness — memories hash the files they reference;
pm staleflags memories whose evidence has changed, and stale memories stop firing guardrails until re-verified.
Quickstart (90 seconds)
That's it. Next time any Claude Code session in this repo tries to edit vercel.json, it gets the warning first.
Cursor, Windsurf, and other MCP clients:
Enforcement is a chain of gates, and memini covers several:
- Before the edit — the edit to a guardrailed file is blocked before it happens.
block→ denied,warn→ the user is prompted with the recorded history. Supported on:- Claude Code —
pm initinstalls it - Cursor (1.7+) —
pm install-mcp --write cursor - GitHub Copilot — CLI, cloud coding agent, and VS Code agent mode (preview) —
pm install-copilot
- Claude Code —
- Before the commit — every tool — a git pre-commit guardrail blocks a commit that touches
a
block-severity file, no matter which IDE or agent made the edit (Windsurf, Cline, a human…). Installed bypm init(orpm install-hooks --git). Fails open; overridable withgit commit --no-verify. - Advisory — any MCP client — the
check_before_editing/recall_project_contexttools, plus an always-applied Cursor rule steering the agent to use them.
Keeping memory useful over time
A memory tool is only as good as what's in it, and it rots if left alone. memini keeps it healthy:
- Auto-capture — a Claude Code session-end hook nudges the agent to record durable lessons
(a fix that worked, a fragile file, a failed approach) when a session actually changed files,
so you don't have to remember to
pm remember. It stays silent on idle sessions. - Usefulness tracking — every time a guardrail actually fires, memini counts it.
pm statsshows which memories are pulling their weight and which have never fired. pm review— flags near-duplicates, contradictory guardrails on the same file, and dormant guardrails that have never fired long after creation. All local heuristics, no LLM — you decide what to keep, merge, or archive.- Git-aware staleness — memories hash the files they reference; when the code changes, the
memory is flagged and stops firing until re-verified (
pm stale/pm verify).
CLI
Memory types: decision, failed_attempt, fragile_file, architecture, deployment, client_preference, session_summary.
Scopes: sharing rules across repos
Some lessons are project-specific; some apply to every repo on your machine that belongs to the same org or client. memini has three scopes:
Every repo under the workspace folder — including ones you create later — gets those guardrails automatically. Resolution walks up the directory tree, like .gitconfig or ESLint configs. Workspace/user file guardrails match by glob (vercel.json matches any repo's vercel.json; config/**/*.yml works too), and wider-scope memories only fire when human-verified — agents can propose memories to project scope only, so a prompt-injected agent can't plant rules that spread across repos. pm doctor shows which scopes are active.
Design principles
- Enforced, not advisory. MCP memory tools are optional for the agent; hooks are not. The guardrail path works even if the agent never thinks to check its memory.
- Human-readable, PR-able. Every memory renders to markdown under
.memini/that your team reviews like any other change. - Git-linked evidence. Memories record the branch, commit, and file hashes they were born from, so claims are verifiable and staleness is detectable.
- Local-first. SQLite + markdown in your repo. No accounts, no cloud, no telemetry. Secrets are auto-redacted from memory bodies before they're stored.
- Cross-tool. Core is a CLI + files; Claude Code hooks and MCP are thin adapters.
Security
Local-first by design: no server, no account, no telemetry. Secrets are auto-redacted before storage, file references are contained to the repo, and injected memory text is size-capped and framed as data. See SECURITY.md for the full threat model — including the honest limitations (guardrails intercept edit tools, not arbitrary shell; warn is advisory, block is not).
Status
Early (v0.1). Team sync — shared memory across your whole team, with a review workflow — is on the roadmap. Feedback and issues welcome.
License
MIT
來源:README.md,提交 db88c1e
工具
0版本歷史
1- v0.4.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分