Parse LLM Markdown streams incrementally on the server or client
Incremental AST parsing beats full re-renders for long LLM markdown streams.
End documentation drift for good with Gendox, an AI powered tool that manages your source code docs for you.
Content hashing for incremental AI doc builds saves real API credits.
C++ developers, teams struggling with outdated documentation
Mintlify · Swimm · Cursor
I’m a solo dev who got tired of the "documentation hell", either spending hours writing docs that immediately become outdated, or having no docs at all. I wanted a tool that treats documentation generation as a standard build step, so I built Docgen.
Docgen is a lightweight AI CLI tool written in C++ that automates docs-as-code. It sits in your repo (via a .docgen folder and a Docfile) and generates Markdown files next to your source.
A few technical details on how it works under the hood:
- Local-First & Private: It defaults to using Ollama locally so your proprietary code never leaves your machine (though it supports cloud APIs like OpenAI/Gemini if you prefer).
- Smart Incremental Builds: It uses content hashing. When you run docgen update, it only regenerates docs for files that actually changed, saving massive amounts of API credits and compute time.
- Context-Aware (RAG): It automatically analyzes #include dependencies to give the LLM the right context, rather than just blind-feeding it a single file.
- Zero Dependencies: Compiled as a single static binary. Just download and run.
- The "Auto" Mode: This is my favorite part. If you run "docgen auto", it acts as a file watcher with a built-in debounce (waits a few seconds after you stop typing/saving). It quietly updates your Markdown docs in the background while you stay in your flow state.
I’m currently focused on improving the RAG context handling.
You can check it out here: https://github.com/alonsovm44/docgen
I'd love to hear your thoughts, critique on the architecture, or any edge cases you think I should handle!
Incremental AST parsing beats full re-renders for long LLM markdown streams.
Headless docs separation when Quartz and Obsidian bundle everything together.
Unverified LLM attempt at open math problem without expert validation.
Event-stream parsing beats regex for streaming LLM tokens in real time.
Compiles documents at ingest time inside Postgres instead of querying via RAG.
Two-phase pipeline eliminates order-dependence before writing any wiki pages.