# Logseq Matryca Parser

A deterministic Python parser for Logseq graphs that preserves the outliner's parent-child hierarchy when exporting Markdown for retrieval-augmented generation, alongside an interactive visualizer and an append-only writer.

Logseq Matryca Parser reads a local Logseq graph of plain-text Markdown files and loads it as a typed abstract syntax tree and graph, rather than treating the outliner hierarchy as flat Markdown the way standard AI text chunkers do. Scanning a graph reports its pages, blocks, references and graph diagnostics without changing anything in the source vault, since parsing and scanning are read-only by design; any write to the source vault is a separate, explicit, opt-in and confined operation, while exporters write their derived output to a destination the caller chooses.

Its workflows include querying a loaded page or full vault as a typed graph, exporting LangChain documents and enriched chunks for retrieval-augmented generation, generating JSON, clean Markdown or an Obsidian vault from a Logseq graph, and rendering an interactive reference-topology visualization through a companion adapter. The project explicitly does not currently claim to read or replace graphs stored in the newer SQLite-based Logseq DB format, only the plain-Markdown graph format.

It is installed with uv pip install and licensed under Apache-2.0.

Website: https://github.com/MarcoPorcellato/logseq-matryca-parser
