From c4b5889e535027f4804a91dd263276930d768ac9 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Sun, 24 May 2026 11:10:13 +0400 Subject: [PATCH] Studio: layout-aware RAG parsers + heading-aware chunking (Phase 3A) Replace bare-pypdf/python-docx/BeautifulSoup extraction with Markdown- preserving parsers so the chunker can split on real heading boundaries instead of running paragraphs together. Parsers - pdf.py: pymupdf + pymupdf4llm.to_markdown() per page; pypdf kept as fallback when pymupdf can't open the file. - docx.py: mammoth.convert_to_html() + markdownify, with an explicit style_map so Title/Heading 1..6 become h1..h6 in the output. - html.py: BeautifulSoup pre-scrub (drop script/style) then markdownify so , ,
/