Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Matryca Plumber

CI PyPI PyPI Downloads GitHub release Python Tests Coverage

Ruff mypy License Platform Local-first MCP Logseq OG Security Contributing Code of Conduct Discussions Sponsors Views Clones

I gave my AI access to my notes. It corrupted them.
I built Matryca Plumber so that never happens again.

CLI · MCP · background daemon · Sovereign UI · Logseq OG · OCC-safe · local-first

Install · Tana import · Architecture · Compare · Agents · Docs · Community · Contributing

AI agents: read llms.txt — run uvx matryca-plumber --help; do not parse Markdown manually.

Matryca Plumber is the definitive bridge between your trusted AI agent and your Logseq OG vault — a headless CLI and MCP server for safe read/write on Logseq's block tree (no raw Markdown parsing, no Logseq API, no silent overwrites), plus a background daemon and Sovereign UI. v1.11.0 adds Tana → Logseq OG migration; v1.11.1 aligned logseq-matryca-parser 1.4.0; v1.11.2 refactors the graph layer boundary; v1.12.0 applies Clean Architecture to Tier-1 prompts, L0 write safety, and fragment-assembled SYSTEM_PROMPT.md; v1.12.1 adds contributor Clean Code docs and a v2.0 preparation index; v1.13.0 ships daemon/dispatch modularization (#58, #59) and GraphReadPort (v2 Phase 1); v1.13.1 pins logseq-matryca-parser 1.6.0 with headless newline parity; v1.14.0 hardens MasterCatalog write-safety, the file watcher, and leaf-module dependency direction after the 2026-07-16 code audit. Built on Andrej Karpathy's LLM-Wiki vision. Release candidate: v2.0.0-rc.1CHANGELOG.md. The RC moves Shadow to a per-user external cache, makes healthy Shadow reads default-on with explicit MATRYCA_SHADOW_DB_ENABLED=false opt-out, and supports independent Strict Read Only and Shadow controls while Logseq Markdown remains authoritative. Gate A is qualified; the public RC begins the separate Gate B observation required before stable v2.0.0. The published v2.0.0-beta.1 / 2.0.0b1 wheel remains the historical default-off, graph-local baseline. Readiness record: docs/quality/issue-bodies/v2-rc-stable-readiness.md.

Developed by Marco Porcellato · Matryca.ai — the product name is Matryca Plumber (not “Matryca” alone). See docs/BRANDING.md.

Matryca Plumber — Agentic Knowledge Management for Logseq OG

What it does

  • Tana → Logseq OG importmatryca import tana --file export.json [--apply] and MCP import_tana stream Tana workspace JSON into your vault: ijson anti-OOM parsing, logseq/config.edn journal routing, depth-split, catalog wikilink resolution, tana-id idempotent OCC writes — dry-run by default (docs/openspec/tana-import.md)
  • Agent CLImatryca --json read, context load, read subtree — structured access to pages and block trees without hand-parsing .md
  • MCP server — eight FastMCP stdio tools for Cursor / Claude Desktop; query and mutate the graph headlessly (MATRYCA_MCP_ENABLED=true when you trust the host)
  • Logseq-native writeslogseq-matryca-parser AST compliance: line-0 frontmatter, +2 block properties, namespace encoding — agents stop breaking vaults
  • OCC safetyst_mtime snapshots + page locks; if you edited while the model was thinking, the commit aborts — your typing always wins
  • Background daemon — semantic summaries, dangling [[link]] healing, entity consolidation while you sleep (local LLM via LM Studio / Ollama)
  • Sovereign UI — browser dashboard at :8500; pre-flight checklist, trust tiers, live telemetry — configure everything without terminal env vars
  • Link hygiene — background URL/asset checks, Journey Log in today's journal — no per-cycle journal spam
  • L0 write safety — semantic index commits abort when an LLM diff would delete id:: lines or edit protected zones (graph/safety/validators.py)
  • Tier-1 prompt architecture — domain */prompts.py builders + DI on InstructorLLMClient; SYSTEM_PROMPT.md assembled from OpenSpec fragments (make build-system-prompt)
  • Shadow DB (unreleased v2 RC-target source, default-on external cache) — derived shadow.sqlite read cache outside the Logseq graph: FTS5 BM25 + recursive CTE subtree while health is ready, with generational BM25 + parser fallback otherwise. MATRYCA_READ_ONLY=true can protect the graph while Shadow remains enabled; MATRYCA_SHADOW_DB_ENABLED=false explicitly disables the cache. The Sovereign UI exposes both independent controls and reports bounded fallback reasons. The published 2.0.0b1 wheel remains historically opt-in and graph-local. See llms.txt §2.6.
    • Over-budget pages are quarantined, not fatal. If a page exceeds the page-parse budget (MATRYCA_PAGE_PARSE_TIMEOUT_S, default 15 s), it is parked instead of aborting the rebuild: the rest of the graph is cached and reads for that page use Markdown, which stays authoritative. Health remains READY and the Sovereign UI shows how many pages are parked. On a measured daily-use vault of 1,014 graph pages, 3 pages (0.30%) exceed the default and consume the large majority of total parse time — parse cost tracks page structure, not size (the largest page measured, 650 KB, parses in 0.54 s while a 336 KB page does not finish in a minute), so quarantine removes almost all of the rebuild cost. A parked page is released automatically as soon as it parses within budget; raising MATRYCA_PAGE_PARSE_TIMEOUT_S (2–120 s) parks fewer pages at the cost of slower rebuilds, and MATRYCA_SHADOW_QUARANTINE_ENABLED=false restores the strict fail-the-rebuild behaviour. Full analysis: docs/quality/SHADOW_DB_PARSE_BUDGET_TRIZ_2026-07-27.md.
  • 100% local-first — vault stays on disk; no cloud API key required

