Launching today

docs-to-rag
Turn a docs site into RAG-ready Markdown chunks
1 follower
Turn a docs site into RAG-ready Markdown chunks
1 follower
Most RAG tutorials start with "load your documents", but real docs are HTML sites full of menus, banners and duplicate URLs. docs-to-rag is three small Python scripts: crawl a docs section politely (robots.txt, sitemaps, duplicates skipped), split the clean Markdown at headings but never inside code blocks, and load the chunks into a local Chroma store. Every chunk keeps its URL for citations. MIT, about 500 lines, no framework.



Free
Launch Team

TinesThe single, secure environment for agents, apps, and automations.
Promoted
Hi everyone!
I built docs-to-rag because every RAG tutorial starts with "load your documents", and my documents were always a docs site: hundreds of HTML pages with navigation, cookie banners, footers and the same page under three URLs. Embedding that as is costs money and makes retrieval worse.
So it's three small scripts you can read in one sitting:
• crawl.py stays inside one docs section, follows robots.txt and sitemaps, skips duplicate pages and keeps only the main content as Markdown.
• chunk.py splits at headings, but never inside fenced code blocks. To a plain regex, a "# comment" line in a Python example looks like a heading, and that's how code examples get cut in half (see the third image).
• index_chroma.py loads the chunks into a local Chroma store. Every chunk keeps its URL, so answers can cite the page.
It's for anyone building an "ask our docs" assistant who wants to see and own every step instead of adding a framework.
One thing I didn't expect: trafilatura sometimes puts a code fence in the middle of a sentence when inline code contains a line break. There's a small fix for that in crawl.py.
docs-to-rag is free and MIT. If you'd rather not run a crawler yourself, the same crawl is also a hosted Apify actor and an API on RapidAPI. Those are mine too, paid, with free tiers.
I wrote it with a lot of help from an AI coding assistant and tested it on real docs sites.
What docs site would you try it on first? Pages that render their text with JavaScript come out empty for now, and I'd like to know how many of you would need that.