RAGFlow Chunking Methods for Document Parser Selection
Swarnava Dutta8 min read
Ragflow Chunking MethodsRagflow Document ParsingRagflow Parser Selection
Contents

You swap RAGFlow's default parser for the "Book" template, re-ingest your PDFs, and watch retrieval scores drop. The chunks look cleaner, but answers got worse. Your retriever needed table rows and surrounding context intact, and the new parser split them apart. Choosing the right ragflow chunking methods starts with what your retriever needs to find, not what produces the tidiest output.
Quick answer
General, Paper, Table, Laws, and other RAGFlow parser templates each preserve different document structures. Select the parser matching your source format, set chunk size based on evidence-span length your queries target, then run retrieval hit-rate and answer-correctness checks against a held-out question set before reindexing production data.
RAGFlow chunking methods: parsers, templates, and boundaries
RAGFlow's ingestion pipeline runs stages in sequence: file extraction pulls raw content, layout recognition detects headings and table regions, then a parser template applies boundary rules deciding where chunks split. Optional enrichment - keyword extraction, auto-generated Q&A pairs - runs after chunking but before embedding.
Parser labels and controls shift between RAGFlow releases, so confirm the options your installed version exposes before following any walkthrough.
RAGFlow's structure-aware parsers preserve semantic boundaries - section breaks, paragraph endings, table extents - rather than splitting at fixed token intervals. That distinction controls whether a retrieved passage includes enough context for the LLM to answer correctly. For a broader comparison of splitting strategies, see chunking strategies for RAG.
The principal method families: General (mixed-layout docs), Paper (academic), Table (spreadsheets/CSVs), Q&A (pre-structured pairs), Manual/Laws/Book (format-specific templates), One (no splitting), and Knowledge Graph (entity-relation extraction).
Three components handle three different jobs. OCR recognizes text from images. The parser groups text into chunks. The embedding model represents chunks as vectors. Swapping embeddings cannot fix scrambled table cells or detached headings - those are parser-stage failures. Before tuning retrieval or adding rerankers, open RAGFlow's chunk preview and verify table rows stay intact, reading order matches the original, and headings attach to their content.
Choose a RAGFlow parser by document type and retrieval goal
General covers most mixed-layout files. Switch to a specialized parser only when General demonstrably mishandles a document's structure in the chunk preview.
| General | Q&A | Table | Paper / Book | Manual / Laws | Presentation | One | Knowledge Graph | |
|---|---|---|---|---|---|---|---|---|
| Ideal inputs | Mixed-layout PDFs, DOCX | FAQ exports | Spreadsheets, CSV | Academic papers, books | SOPs, regulations | Slide decks | Short memos | Entity-dense corpora |
| Preserved structure | Paragraphs, headings | Q-A pairs | Rows with headers | Sections, abstracts | Numbered clauses | Slide boundaries | Entire document | Entity-relation triples |
| Chunk granularity | Paragraph-level | One pair | Row or row-group | Section-level | Clause-level | Per-slide | Single chunk | Triple or subgraph |
| Retrieval behavior | Broad evidence spans | Exact Q→A | Row-level lookup | Section-scoped | Clause-precise | Slide-scoped | Full-doc return | Relationship traversal |
| Common failure mode | Tables split mid-row | Free-text ignored | Prose context lost | Misdetected sections | Nested numbering collapsed | Speaker notes dropped | Exceeds token limits | Noisy triples |
Use One only when the document fits within your model's context window and must stay atomic. Knowledge Graph extraction earns its overhead when queries ask about entity relationships; for passage retrieval it adds complexity without payoff [1].
File extension alone is a poor predictor. A .pdf can contain a scanned table, a two-column paper, or a slide export. Ingest five to ten representative files, inspect the chunk preview, and verify structure before committing to a full reindex.
RAGFlow document parsing for PDFs, tables, and structured files
Layout-aware parsing must preserve relationships a human reader takes for granted. When the parser mishandles these, the retriever returns chunks missing the heading or caption that specifies what the data refers to.
Before ingesting a batch, check each file for selectable text versus image-only content, repeated headers/footers that will pollute chunks, merged table cells that flatten structure, and inconsistent page layouts. When multiple checks fail, source normalization - converting a problematic PDF, cleaning merged cells - is safer than pushing the parser harder.