Tana → Logseq OG migration

Export your Tana workspace as JSON (Export workspace as JSON in Tana), then import into a clone of your Logseq graph first:

export LOGSEQ_GRAPH_PATH=/path/to/your/logseq/graph

# Dry-run (default) — JSON report on stdout; stderr warns no writes
matryca import tana --file ~/Downloads/workspace.json | jq '.write'

# Commit after reviewing counters
matryca import tana --file ~/Downloads/workspace.json --apply | jq '.write.pages_created'
Tana concept Logseq OG destination
Entity / supertag page Tana/{Supertag}/{Name} under pages/
#day / calendar node journals/ (title from your logseq/config.edn)
Nested children Indented bullets with fresh id:: UUIDs
Tana node ID tana-id:: property (idempotent re-import skip)

Full pipeline spec: docs/openspec/tana-import.md · MCP: import_tana(export_path, dry_run=True)

How it works (30 seconds)

CLI, MCP, daemon, and Sovereign UI converge on one OCC-protected mutation plane — same vault on disk, no Logseq HTTP API.

flowchart TB
  subgraph operators [Operators and agents]
    Human[Human · Logseq optional]
    UI[Sovereign UI :8500]
    Daemon[Maintenance daemon]
    CLI[matryca CLI --json]
    MCP[FastMCP stdio optional]
  end

  subgraph plane [Shared headless mutation plane]
    GD[graph_dispatch]
    Lock[OCC + page_rmw_lock\n+ platform_lock flock]
    Parser[logseq-matryca-parser]
    GD --> Lock
    GD --> Parser
  end

  subgraph local [Local inference — 100% offline]
    LLM[LM Studio / Ollama]
  end

  subgraph vault [LOGSEQ_GRAPH_PATH — single source of truth]
    Pages[pages/ · journals/ · templates/]
    Meta[.matryca_* cache & ledgers\nmatryca-l1/ session rules]
  end

  Human <-->|co-edit Markdown| Pages
  UI -->|start · stop · config · telemetry| Daemon
  Daemon -->|Phase 1 harvest · Phase 2 lint| GD
  Daemon <-->|structured JSON| LLM
  CLI --> GD
  MCP --> GD
  Lock -->|atomic UTF-8 writes| Pages
  Meta -.-> GD
  • Single mutation planegraph_dispatch + OCC locks; CLI, MCP, and daemon share the same write contract
  • Phase 1 → Phase 2 — catalog harvest, then cognitive lint against a local LLM
  • Parser-first — agents never touch raw Markdown; the AST layer handles Logseq quirks
  • One vault pathLOGSEQ_GRAPH_PATH (set in the Sovereign UI or .env)

docs/ARCHITECTURE.md

Get started (60 seconds)

# 1 — Try instantly (opens Sovereign UI in your browser)
uvx --from matryca-plumber matryca-plumber status

