Skip to content

Chunking Decision Record: ${CORPUS_NAME}

  • Project: ${PROJECT_NAME}
  • Document Corpus: ${CORPUS_NAME}
  • Author: ${AUTHOR_NAME}
  • RAG Lead / Reviewer: ${REVIEWER_NAME}
  • Date: YYYY-MM-DD
  • Status: Proposed | Evaluated | Accepted | Superseded
  • Related Playbooks: PB-RAG-01-01, PB-RAG-01-02, PB-RAG-01-03

1. Context and Problem Statement

Define the corpus characteristics, query patterns, and accuracy goals.

  • Corpus description: ${CORPUS_SUMMARY} (e.g. ${DOCUMENT_COUNT} engineering manuals, ${FILE_FORMAT} format, average ${AVG_PAGES} pages per document).
  • Primary failure mode to address: ${PRIMARY_FAILURE_MODE} (e.g. In current fixed-size chunking, ${FAILURE_RATE_PCT}% of retrieval queries return chunks that cut off multi-step procedures or break markdown tables).
  • Embedding model: ${EMBEDDING_MODEL} (e.g. text-embedding-3-large, default 3072 dimensions, maximum context 8191 tokens; specify ${EMBEDDING_DIMENSIONS}).
  • Target retrieval latency budget: ${LATENCY_TARGET_P95}.

2. Document Archetype Inventory

Classify the corpus into archetypes before benchmarking:

Archetype Document types / extensions Document count Key structural traits
structured_manual PDF, DOCX (SOPs, guides) ${MANUAL_DOC_COUNT} Hierarchical headings (H1–H4), ordered lists, callout boxes
tables_and_forms PDF (financial reports, specs) ${TABLE_DOC_COUNT} Multi-column HTML tables, key-value parameter sheets
long_prose PDF, TXT (policy narratives, whitepapers) ${PROSE_DOC_COUNT} Unstructured prose paragraphs without standard headings
short_records JSON, CSV (support FAQs, product cards) ${RECORD_DOC_COUNT} Independent records under 1,000 characters each

3. Candidate Profiles Evaluated

Record the candidate chunking configurations benchmarked in the sandbox:

version: 1
embedding_model: ${EMBEDDING_MODEL}
candidates:
  candidate_a_fixed_512:
    strategy: recursive
    chunk_size: 2000
    chunk_overlap: 500
    header_levels: 0
    prefix_heading: false
  candidate_b_markdown_headers:
    strategy: markdown_headers
    chunk_size: 2000
    chunk_overlap: 500
    header_levels: 3
    prefix_heading: true
  candidate_c_table_aware:
    strategy: markdown_headers
    keep_tables_whole: true
    chunk_size: 4000
    chunk_overlap: 0
    header_levels: 3
    prefix_heading: true

4. Benchmark Results on Golden Query Set

Run evaluation across a representative sample of ${SAMPLE_DOC_COUNT} documents and ${GOLDEN_QUERY_COUNT} labelled queries.

Candidate Profile Archetype Tested Recall@5 Recall@10 nDCG@10 Chunk Cut Rate (%) Median Tokens Total Chunks
Candidate A (Fixed 2000/500) structured_manual ${CAND_A_MAN_R5} ${CAND_A_MAN_R10} ${CAND_A_MAN_NDCG} ${CAND_A_MAN_CUT_PCT}% ${CAND_A_MAN_MED_TOK} ${CAND_A_MAN_CHUNKS}
Candidate B (Markdown H1-H3) structured_manual ${CAND_B_MAN_R5} ${CAND_B_MAN_R10} ${CAND_B_MAN_NDCG} ${CAND_B_MAN_CUT_PCT}% ${CAND_B_MAN_MED_TOK} ${CAND_B_MAN_CHUNKS}
Candidate A (Fixed 2000/500) tables_and_forms ${CAND_A_TBL_R5} ${CAND_A_TBL_R10} ${CAND_A_TBL_NDCG} ${CAND_A_TBL_CUT_PCT}% ${CAND_A_TBL_MED_TOK} ${CAND_A_TBL_CHUNKS}
Candidate C (Table-aware) tables_and_forms ${CAND_C_TBL_R5} ${CAND_C_TBL_R10} ${CAND_C_TBL_NDCG} ${CAND_C_TBL_CUT_PCT}% ${CAND_C_TBL_MED_TOK} ${CAND_C_TBL_CHUNKS}

5. Decision and Selected Profiles

Record the final chosen profiles and the operational rationale.

5.1 Profile Assignment

Archetype Chosen Profile Chunk Size / Overlap Extraction Method
structured_manual structured_manual 2,000 chars / 500 overlap Azure Document Intelligence prebuilt-layout
tables_and_forms tables_and_forms 4,000 chars / 0 overlap Azure Document Intelligence prebuilt-layout (keep tables whole)
long_prose long_prose 2,000 chars / 500 overlap Azure Document Intelligence prebuilt-layout
short_records short_records 1,000 chars / 0 overlap Direct JSON/CSV ingestion (1 chunk per record)

5.2 Rationale

  • Heading preservation: Splitting by Markdown headings (#, ##, ###) and prefixing the heading breadcrumb improved Recall@10 from ${BASELINE_RECALL_10} to ${CHOSEN_RECALL_10} on manuals.
  • Table integrity: Protecting table blocks prevented financial tables from splitting across rows, reducing retrieval hallucination on numerical queries from ${BASELINE_HALLUCINATION_PCT}% to ${CHOSEN_HALLUCINATION_PCT}%.
  • Cost and storage: Heading-aware chunking generated ${CHUNK_REDUCTION_PCT}% fewer total chunks than fixed-size chunking with 25% overlap, reducing embedding API cost and vector storage.

6. Implementation and Rollback Plan

  • Ingestion pipeline: Implement profile in profile.yaml using the reference chunker in PB-RAG-01-02.
  • Deployment & Cutover: Re-indexing a live index requires creating a side-by-side index and repointing the index alias without downtime, as detailed in PB-RAG-01-03.
  • Rollback: In the event of an unpredicted regression in production, repoint the index alias back to ${PREVIOUS_INDEX} in Azure AI Search within seconds.

7. Sign-off and Approvals

Role Name Decision Date
Author / GenAI Engineer ${AUTHOR_NAME} Approved YYYY-MM-DD
Reviewer / RAG Lead ${REVIEWER_NAME} Approved YYYY-MM-DD
Solution Architect ${ARCHITECT_NAME} Approved YYYY-MM-DD