Showcase: I built a deterministic AST Parser for Logseq (Perfect local RAG + a 60FPS Interactive Visualizer) 🌌

Hi Logseq community!

Like many of you, I love using Logseq as my sovereign Second Brain. But recently, I hit a massive wall when trying to build local AI/RAG tools on top of my notes. Standard Markdown chunkers (like the ones in LangChain) just cut text blindly. They completely destroy Logseq’s outliner structure, losing the parent-child context of the bullet points.

I wanted an engine that respects our thought hierarchy, so I built the Logseq Matryca Parser (The Logos Protocol).

:movie_camera: 1. The 60FPS Visualizer (LENS)

First, because visualizing the graph is vital, I built a highly optimized NetworkX/PyVis pipeline. It easily handles 7,000+ nodes smoothly. I also injected a custom Glassmorphism HUD to instantly toggle Daily Journals and Tags. Watch the 15-second demo of the graph exploding and the filters in action: > :backhand_index_pointing_right: https://github.com/user-attachments/assets/24f73c6d-3eca-4adb-8442-981f2ba4cccd

:brain: 2. AI & RAG Ready (SYNAPSE)

The core of the tool is a deterministic Stack-Machine parser written in Python.

  • It reads your graph and understands spatial indentation, block references ((uuid)), properties, and temporal journals.

  • It exports directly into LangChain Document or LlamaIndex TextNode formats.

  • The Magic: It injects the hierarchical relationships directly into the metadata. When you feed this to your local LLM, it finally understands the context of a nested bullet point!

:shield: 3. Sovereign & Local

Everything runs OFFLINE. Zero telemetry, zero cloud parsing.

Links:

The codebase is fully open-source, strictly typed with mypy, and well-tested. I built it to scratch my own itch, but I’m releasing it today because I think this community needs a robust way to bridge Logseq and local AI.

Let me know what you think! PRs and feedback are highly welcome.

Nice!
A much better display of my graph than either the native LogSeq graph display or Obsidian.

1 Like

Thank you! Glad you like it!
The most important part is that my parser don’t break your text exporting it, exporting JSON ready to be ingest to AI that finally understand the relations of all the blocks, vertically (parent-child) and horizontally (links, tags, etc…).

UPDATE: Wow, thanks for the incredible support! I’m glad to see I’m not the only one tired of “Blender RAG” destroying our outliner hierarchy.

I’ve just pushed a massive documentation and architecture update:

  1. The LLM OS Vision: I’ve added a comprehensive ARCHITECTURE.md explaining the “Logos Protocol” and how it acts as a deterministic File System Driver for your AI. It includes full C4 and Sequence diagrams. [LINK AL TUO ARCHITECTURE.md]

  2. The Moat: Check the new comparison table in the README showing exactly why AST-based parsing is the only way to avoid hallucinations in outliner-based RAG.

:ballot_box_with_ballot: HELP ME PRIORITIZE: I want to build what you actually need. Which direction should I focus on next? > Reply to this comment with a number:

1. Standalone Desktop App: A click-and-run GUI for non-technical users (no terminal needed).

2. Native Obsidian Adapter: Full support for exporting Obsidian vaults with preserved topology.

3. Direct Local AI (Ollama) Integration: A one-click bridge to feed your notes into local models out of the box.

Let me know your pick! :trident_emblem:

Repo GitHub: https://github.com/MarcoPorcellato/logseq-matryca-parser