
PMB AI
io.github.oleksiijko由 GitHub 帳號 oleksiijko 發布v1.1.0更新於 Oct 24, 2026
Local-first persistent memory for AI coding agents.
概覽
為 AI 程式開發代理提供本機持久記憶,保存決策、經驗、專案結構與文件,並透過 MCP 自動召回。
- 可以做什麼
- PMB 將持久記憶存放在本機 SQLite 工作區,旁邊是可重建的向量索引,並透過 MCP 提供給支援該協定的代理。主要讀取工具 prepare(message) 會在毫秒內回傳專案脈絡、相符的經驗規則、近期活動、進行中的目標與敘事主軸;recall(query) 執行詞彙、向量與圖譜的混合檢索。代理也能記錄決策、經驗、目標與鍵值事實,並索引程式專案、PDF 與 Markdown。選用的掛鉤會在模型思考前注入記憶,並在之後記錄代理的工作。
- 適用情境
- 當你需要跨工作階段、跨模型升級或跨代理反覆說明同一批專案決策、限制或個人事實時,適合加入。也適合希望記憶完全留在本機、不使用帳號、API 金鑰或雲端服務的使用者。
- 執行需求
- 以 stdio 方式作為代理的子程序在本機執行;透過 pip(pmb-ai)或 npx 安裝,然後對每個代理執行 pmb setup 與 pmb connect。不需要帳號、API 金鑰或網路存取。首次召回會載入約 450 MB 的嵌入模型,可用 pmb warmup 預先載入。僅支援桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 PMB AI,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
PMB
Local-first memory for your AI coding agent.
SQLite is the source of truth. No cloud, no API keys, no re-explaining.
[Website] [PyPI] [CI] [Docs] [Python] [License] [MCP] [GitHub MCP Registry]
[PMB dashboard - your project's memory as a live entity graph]Local-first memory, visualized. 3,800+ entities and 41,000+ connections, captured automatically as you work.
Website · Docs · Quickstart · Demo · Why PMB · How it works · FAQ
Your AI agent forgets everything between sessions. So you re-explain the same decisions, lessons and constraints over and over. PMB remembers them in one local workspace and feeds them back through MCP - no cloud, no API keys, no LLM call on the read path. And it tells you when memory is actually helping, instead of claiming "+X%".
⭐ Star the repo if PMB saves you a re-explanation.
PMB gives Claude Code, Cursor, Codex and the other MCP-aware agents a real memory: decisions you made last week, lessons you taught them, personal facts, project structure, PDFs. They survive every restart, every model upgrade, every agent switch - because they live in a local workspace you own, with SQLite as the durable source of truth and rebuildable search indexes beside it.
No API keys. No subscription. No LLM call on the read path. Just local files.
Quickstart
That's it - your agent now remembers. No account, no keys, nothing leaves your machine.
Command name: the CLI is
pmb. Viapipyou also get the aliaspmb-ai; vianpm(npx pmb-ai setup) the command ispmb-aiand it installs the Python package first, then runs setup. Same tool - use whichever your install gave you.
Links: pmbai.dev (site) · docs.pmbai.dev (docs) · Getting started · Deleting memories.
Demo
What it feels like - same prompt, with and without memory:
[Watch the 2-minute PMB setup]
▶ Click to play the 2-minute setup
[Same prompt, with and without memory: without PMB the agent asks which file and what the bug was; with PMB it recalls verdict-policy.ts:142 in 6 ms.]The agent didn't ask. It didn't guess. It read its memory in 6 ms and showed up already informed.
Why PMB
- Local-first, zero-config. SQLite holds the durable memory; rebuildable search indexes stay local. No account, API keys, telemetry, or cloud to trust.
- It actually gets used. On Claude Code / Codex, hooks inject the right memory before the model thinks - you never have to remember to call a tool.
- Multilingual, no setup. The embedder covers 50+ languages; a Russian query finds an English fact. No per-language config.
- MCP-native. One
pmb connectwires Claude Code, Cursor, Codex, Windsurf, Zed, VS Code, and more. - Fast read path. Recall in ~35 ms warm; writes return in under a millisecond - no LLM call to remember.
- Honest impact. The dashboard shows which lessons actually changed outcomes, instead of claiming "+X%".
- Your data, in the open.
pmb exportdumps everything to Markdown/JSON. Apache 2.0.
See your memory
pmb dashboard opens a local, liquid-glass web UI on http://127.0.0.1:8765
over everything PMB captured - written automatically, just by working. It binds
to 127.0.0.1 only, so nothing leaves your machine.
Map - every entity and connection in your project, as a live graph.
[PMB dashboard - Timeline (journal)]Timeline - your memory as a journal, newest first.
Nine tabs: Map (entity graph, live), Timeline (git-graph by project), Overview, Entities, Arcs (narrative threads), Lessons (per-rule follow-rate, dead-lesson detection), Duplicates (inline merge), Performance (per-tool latency), Recall (debug ranker).
Verified local backups
Snapshots use SQLite online backup to include committed WAL data and record
file checksums. Restore checks the snapshot before changing memory and saves
a verified copy of the previous state. Use pmb snapshot list --json in scripts.
See backup and recovery for scope and limitations.
What you can store
PMB is content-agnostic. If it's text the agent will care about later, PMB remembers and retrieves it.
What the agent gets back
A single MCP call - prepare(message) - returns the right things at the right
level of detail, in 4-16 ms:
For everything else there's recall(query) (hybrid search, 35 ms warm) and 27
other tools in docs/reference/COMMANDS.md.
How it works
- Storage - every durable event lives in SQLite, the source of truth. Rebuildable vector indexes live in LanceDB beside it. The whole workspace stays on your disk and can be copied or exported anytime.
- Recall - BM25 (lexical) + dense vector (semantic) + entity graph + optional cross-encoder rerank, fused via Reciprocal-Rank-Fusion.
- Writes - async. The MCP tool returns in under a millisecond; the embed + LanceDB insert happen on a background thread.
- Dedup - four layers: exact text match -> cosine >= 0.92 auto-merge -> cosine 0.80-0.92 borderline (LLM verify later) -> manual review in the dashboard. Old values are archived, never deleted; full history via
keyed_fact_as_of(t). - Multilingual - no language packs. The default embedder (
paraphrase-multilingual-MiniLM-L12-v2) covers 50+ languages, so где я живу finds a keyed-fact stored as user.city = Warsaw. Intent detection rides English semantic anchors that transfer cross-lingually, and the cold lexical path self-compiles from your own traffic. Recall stays strong across ~11 languages (top-3 ~= 0.9 on a 101-query eval; top-1 = 1.00 for en/fr/pt/ru). See docs/contributing/adding-a-language.md.
Install
The Quickstart above is all most people need. Other ways:
Wire one or more agents (all stdio - the server runs as a child of your agent; no network, no port, no token):
Point several agents at one memory:
Sharing one memory across machines or a team? That's an optional HTTP mode with bearer-token auth - see docs/guide/TEAM.md. Not needed for local use.
Running the tests? Use the venv's Python:
.venv/bin/python -m pytest(or.venv\Scripts\python.exe -m pyteston Windows). Barepytestoutside the venv just reports missingnumpy/fastmcp/typer.
CLI cheat sheet
Step-by-step per agent: docs/guide/usage.md. Full reference: docs/reference/COMMANDS.md.
Hooks - memory that doesn't wait to be asked
The hard part of agent memory isn't storing - it's getting the agent to use
what's stored. Soft instructions in a rules file get skipped. So PMB wires hooks
at the protocol level (pmb hooks install claude-code), each removing a
dependency on the model remembering to act:
- UserPromptSubmit -> auto-recall. Every message is classified (regex, multilingual, sub-ms) and the matching memory - lessons, past decisions, recall hits, project overview - is injected before the model thinks. Trivial messages inject nothing.
- PostToolUse -> ambient observe. Every tool the agent runs is appended to a lightweight action journal (a single SQLite INSERT, no model). Reads and
lsare filtered out; edits, tests and commits are kept. - SessionStart -> session-restore. After a context compaction the agent rebuilds "where you left off" from what the session recorded, instead of re-asking you.
- Stop -> follow-through + ambient auto-write. (a) It checks which surfaced lessons actually showed up in what the agent did and marks them followed, deterministically. (b) If the agent did NOT call a
record_*tool, it synthesizes one activity entry from the observed actions - so real work is captured even when the agent stays silent.
Preview any without an agent: pmb auto-context "...", pmb session-restore -m 180, pmb lesson-followcheck --dry-run, pmb autowrite --dry-run.
Ambient memory - the write side
Auto-recall fixed the read side; ambient memory does the same for the write
side - the memory journals the agent's work even when it forgets record_batch:
- Coordinated. If the agent already called a
record_*tool this turn, ambient stays silent; it only fills the gap. - Outcome-scored, not churn. A turn is journaled only if results clear a quality bar (tests passed, a failure fixed, a deploy ran), not by file count alone.
- Honest + reversible. Every ambient entry is tagged
source=autowrite, shown as auto in the dashboard, and removable withpmb forget-auto. On by default; disable withpmb config set autowrite.enabled false. - Works on every host. Claude Code (hooks), Codex (
pmb codex-notify), MCP-only hosts like Cursor/Zed/VS Code (git observer,pmb ambient-watch .). Check yours withpmb hooks capabilities.
Synthesis is template-based by default (instant, no model). Opt into a local/API/CLI
model summary with pmb config set autowrite.synthesizer llm:ollama or llm:openai
(it has a timeout and falls back to the template).
Self-improvement loop
Every surfaced lesson carries a surface_id. Follow-through is recorded both
ways: the agent confirms via mark_lesson_followed(surface_id, True), and the
Stop hook infers it from recorded activity. The Lessons tab then shows,
per rule: how often it was shown, how often it was followed, ★ USEFUL
(followed >= 2x), ? UNVERIFIED (surfaced but unconfirmed), and 💀 DEAD only
when a rule is repeatedly ignored (>= 2). You see which rules help and prune
the ones that don't.
Settings - 25 you care about, 80 you don't
PMB has 105 tunables. The 25 that affect day-to-day quality are default-tier
(pmb config list). The rest are internal weights and experimental flags,
hidden behind --pro so the surface stays scannable. Every pro key still reads
with pmb config get and writes with pmb config set - hidden from list, not
gated.
Numbers
Privacy
- 100 % offline by default. No network calls from the engine, zero telemetry - there is no PMB server to call home to.
- Workspace = a directory under
~/.pmb/<name>/. Copy it to Dropbox, push it to git, share it on a USB drive. Your call. - Secrets are auto-redacted at write time (OpenAI / Anthropic / AWS / Stripe / GitHub keys; configurable).
- Apache 2.0 licensed. Forks welcome.
FAQ
Does PMB call an LLM? On read: never. On write: never by default. Optional:
pmb consolidate can run a local Ollama, Claude CLI, Anthropic, or OpenAI pass to write short
reflections - opt-in.
What about cost? $0. There is no PMB service.
Does the agent need to know about PMB? After pmb connect, the rules are
appended to CLAUDE.md / AGENTS.md automatically. The default profile exposes
10 core MCP tools (including the prepare() read-first pattern); wider profiles
exist for ingestion and admin.
Will it slow my agent down? Tools return in single-digit milliseconds for
everything except recall (35-110 ms warm), which is below human perception.
Can two agents share one memory? Yes - point them at the same workspace. SQLite WAL + a 10 s busy-timeout handle concurrent writes.
Wipe a fact? pmb forget <ulid> archives it (excluded from recall, restorable).
Hard-delete: pmb delete <ulid> --hard.
Windows? Yes - tested on Windows 11, macOS 14, Ubuntu 22.04. Cyrillic paths and console encoding are handled.
PDFs / code / Markdown? pmb index pdf paper.pdf, pmb index project .,
pmb import markdown ~/notes/, pmb import chatgpt path.json.
Cold start is slow. First recall loads the embedding model (~3 s). Run
pmb warmup once, or let the prewarm thread handle it in the background.
Roadmap? See docs/ROADMAP.md: litestream backup, optional cloud-sync (BYO bucket), tree-sitter project indexing, image OCR.
Contributing
Issues and PRs welcome. There's one full-time maintainer; please open a discussion before a large change so we can align on direction.
Dev commands
scripts/codeql_local.sh auto-installs the CodeQL bundle on first run and runs
the exact suite CI uses, so security findings are caught locally instead of on a
push. The pre-commit hook bypasses with git commit --no-verify (or skip just
the scan with SKIP_CODEQL=1).
License: Apache 2.0.
來源:README.md,提交 59b6800
工具
0版本歷史
1- v1.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分