RAG Semantic Markdown Chunker & Vector JSONL Exporter

Split converted Markdown documents along # / ## / ### heading boundaries and BPE token budgets while preserving fenced code blocks and attaching parent section titles to every vector chunk.

Heading-Aware RAG Token Splitter
Total chunks
3
Avg chunk size
48 tok
Largest chunk
64 tok
Fence protection
Active
Convert document first

Best Practices for Chunking Markdown in Production RAG Systems

Once your PDF, Word, or HTML documents are converted into Markdown, how you segment them determines retrieval precision:

  1. Split on Structural Headings First (#, ##, ###): Headings represent author-defined topic boundaries. Never merge unrelated sections into a single embedding vector.
  2. Never Slice Inside Fenced Code Blocks (```): Our parser tracks fence state so code examples and tables remain atomic within their parent chunk.
  3. Preserve Section Context in JSONL Metadata: Exporting as JSONL attaches the heading field to every chunk object so your retrieval prompt always knows which section a paragraph came from.