
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 分