Enterprise-grade, local-first autonomous background AI daemon and headless mutation plane for Logseq OG.
Project description
Matryca Plumber
v1.5 — Ironclad Release. Agentic Knowledge Management for Logseq OG. An enterprise-grade, local-first background AI daemon with a real-time Sovereign UI control room, a typed CLI, and direct Logseq Markdown AST mutation (no Logseq HTTP API, no auxiliary database). The default experience is autonomous: the daemon and Python workers poll your graph, run structured local-LLM passes, and commit indexes and lint artifacts while you work or sleep. An optional FastMCP stdio sidecar exposes the same headless mutation plane to external clients (for example Claude Desktop) — same
graph_dispatchcontract, not a separate data path. Heavily inspired by Andrej Karpathy's LLM-Wiki vision. 100% native Logseq AST parity, optimistic concurrency safety, versioned AI authorship stamping.
Matryca is a 100% headless, sandboxed standalone daemon + CLI that turns your local Logseq graph into a high token-density agentic workspace — no network APIs and no Logseq desktop JSON-RPC. It treats your vault as a tree of blocks, not a flat document store. Logseq OG remains optional: humans and the daemon co-edit the same .md trees on disk.
Matryca Plumber is not a one-shot script — it is an enterprise-grade, local-first background AI daemon for Logseq. It polls your graph on a duty cycle, calls a local LLM (LM Studio or Ollama), appends semantic indexes, runs optional cognitive lint modules, and logs every token transaction — while you edit the same .md files in Logseq or leave the vault idle. Optional MCP-attached sessions reuse the identical mutation plane for interactive queries; they are not required for background operation. Every write path mirrors Logseq's on-disk AST contract: page frontmatter at line 0, block properties contiguous to their parent bullet, namespace filenames encoded exactly like Logseq's Clojure Datalog layer, and optimistic concurrency control that aborts stale writes when you type during inference.
Matryca Plumber is an enterprise-grade, local-first background AI daemon for Logseq. It turns your local graph into a high token-density agentic workspace by continuously polling your notes, running local LLMs (like LM Studio or Ollama), appending semantic indexes, and healing broken links—all completely offline, while you work or sleep.
Zero Cloud. Zero Data Leaks. 100% Native Logseq AST.
⚠️ Important: Clone Your Graph First
Matryca Plumber edits your local .md files directly. While it features safe Optimistic Concurrency Control (OCC) to prevent data loss, we strongly recommend testing it on a clone of your graph first. This allows you to see the AI in action and explore its capabilities without affecting your primary notes.
How to safely clone your graph (crucial if you use Logseq Sync):
- Make a copy of your entire Logseq graph folder on your computer (e.g., duplicate your
MyGraphfolder and rename it toMyGraph_Test). - Open Logseq, click on your graph name in the top left, and select Add new graph.
- Choose the new
MyGraph_Testdirectory. - If you use Logseq Sync: Do not enable Sync on this test graph. This ensures the AI's test edits remain strictly local and do not propagate to your other devices. a. Create an empty folder and add it as a new graph in Logseq. b. Close Logseq; copy only pages/, journals/, assets/ from production. c. Reopen and Re-index.
- Point Matryca's
.envconfiguration (LOGSEQ_GRAPH_PATH) to this test folder.
Once you are comfortable with how Matryca behaves and have tuned the safety tiers, you can point it to your main graph.
🚀 Quick Install & Getting Started
The fastest way to get started is using uv, the blazing-fast Python package manager.
1. Try it instantly (Zero-install)
Run the CLI directly without polluting your system:
uvx --from matryca-plumber matryca-plumber status
2. Global Installation (Recommended)
Install the binary to use the matryca command anywhere:
uv tool install matryca-plumber
3. Launch the Daemon & UI
# 1. Start the daemon in the background
matryca plumber start
# 2. Open the Sovereign UI control room ([http://127.0.0.1:8000](http://127.0.0.1:8000))
matryca plumber status
4. Set it and forget it (Background Service)
Install it as a LaunchAgent/systemd service so it wakes up with your OS:
matryca service install
🧠 What does it actually do?
Unlike generic scripts, Matryca is a continuous background engine. When paired with a local LLM (like Gemma or LLaMA via LM Studio or Ollama), it provides:
- Semantic Indexing: Automatically generates summaries, suggested tags, and cross-references for your pages.
- Dangling Link Healing: Finds broken
[[WikiLinks]]and creates isolated seed pages for them. - Entity Consolidation: Suggests
alias::properties for overlapping concepts. - Auto-Split Dense Blocks: Extracts oversized subtrees into new pages to keep your graph fast and readable.
- Claude Desktop Integration (FastMCP): Use Claude to query and mutate your Logseq graph natively.
🖥️ The Sovereign UI
Matryca is 100% headless, but it comes with a Sovereign UI Cockpit (matryca plumber status).
It's a local React dashboard running on http://127.0.0.1:8000 that provides:
- Live Graph Telemetry: See exactly what the AI is indexing in real-time.
- Dynamic Impact: Mathematically separates Organic Human Mind (your notes) from Agent Cognition (AI enhancements).
- Zero-Trust Security: Every REST call requires a Bearer token. No anonymous access, even on localhost.
- Trust & Safety Drawer: Visually toggle what the AI is allowed to edit (Safe Mode, Augmented Mode, Surgeon Mode).
✨ Key Features & Differentiators
- 🤖 100% Local-First & Headless: No Logseq HTTP API required. It edits the
.mdfiles directly using atomic file I/O. - 📐 Exact Logseq AST Compliance: True line-0 page frontmatter, block properties at +2 indent, and exact namespace encoding. Other tools break your graph; Matryca keeps it pristine.
- 🔐 Optimistic Concurrency Control: It checks
st_mtimebefore any AI inference. If you typed in Logseq while the AI was "thinking", Matryca aborts its write. No silent data loss. - 🪟 Windows, macOS & Linux Support: Runs safely in the background everywhere using a robust cross-platform lock (
.matryca_plumber_daemon.lock). - ⚡ Context Acceleration Shield: Obliterates LLM prefill latency on 5,000+ block pages by using hierarchical summaries instead of raw megabyte-class text.
🛡️ Trust & Safety Risk Tiers
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 routing cache, entity consolidation (alias::), property hygiene — never edits your bullet text. |
| 🟠 Augmented Mode | Side-blocks | Heal Dangling Links, Backpropagate Links (appends foldable context sections) — your original bullets stay intact. |
| 🔴 Surgeon Mode | Inline edits | Inline Semantic Corrections (wraps concepts in [[WikiLinks]]), Auto-Split Dense Blocks — strictly opt-in. |
⚙️ Configuration Quickstart
Copy .env.example to .env. The only required variable is your graph path:
LOGSEQ_GRAPH_PATH=/absolute/path/to/your/Logseq/graph
MATRYCA_LM_BASE_URL=http://localhost:1234/v1 # LM Studio or Ollama endpoint
MATRYCA_LM_MODEL=qwen2.5-coder-7b # Exact model name loaded
(See docs/ARCHITECTURE.md for advanced thermal pacing, context compression, and deep linter settings).
🧑💻 Developer Setup
Want to contribute or run from source?
git clone [https://github.com/MarcoPorcellato/matryca-plumber.git](https://github.com/MarcoPorcellato/matryca-plumber.git)
cd matryca-plumber
make install
# Build the React frontend
cd frontend && npm install && npm run build && cd ..
# Run tests (427 passing, 0 Mypy strict issues)
make check
📚 Documentation Map
| Document | Description |
|---|---|
SYSTEM_PROMPT.md |
Agent discipline, made-by:: authorship, OCC rules. |
docs/ARCHITECTURE.md |
Data planes, Plumber lifecycle, RMW locking rationale. |
docs/PROJECT_DIARY.md |
Maintainer log, phase history, crushed bottlenecks. |
CONTRIBUTING.md |
Setup, uv commands, make check standards. |
License
Apache-2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matryca_plumber-1.5.10.tar.gz.
File metadata
- Download URL: matryca_plumber-1.5.10.tar.gz
- Upload date:
- Size: 337.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
001f50b4e3bcc45725ed59eaeada3ce8e6b6b558cb9e16090d6137bce8cc4cd0
|
|
| MD5 |
55f97e9727c8383748f60fc88f434799
|
|
| BLAKE2b-256 |
14f3f22abc338ad9e13eb280a580308793bcfccd7b91a586b4c88eba4f305111
|
Provenance
The following attestation bundles were made for matryca_plumber-1.5.10.tar.gz:
Publisher:
release.yml on MarcoPorcellato/matryca-plumber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matryca_plumber-1.5.10.tar.gz -
Subject digest:
001f50b4e3bcc45725ed59eaeada3ce8e6b6b558cb9e16090d6137bce8cc4cd0 - Sigstore transparency entry: 1620425276
- Sigstore integration time:
-
Permalink:
MarcoPorcellato/matryca-plumber@202571639f01202f7ec3d38ce1de874807adfdc0 -
Branch / Tag:
refs/tags/v1.5.10 - Owner: https://github.com/MarcoPorcellato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@202571639f01202f7ec3d38ce1de874807adfdc0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file matryca_plumber-1.5.10-py3-none-any.whl.
File metadata
- Download URL: matryca_plumber-1.5.10-py3-none-any.whl
- Upload date:
- Size: 312.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cb3de8cc99114282a5bfe7c31af4b8f9acd446d3d8c655baf465f9a387d7b07
|
|
| MD5 |
02b9f649ab0a7120ce63783eb1d03e42
|
|
| BLAKE2b-256 |
42206b834e35ced58c5242cbb1ac2a3d7c031e48eee2504b91cef7e0401ec65e
|
Provenance
The following attestation bundles were made for matryca_plumber-1.5.10-py3-none-any.whl:
Publisher:
release.yml on MarcoPorcellato/matryca-plumber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matryca_plumber-1.5.10-py3-none-any.whl -
Subject digest:
2cb3de8cc99114282a5bfe7c31af4b8f9acd446d3d8c655baf465f9a387d7b07 - Sigstore transparency entry: 1620425434
- Sigstore integration time:
-
Permalink:
MarcoPorcellato/matryca-plumber@202571639f01202f7ec3d38ce1de874807adfdc0 -
Branch / Tag:
refs/tags/v1.5.10 - Owner: https://github.com/MarcoPorcellato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@202571639f01202f7ec3d38ce1de874807adfdc0 -
Trigger Event:
push
-
Statement type: