Home / Blog / Generative AI & RAG

    Chunking Strategies for RAG: How to Split Documents for Better Answers

    By Softworth Solutions · · 4 min read · For readers in UK, US, India

    Professional reviewing documents and contracts

    In short: The best chunking strategy for RAG keeps each chunk to one idea while carrying enough context to answer from it. For most business documents, split on headings first, keep chunks around 300 to 800 tokens with light overlap, and attach the title and section path to every chunk.

    When a RAG assistant gives a half-right answer, people usually blame the model. In our experience the culprit is more often the chunking. It is one of the cheapest things to fix and one of the most neglected.

    What is chunking, and why does it matter?

    Chunking is the step where documents are split into smaller pieces before they are embedded and stored for retrieval. At question time the system fetches the most similar chunks and hands them to the model, which can only answer from what it receives.

    Chunks that are too small lose context: 'the limit is 30 days' is useless without knowing which policy it belongs to. Chunks that are too large blur several topics into one vector, match many queries weakly and waste your context window. Get the balance right and accuracy, latency and cost all improve together.

    Which chunking strategy should you use?

    Start with structure-aware chunking for anything with headings, and reach for the others when your content demands it.

    Chunking strategies compared
    StrategyHow it worksUse it for
    Fixed-sizeSplit every N tokens with overlapTranscripts, uniform prose
    RecursiveSplit by paragraph, then sentence, to a target sizeA sensible general default
    Structure-awareSplit on headings, sections or clausesPolicies, manuals, contracts
    SemanticBreak where meaning shifts between sentencesLong unstructured text
    Parent-childMatch small chunks, return the parent sectionTechnical and legal content

    Parent-child retrieval deserves a special mention. You get the sharp matching of small chunks and the rich context of the full section, which is often exactly what dense documents need.

    What chunk size and overlap should you start with?

    Start with 200 to 400 tokens for FAQs and short policies, and 500 to 1,000 tokens for manuals, reports and contracts. Overlap of 10 to 15 percent helps when ideas cross boundaries, though clean structural splits need little.

    Check your embedding model's input limit too. Many models silently truncate longer inputs, so the end of an oversized chunk never makes it into the vector at all.

    How do you handle tables, PDFs and messy files?

    Fix parsing before you tune chunking. Use a layout-aware PDF parser or OCR, strip repeated headers and page numbers, and convert everything to a clean format such as Markdown that keeps headings and lists intact.

    • Keep each table together and repeat column headers so a single row still makes sense.
    • Send large spreadsheets down a structured query path instead of embedding thousands of rows.
    • Keep numbered steps with the sentence that introduces them.
    • Give images a generated caption and link back to the source page.

    Then add context to every chunk. Prepend the document title, section path and version date before embedding. Some teams go further and have a model write a one-line note on where the chunk sits. It costs a little at indexing time and usually pays back in retrieval quality. Store metadata like department, region and access permissions too, so you can filter by policy version or country and enforce who sees what.

    An illustrative policy assistant

    Consider a UK housing association whose HR assistant keeps quoting the wrong leave policy. Its documents were split every 500 characters, so a sentence about notice periods landed in a chunk with no heading, and three policy versions sat side by side with no dates. The team re-chunks by section, prepends title and effective date to each chunk, filters to the current version, and tests against 60 real staff questions. Wrong-policy answers become rare, and the remaining errors are easy to trace.

    Hands typing on a keyboard at a clean desk

    How do you know your chunking works?

    Build an evaluation set of 50 to 100 real questions, each with its known answer and source passage. For every variant, check whether the right passage lands in the top three to five results, then score the final answers. Change one variable at a time. A few days of this beats weeks of guessing.

    Key facts

    • The term retrieval-augmented generation was introduced in a 2020 research paper by Lewis and colleagues at Facebook AI Research. (arXiv)
    • Anthropic reported in September 2024 that adding chunk-specific context before embedding, combined with BM25 keyword search, reduced failed retrievals by 49 percent in its tests. (Anthropic)
    • pgvector is an open-source PostgreSQL extension that adds vector similarity search to a standard Postgres database. (pgvector on GitHub)

    Chunking will not fix everything; your choice of vector database, hybrid search and prompts matter too. If your assistant underperforms, SWS AI can audit your ingestion pipeline and run a structured evaluation. Our team in Coimbatore works with clients in the UK, US and India, so get in touch or browse our AI services.

    Key takeaways

    • Split on document structure first, size second.
    • Prepend title, section and date to every chunk.
    • Fix PDF and table parsing before tuning chunk size.
    • Test with 50 to 100 real questions and change one variable at a time.

    Frequently asked questions

    What is a good default chunk size for RAG?

    Around 400 to 800 tokens with 10 to 15 percent overlap suits most business documents. Treat it as a starting hypothesis and confirm it with an evaluation set.

    Do long context windows make chunking unnecessary?

    Not for production. Sending whole document sets with every query is slow and costly, and models can miss details in very long inputs. Good retrieval keeps answers focused and affordable.

    Does chunking affect data protection obligations in the UK or India?

    Indirectly. Chunks containing personal data are still personal data under UK GDPR and India's DPDP Act, so carry access permissions in metadata and delete chunks when source records are deleted.


    Planning an AI or software project? Talk to our team for a free consultation and an honest estimate.

    Previous: AI in Manufacturing: Quality Inspection, Predictive Maintenance and More
    Next: Cutting Your Cloud Bill: 12 Cost Optimisation Tactics That Work

    Keep reading