# 2 — Configure in the browser — no terminal env vars needed
#    Pre-flight → Settings (gear) → Logseq Graph Path → local LLM → Start Engine

# 3 — Optional: install globally + background service
uv tool install matryca-plumber
matryca service install

The first command opens the Sovereign UI at http://127.0.0.1:8500. Use the pre-flight wizard to point at your vault, pick a local LLM, and click Start Engine. The daemon does not run until you confirm.

Command What it starts Browser / :8500 Maintenance daemon
matryca plumber status (recommended) Sovereign UI + local API Yes No — use Start Engine or plumber start
matryca plumber ui Same as status Yes No
matryca plumber start Background daemon only No Yes
matryca plumber stop Stops daemon

Common mistake: matryca plumber start does not open the dashboard — run matryca plumber status (or use Start Engine from the UI).

How it compares

Feature Matryca Plumber Official Logseq AI Plugin Obsidian LLM Plugins
Local-only Yes — vault stays on disk Typically cloud-backed Mixed (local + cloud options)
No API Key required Yes — local LLM endpoint Usually requires provider API key Often requires API key
OCC Safety (no corruption) Yes — st_mtime + page locks No comparable write guard No standard OCC layer
MCP Support Yes — FastMCP stdio tools No Varies by plugin
Agent CLI (structured graph access) Yes — matryca --json No Varies by plugin
Tana workspace import Yes — import tana / import_tana (dry-run default) No No

Matryca Plumber targets Logseq OG (Markdown on disk); Obsidian comparisons refer to common community plugins, not a single product.

Clone your graph first

Matryca Plumber edits local .md files directly. OCC prevents silent data loss, but test on a clone first — especially before import tana --apply:

  1. Duplicate your graph folder (e.g. MyGraphMyGraph_Test) and add it in Logseq via Add new graph.
  2. If you use Logseq Sync: do not enable Sync on the test graph.
  3. In the Sovereign UI: SettingsLogseq Graph Path → point at the clone → Save.

Once comfortable, switch to your main graph in Settings.

Trust & Safety

You are in control. Nothing mutates your prose unless you explicitly enable it in the UI.

Mode Risk What it allows
🟢 Safe Mode Read-only Semantic cache, entity consolidation (alias::), property hygiene — never edits bullet text.
🟠 Augmented Mode Side-blocks Heal Dangling Links, Backpropagate Links — original bullets stay intact.
🔴 Surgeon Mode Inline edits Inline Semantic Corrections, Auto-Split Dense Blocksstrictly opt-in.

"Logseq is building the best local outliner database. But AI Agent memory is at the very bottom of their roadmap. Matryca Plumber gives you that future today, safely bridging your local agents to your Logseq graph without waiting years." — Marco Porcellato, Matryca.ai

Agent CLI & MCP

Point the vault in the Sovereign UI (or .env) — agents inherit LOGSEQ_GRAPH_PATH.

matryca --json read page "My Project"
matryca context load "My Project"
matryca import tana --file ~/Downloads/workspace.json   # dry-run; add --apply to write

Eight MCP tools (five mega-tools + store_fact + ingest_document + import_tana) — MATRYCA_MCP_ENABLED=true when you trust the host. Spec: llms.txt · docs/openspec/agent-dx.md · docs/openspec/tana-import.md · docs/openspec/agent-onboarding.md

Sovereign UI, configuration & full capabilities

UI (:8500) — pre-flight checklist, live telemetry, trust tiers, Bearer auth (SECURITY.md). Recommended LLM: Gemma 4-E4b Instruct (gemma-4-e4b-it) on 16 GB RAM.

Daemon — semantic indexing, dangling links, entity consolidation, auto-split, ingest_document, import_tana, link verification, LLM OS Soft Gate. OpenSpec: docs/openspec/README.md.

Advanced .env — copy .env.example; Tana knobs: MATRYCA_TANA_IMPORT_NAMESPACE, MATRYCA_TANA_DEPTH_LIMIT; edge profile for large vaults: docs/v1.8-OPTIMIZATION-PLAN.md. Release history: CHANGELOG.md.

Community

