All projects

MacaroniGraph

Nov 2026 · Independent Project

A knowledge graph of my saved Instagram Reels. It transcribes and reads each Reel, links Reels by the concepts they share, and answers questions with citations. All AI processing runs locally on a Mac.

Stack
Python, FastAPI, MLX-Whisper, Qwen3, Chroma, Neo4j, React
Links
The MacaroniGraph workspace showing a graph of Reels and concepts, with a chat answer on the right citing numbered sources.

Why?

I save a lot of Reels and rarely find them again, because scrolling back through the saved folder doesn’t scale. I wanted to ask a question like “which Reels mentioned sliding-window problems?” and get an answer that points back to the exact clip.

What I Built

  • Capture. A Manifest V3 Chrome extension plays each saved Reel in my own logged-in browser and records the tab. A local FastAPI backend queues uploads and processes them one at a time. Jobs are tracked in SQLite with leases, retries and crash recovery.
  • Extraction. MLX-Whisper transcribes the audio and Tesseract reads on-screen text. The OCR clean-up groups caption lines and labels text that repeats the speech, but never deletes anything.
  • Search. Each Reel is split into caption, transcript and on-screen passages and embedded with Qwen3-Embedding-0.6B into Chroma.
  • Graph. A local Qwen3-4B model proposes concepts and relationships, and deterministic code verifies them. A concept is kept only if its surface form appears in the evidence passage, and a relationship needs a verbatim quote naming both concepts. Matching is identifier-aware, so C ≠ C++.
  • Answers. Hybrid retrieval fuses vector search with graph neighbors that pass a relevance gate. Every sentence in an answer must cite a source, and sentences whose quotes aren’t verbatim are removed. When Neo4j is down, retrieval falls back to vector search and says so.
  • Workspace. A React + Cytoscape interface lets me explore the graph and click any citation to jump to its passage.

SQLite is the single source of truth. Chroma and Neo4j are derived indexes that can be deleted and rebuilt at any time.

Results

These were measured on my own saved Reels, and I judged the answers myself, so the numbers aren’t independent or reproducible from the repo.

  • Retrieval. Hybrid retrieval reaches Recall@5 of 0.977, against 0.833 for vector search alone.
  • Answers. 75.5% were fully correct on a 53-turn held-out set that was sealed before any answers were generated, up from 60.4% for the previous configuration. Every citation was valid, and 7.8% of answer sentences were unsupported.
  • Latency. The median warm answer takes 5.2 s on an Apple Silicon Mac.
  • Not shipped. A larger 8B answer model was no more accurate and was 1.3–2.5× slower.

Limitations

About one answer in four is incomplete or wrong. Capture runs in real time and needs macOS on Apple Silicon. The extension uses Instagram in an automated way, which Instagram’s terms prohibit, even though it only visits my own saved items.