
Mazarbul
io.github.mo-cmyk由 GitHub 帳號 mo-cmyk 發布v0.2.3更新於 Oct 31, 2026
Local-first memory for AI agents: entities, facts, relations and documents with semantic recall.
概覽
為 AI 代理設計的本地優先記憶伺服器:儲存實體、關係、事實與自由文字片段,並以語意、關鍵字與圖譜混合檢索進行回想。
- 可以做什麼
- 跨工作階段記住並回想自由文字片段,回傳附分數的混合檢索結果
- 建立與查詢帶類型的實體、關係與事實,並自訂實體種類與述詞
- 遍歷知識圖譜:取得某個實體、它的鄰居與關係
- 取得依 token 預算裁剪的脈絡檔案,可針對單一工作階段或單一實體
- 記錄指向其他工具中所讀項目的參照,附摘要與新鮮度錨點
- 遺忘或撤回紀錄,同時保留僅追加、帶簽章的歷史
- 適用情境
- 適合助理在工作階段之間反覆遺失脈絡、你希望擁有一份本地可控且可查詢的持久記憶時使用,不必每次重新說明程式碼庫、偏好或決策。也適用於需要結構化加自由文字回想的個人知識圖譜、決策日誌與筆記庫。
- 執行需求
- 以本機程序執行(單一 Go 二進位檔,可透過安裝腳本、Homebrew 或 MCP 套裝安裝),僅支援 macOS 與 Linux 桌面端。需要一個以 maz init 初始化一次的資料目錄,以及供語意回想使用的本機嵌入模型(安裝程式預設會安裝 Ollama 並下載模型,可選擇略過)。不需帳號或 API 金鑰;伺服端聊天模型為選用項目。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mazarbul,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Mazarbul
The system of records for the era of agents.
Local-first, git-native memory and structured data for your AI agents. One Go binary. Talks MCP. Your data never leaves your machine.
[License: Apache 2.0] [Go 1.26] [MCP] [Local-first] [Works with Claude Code]
What is Mazarbul
Your agents have anterograde amnesia. They forget everything between sessions, so you re-explain your codebase, your preferences, and your decisions every single time. The usual fixes do not hold: a CLAUDE.md caps out and goes stale, a markdown vault is not a database, and cloud memory is an opaque blob you cannot query, audit, or own.
Mazarbul is the place your agents remember. A single local binary, maz, that any MCP-aware agent (Claude Code, Cursor, your own) talks to. Under the hood it is an append-only, cryptographically signed event log, projected into a graph, a vector index, and full-text search, and synced over plain git. Every fact carries its source. Nothing phones home.
It is both a memory for free-text episodes and a real database for typed entities, relations, and facts you can query. Think of it as a personal knowledge graph, a CRM, a decision log, and an agent memory, in one file you own.
And it runs headless. One lean binary gives you a CLI and an MCP server, with no separate database server to stand up and no UI required. So anything that needs to persist structured or unstructured data can lean on it: an agent over MCP, a script or cron job that shells out to maz, or you at the command line. Mazarbul is a local data layer you can drop into virtually anything.
What makes it different:
- Event-sourced and signed. Every memory is an immutable, ed25519-signed event. The log is the source of truth; the indexes are rebuildable derivatives. Nothing is silently overwritten.
- Four-layer hybrid recall. Vector similarity, full-text BM25, graph traversal, and name-embedding, fused into one ranked result with the score breakdown visible.
- Git-native, conflict-free. Plaintext JSONL syncs over any git remote. Two devices converge by construction (CRDT), so concurrent writes never overwrite each other.
- Provenance and audit on every fact.
maz blameshows who changed what and when, likegit blamefor your agent's memory. No other memory layer treats this as first-class. - Structured and unstructured. Free-text
remember, plus typed entities, relations, and facts you define and query. A database, not a pile of notes. - Reference your live tools, don't copy them. Your agent is already connected over MCP to Notion, Linear, Drive, and more. Mazarbul indexes them with a pointer, a short summary, and a freshness anchor, never the body, so recall spans your own memory and your live sources at once with nothing duplicated.
Your agent is the brain, Mazarbul is the memory
The agent that calls Mazarbul over MCP (Claude Code, Cursor, your own) is already a strong model, so let it do the reasoning. It decides what is worth remembering, writes entities, relations, and facts with the structured tools (createEntity, relate, fact), resolves duplicates, and answers your questions from what recall and getContext return. Mazarbul stores, indexes, recalls, and proves where every record came from. That is why maz init configures no server-side chat model by default: you need only a small local embedding model for semantic recall, not a second LLM. A server-side model (Anthropic or a local Ollama model) is an optional extra that helps only when no agent is in the loop: passive file watching, connector ingestion, maz ask from a plain terminal, and background consolidation.
Install
Or with Homebrew (macOS and Linux):
The installer verifies the download checksum, places maz plus its bundled engine library and man pages, and sets up a local model provider (it installs Ollama and pulls the embedding model semantic recall needs, unless you opt out with --no-ollama). It pulls no chat model: your agent does the reasoning. Then run maz init. If you want Mazarbul to reason on its own as well (agent-less ingestion, maz ask), add --with-chat-model to the installer for a local model, or run maz init --provider anthropic --api-key ... for a remote one.
MCP Registry / one-click bundle. Every release ships a mazarbul_<tag>_<os>_<arch>.mcpb MCP Bundle per platform that Claude Desktop and other MCPB clients install directly. It runs maz mcp serve against your default data dir, so it shares memory with the CLI (run maz init once to pick a provider). Each release is also published to the official MCP Registry as io.github.mo-cmyk/mazarbul, which registry-aware clients and directories pick up.
Build from source
maz dynamically links a small native graph engine (LadybugDB), resolved via an rpath into your Go module cache, so a source build runs on the machine that built it. For a self-contained, relocatable binary that bundles the engine, use the installer above.
Quickstart: zero to agent memory
That is it. Claude Code now has a recall and remember tool pointed at your Book, and every session it works in gets remembered and fed back. Any other MCP agent connects the same way via maz mcp serve.
How it works
The event log is the source of truth. Everything else is a rebuildable projection of it.
Because the log is append-only and every event is immutable and signed, two devices that sync the same log converge to byte-identical state. There is no last-write-wins overwrite. If any index is ever corrupted, maz rebuild reconstructs all four from the log.
A database for your agents, not a pile of notes
This is the core of it. Mazarbul stores free text and structured data, and lets you query both.
[Defining a typed kind, minting an entity, and querying it back]
Pure markdown cannot query, join, or track change. Pure vector search cannot connect facts across documents. Mazarbul gives you typed entities and relations with a queryable graph, and the free-text episodes, fused in one recall.
What you can do
Mazarbul is a universal, headless data layer and system of record. The same primitives become many tools:
- Agent memory. The default.
rememberfacts,recallthem across sessions. Stop re-explaining your project to every agent. - Notes and knowledge vault.
maz doc import ~/notespulls your markdown in; wikilinks resolve to entities;maz doc logandmaz doc diffgive every note a history. - Personal CRM. People, organizations, and the relations between them (
works_at,reports_to,introduced_by). Capture how and why you met someone, not just a name. - Decision log / ADRs. Append-only by design, with supersede links. The reasoning behind a decision survives, and stays queryable, long after you would have forgotten it.
- Knowledge graph. Define domain kinds and predicates, install schema packs, and traverse the result.
- Team brain. A shared, end-to-end-encrypted scope so a whole team's agents draw on the same memory.
Draft staging: stage before you commit
Sometimes you want to capture something without immediately making it part of your permanent memory. Write with --scope draft and it lands in a private staging area, invisible to recall, get, and every other read verb until you decide what to do with it:
Promotion always targets personal (or project). Promoting directly into a shared team scope is refused by design — unreviewed draft data should never land in a shared scope without an explicit team write. Discard removes the episode and all draft entities it created; the event log itself is append-only, so the audit trail is preserved.
Named recall shortcuts
Save a query once, replay it whenever you need it:
Saved queries live in your Book's config.toml under [saved_recalls]. Replaying always hits the live index, so results evolve as new episodes arrive.
Build your own skills and ontology
A preset is a skill for your agent: a schema pack (entity kinds and predicates) plus an instructions.md that teaches the agent when and how to use them. Install one, author your own, or publish it for others.
Once second-brain is installed, it seeds brain:Person, brain:Project, brain:Note, and brain:Topic kinds with relations like collaborates_on, tagged_with, and inspired_by. Try a recall after adding a few notes to see how the graph organizes them. decision-trace seeds decision, insight, and principle kinds and wires them together with first-class traceability edges.
Define types ad hoc with maz schema kinds add / maz schema predicates add, or let an agent define them over MCP with defineEntityKind / definePredicate. Use maz schema preview kind <name> to see the plan (mint / collapse-into / supersede) before writing. The ontology is data, not code, so it syncs and versions like everything else.
Bring your existing tools
Mazarbul meets your data where it already lives.
[Importing a markdown vault; wikilinks resolve to entities]
This is "Karpathy-style" external memory (an agent that compiles a persistent, interlinked base instead of re-deriving everything per query) with the parts the markdown-wiki approach lacks: a typed query layer, an automatic entity graph, provenance, and a sync that does not corrupt.
Reference live sources instead of copying them
Importing copies data in. The other half is the opposite. Your agent is already connected, over MCP, to the tools your work actually lives in: Notion, Linear, Granola, Google Drive, GitHub. Mazarbul holds no tokens for any of them and never fetches them itself. It indexes them.
After your agent reads an item from one of those tools, a single captureExternal call records a pointer to it, the agent's own short summary, and a freshness anchor (a content hash plus the fetch time). The body never lands in Mazarbul. That summary is then searchable in recall alongside everything else you remember, and every hit grounded in a live source carries an inline freshness verdict and an external-lineage marker:
When a hit goes stale (past that connector's freshness budget) the agent re-fetches the live item and re-captures, so the index never drifts from the source of truth. And because the lineage is external rather than authored, these land proposed, untrusted: searchable and rankable, but clearly summarized-from-elsewhere, not something you asserted. See agent-docs/external-references.md.
The result is one place to search across your own memory and your live tools at once, with no second store to keep in sync.
It's just git
Your memory is plaintext JSONL plus a rendered markdown tree in a normal git repo. Inspect it with semantic, entity-aware commands, or with the git you already know.
maz diff also takes --predicate and --operation post-filters. JSON output (--format json) surfaces a filtered count and an active_filters map alongside the entries, so scripts can assert what changed without parsing prose.
Bulk import and re-embedding
Moving machines, restoring from a backup, or switching embedding models? Two commands cover it:
maz load emits {mode, source, total, appended, skipped, invalid, dryRun}. Warning MAZ-LOAD-001 fires when merge mode skips duplicate UIDs; MAZ-LOAD-002 when a line is malformed. The batch is atomic: either all valid events land or none do. maz reindex --reembed requires an embedder configured (maz init --embed=ollama); the other three derived stores (SQLite, graph, FTS5) are untouched.
Both maz rebuild and maz reindex --reembed run with the daemon up. No maz daemon stop is required. When the daemon is running, the CLI routes these operations to the admin HTTP interface (POST /admin/v1/rebuild, POST /admin/v1/reindex), which is exposed only on the Unix socket, not TCP. The daemon builds a shadow projection in a temporary directory, quiesces for a brief swap window (seconds), renames the new indexes into place, and resumes serving on the same socket. The reconnecting maz mcp serve proxy masks the window for read traffic; in-flight writes fail clean and can be retried. maz reindex --dry-run is unavailable while the daemon runs (it requires in-process store access). The same socket-only /admin/ surface is how maz preset install, maz preset uninstall, maz load, and maz schema alias operations route privileged writes through the live daemon.
[maz sync log, semantic diff, and per-entity blame on the git-tracked tree]
Markdown vaults synced over git overwrite each other on concurrent writes. Mazarbul's log is conflict-free by construction, so two machines pushing at once converge instead of clobbering. For an untrusted host, turn on per-scope encryption (XChaCha20-Poly1305) and the repo holds only sealed ciphertext.
Why Mazarbul
You are probably already doing this with one of these. Here is what Mazarbul gives you instead.
- Obsidian + Claude Code + git. You get markdown silos, manual linking, no query or join, git sync that corrupts on concurrent writes, and provenance only if you hand-enforce it. Mazarbul keeps the git-native plaintext and adds a typed query layer, an automatic entity graph, conflict-free merge, and provenance on every fact.
- Agent-memory libraries (mem0, Letta, agentmemory). A vector store, a cloud API, or a framework you are locked into; memories are opaque, LLM-rewritten blobs with no provenance or audit. Mazarbul is local, four-layer, event-sourced, and every fact cites its source and is auditable.
- Key-value or vector stores, ChatGPT / Claude built-in memory. Opaque, cloud-locked, no schema or relations or query or audit, siloed per product. Mazarbul is a system of record you own, query, time-travel, and move.
The wedge, in one line: agents need both free text and structure, and the systems that combine them (GraphRAG, Zep) all live in the cloud. Mazarbul brings that combination to a single file you own, with provenance and git-native sync no one else offers.
Use with Claude Code and any MCP agent
Once connected, Claude Code works from your Book, traversing the graph to connect facts rather than just retrieving text. The same memory answers a headless claude -p one-shot and a live interactive session, with no tool list and no prompts:
For Cursor, a custom agent, or any other MCP client, run the server directly:
Connected agents get a clean tool surface: remember, recall, forget, relate, get, neighbors, relations, entities, query, createEntity, defineEntityKind, getContext, getEntityContext (a token-budgeted dossier for one entity), agentFeedback, and more. The humans on your team use the exact same data through maz on the command line or its TUI.
For humans: TUI, live watch, and the Agent Mirror
The same memory has rich interactive surfaces — no agent required:
maz learns how it's used
This is the centerpiece of the Omnigraph-parity wave. Every time an agent hits a confusing result, a wrong answer, or a hard-won rule worth keeping, it can record that friction. Recurring friction auto-promotes a distilled one-liner into a ## Known gotchas & lessons section that is appended last to every new MCP session's instructions — so every connected agent starts with the evolved guidance, without any human curation step.
Promotion thresholds: a cluster promotes after 3 recurrences, or 2 when its highest observed severity is high. Pinned clusters are exempt from the 8-entry cap; vetoed clusters never appear. Every review appends an audited event — nothing is ever deleted. The export strips all user memory, principal IDs, cluster keys, and team scope: only {id, ts, category, severity, surface, summary, detail, keywords, version, activePreset} leaves. See agent-docs/feedback-loop.md for the full design.
Output formats and scripting
Every read verb honors --output (or the MAZ_OUTPUT env var):
Aliases: table = text, jsonl = ndjson. Set a persistent default in your Book config:
The config knob sits between MAZ_OUTPUT and the TTY heuristic in the precedence chain, so scripts get JSON automatically while interactive sessions still get a table.
Documentation
- Architecture and design:
agent-docs/synthesis.md,agent-docs/designs/ - Sync, scopes, and teams:
agent-docs/sync.md,agent-docs/privacy.md - Connectors and presets:
agent-docs/connect.md,agent-docs/plugins.md - Draft staging workflow:
agent-docs/draft-scope.md - Dynamic feedback loop:
agent-docs/feedback-loop.md - Warning codes:
agent-docs/warnings.md - Built-in help:
maz help-topics concepts,maz introspect,man maz
A hosted documentation site is on the way.
Contributing
- Humans: start with DEVELOPMENT.md and CONTRIBUTING.md.
- Agents: read AGENTS.md for the operating contract and subagent roster.
- Security: see SECURITY.md for private disclosure (do not open public issues for vulnerabilities).
License
Mazarbul is licensed under the Apache License 2.0. See LICENSE for the full terms and NOTICE for attribution.
來源:README.md,提交 4d1f5f2
工具
0版本歷史
1- v0.2.3最新Oct 31, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分