Keep tables and surrounding evidence retrievable
Small tables should stay whole inside a single chunk. Large tables force a tradeoff: one oversized chunk may exceed token limits, but splitting rows loses column headers. RAGFlow's Table parser propagates headers to split row-groups - verify this in chunk preview by checking every row-group chunk still contains column names and units.
Test with two query types: one asking for an exact cell value and one requiring interpretation from the table plus adjacent prose. If the second type fails, the parser isolates the table from surrounding paragraphs. Retain source filename and page-number metadata so retrieved rows trace back to the original document.
Configure RAGFlow chunk size, delimiters, and parser settings
Start with ten representative files. Select a parser, set boundary controls, parse, inspect chunks, then run retrieval tests. Adjust one parameter per run and log the parser version, settings, and retrieval scores together.
Longer chunks carry more context but dilute retrieval precision. They also inflate your vector index and consume more of the generation prompt window. Shorter chunks retrieve precisely but risk stripping qualifiers.
Enable heading-aware boundaries so headings stay attached to body text. Check whether your installed RAGFlow version exposes an overlap control for your selected parser - many template combinations do not. If unavailable, duplicate boundary sentences across split points in preprocessing.
Set chunk size from evidence length, not a universal rule
Estimate the typical evidence span your queries need. Two-sentence answers warrant 128-256 tokens. Multi-paragraph procedures warrant 512-768 tokens.
Warning signs of undersized chunks: orphaned headings, qualifiers like "except when" landing in a different chunk than the rule they modify. Warning signs of oversized chunks: top-k results return broad passages where only one sentence is relevant. Your embedding model's max input and generation context window set bounds, but the right size is the smallest span that consistently contains complete evidence.
Diagnose chunking failure modes before changing settings
Trace every bad answer through four stages: source document → parsed chunk → retrieved result → generated answer.
- Evidence absent from the index - the parser dropped or mangled the passage. Fix: change parser or normalize the source.
- Evidence present but poorly chunked - the passage exists but is split so neither fragment answers the question. Fix: adjust chunk size or delimiters.
- Evidence indexed but not retrieved - a semantically similar prose chunk outranks the correct table row. Fix: tune hybrid search weights or add reranking.
- Evidence retrieved but ignored by generation - the right chunk appears in context but the LLM disregards it. Fix: reorder chunks, reduce total context, or revise the system prompt.
Missing text or garbled characters point to the source file or OCR layer. Scrambled reading order points to layout analysis. Duplicate headers polluting chunks need preprocessing. Broken tables need the Table parser or source normalization. Before re-embedding an entire dataset, open RAGFlow's chunk preview for the failing documents and check source coordinates against the original.

Evaluate RAGFlow chunks with retrieval and answer metrics
Build an evaluation set covering factual lookups, table queries, cross-page reasoning, and hard negatives. Record exact supporting passages so retrieval scores independently from generation.
Measure retrieval with hit rate at k, precision at k, and mean reciprocal rank. Measure generation with answer correctness, faithfulness, and citation validity. When recall rises but faithfulness drops, the retriever returns more candidates while the LLM generates from noisy context - those two metrics must move together. For evaluation framework ideas, see how to evaluate multi-agent systems.
Compare parser variants on identical files, queries, embedding model, and retrieval mode. Store chunk-level outputs and retrieval traces so you can inspect regressions in high-value query classes - table lookups, compliance clauses - even when aggregate metrics improve. Set acceptance thresholds before experimenting, including guardrails on parse time, index size, and token usage.
Roll out chunking changes without breaking the knowledge base
Changing a parser or chunk-size parameter invalidates existing chunks. RAGFlow requires re-parsing and re-embedding every affected document. Create a shadow index with the new configuration, run your evaluation queries against both indexes, and swap production traffic only when the shadow meets thresholds across every document type.
During migration, verify:
- Source IDs remain stable for citations and deletion logic.
- Metadata filters carry over without silent drops.
- Duplicate handling doesn't create ghost chunks.
- Citation links resolve to valid chunk IDs post-reindex.
After deployment, monitor retrieval quality by file type and query class. Revisit configuration when a new document family enters the corpus, RAGFlow ships a parser upgrade, you swap embedding models, or a specific query class shows recurring retrieval misses.
FAQ
Which RAGFlow chunking method should you use for each document type?
General handles mixed-layout PDFs and DOCX. Table for spreadsheets and CSVs, Paper for academic documents, Q&A for structured FAQ pairs, Manual or Laws for regulatory text, Presentation for slides. Use One only for short documents fitting entirely within your model's context window.
How do you configure RAGFlow chunking methods?
Select a parser template in dataset settings, adjust chunk size and delimiter rules, then change one parameter per run. Inspect chunks in RAGFlow's preview and run retrieval tests before reindexing your full corpus. Available controls vary by parser and RAGFlow version.
How should you test whether RAGFlow's chunks improve retrieval quality?
Build a held-out question set with ground-truth passages. Measure retrieval hit rate, precision at k, and mean reciprocal rank alongside answer correctness and faithfulness. Compare a single-variable challenger against your baseline using identical embedding and retrieval settings.
When should you change chunk size, overlap, or parser settings?
Change settings when orphaned headings or split table rows appear in chunk previews, a query class shows recurring retrieval misses, a new document family enters the corpus, or you swap embedding models.
How do RAGFlow chunking methods handle tables, PDFs, and structured documents?
The Table parser groups rows with propagated column headers. General splits on paragraphs and headings but can break tables mid-row. Scanned PDFs depend on OCR quality before any parser runs. For complex layouts with merged cells, normalize the source before ingestion rather than relying on parser tuning.
References
- AI Agent-Driven Framework for Automated Product Knowledge Graph Construction in E-Commerce - Dimitar Peshevski, Riste Stojanov, Dimitar Trajanov (2025)