Channel Use for
GitHub Issues Bugs, feature requests, trackable work
GitHub Discussions RFCs, architecture debate (#19 — v2 Shadow DB)
Good first issues Scoped starter tasks — see good_first_issues_blueprints.md
SUPPORT.md Where to ask vs where to file bugs
Logseq forum Logseq OG ecosystem questions
Sponsor Support ongoing maintenance

Code of conduct: report concerns to marco@matryca.ai — see CODE_OF_CONDUCT.md.

New contributors: start with docs/FIRST_CONTRIBUTION.md, then CONTRIBUTING.md.

Developer setup

git clone https://github.com/MarcoPorcellato/matryca-plumber.git && cd matryca-plumber
make install
cd frontend && npm install && npm run build && cd ..
make test-fast    # fast loop (~5s)
make ci           # full CI gate before PR (format-check + lint + types + tests)

Documentation

Start here Go deeper
AGENTS.md docs/PROMPT_ARCHITECTURE.md — Clean Architecture for prompts
SUPPORT.md docs/ARCHITECTURE.md
CONTRIBUTING.md docs/openspec/README.md
docs/FIRST_CONTRIBUTION.md docs/ARCHITECTURE.md
llms.txt docs/openspec/tana-import.md
ROADMAP.md CHANGELOG.md
v2.0 preparation v2 issues label:v2.0 · v2_preparation_blueprints.md
SYSTEM_PROMPT.md docs/integrations/hermes-agent.md
Good first issues good_first_issues_blueprints.md
docs/releases/v2.0.0-alpha.5-GITHUB.md GitHub Release body for v2.0.0-alpha.5 (hardening campaign close)
docs/releases/v2.0.0-beta.1-GITHUB.md GitHub Release body for v2.0.0-beta.1 (first public beta of the opt-in Shadow DB)

License

Apache-2.0 — see LICENSE.

Matryca Plumber Cover

Star History

Star History Chart

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matryca_plumber-2.0.0rc1.tar.gz (663.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matryca_plumber-2.0.0rc1-py3-none-any.whl (544.0 kB view details)

Uploaded Python 3

File details

Details for the file matryca_plumber-2.0.0rc1.tar.gz.

File metadata

  • Download URL: matryca_plumber-2.0.0rc1.tar.gz
  • Upload date:
  • Size: 663.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for matryca_plumber-2.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 4c4f87d91ad7f1ee5a1e9a8e7b79410d7d9dc89bbc670a9008bb082f06e61894
MD5 d247048b1ef0b09ec383996ab3c8194a
BLAKE2b-256 b635f2418824f0f5364dfb46c11fe1d20774cdfc09f061362444eab481cf45d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for matryca_plumber-2.0.0rc1.tar.gz:

Publisher: release.yml on MarcoPorcellato/matryca-plumber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matryca_plumber-2.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for matryca_plumber-2.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c60cc89049b9524ca9f9346a053bac3c7aba6f2186d9a31a3993bd7a9253cd
MD5 dbad4a4121c285adc74d599328a10084
BLAKE2b-256 3bf79c5718cbe2f36292c6d1e6638c1b60ea3395e5a07ef0280cbfd3c5ba643f

See more details on using hashes here.

Provenance

The following attestation bundles were made for matryca_plumber-2.0.0rc1-py3-none-any.whl:

Publisher: release.yml on MarcoPorcellato/matryca-plumber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.0

2 files

This release

2.0.0rc1 This release

2 files

1.14.5

2 files

1.14.3

2 files

1.14.2

2 files

1.14.0

2 files

1.13.1

2 files

1.13.0

2 files

1.12.1

2 files

1.12.0

2 files

1.11.2

2 files

1.11.1

2 files

1.10.6

2 files

1.10.5

2 files

1.10.4

2 files

1.10.3

2 files

1.10.2

2 files

1.9.15

2 files

1.9.14

2 files

1.9.13

2 files

1.9.12

2 files

1.9.11

2 files

1.9.10

2 files

1.9.9

2 files

1.9.8

2 files

1.9.7

2 files

1.9.6

2 files

1.9.5

2 files

1.9.4

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.5

2 files

1.8.4

2 files

1.8.2

2 files

1.8.1

2 files

1.8.0

2 files

1.7.5

2 files

1.7.0

2 files

1.6.1

2 files

1.5.16

2 files

1.5.15

2 files

1.5.14

2 files

1.5.13

2 files

1.5.12

2 files

1.5.11

2 files

1.5.10

2 files

1.5.9

2 files

1.5.8

2 files

1.5.6

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page