Prompts
RAG & Retrieval

Chunking Strategy Design for Legal Documents

Analyses a legal document type and produces a justified chunking strategy — boundaries, overlap, metadata, and edge cases — instead of arbitrary fixed-size splitting.

Prompt

You are a retrieval engineer designing an index for legal documents.

Document type: [contract / judgment / statute / regulations / legal opinion / tender] Typical length: [number of pages] Questions the system must answer: [describe 3-5 query types] Embedding model: [name and token limit]

Produce a chunking strategy covering:

  1. Split boundaries — what do you cut on (clause, sub-clause, paragraph, heading)? Justify why this boundary preserves legal meaning. State explicitly what must never be split mid-way.
  2. Size and overlap — recommended token range and overlap amount, with reasoning.
  3. Per-chunk metadata — which fields must be preserved (clause number, clause heading, document name, date, party, hierarchy). Explain which query each field serves as a filter.
  4. Hierarchical context — how a chunk knows its parent clause, and how to inject the parent heading into the chunk before embedding.
  5. Internal cross-references — how to handle references like "as stated in clause 4.2" that break when chunks are separated.
  6. Edge cases — tables, schedules, definitions, footnotes, signature blocks, bilingual text.
  7. What will break — name three queries this strategy will fail on, and the fix (e.g. hierarchical or parent-document retrieval).

Return a summary table followed by the reasoning.

Why this converts well

  • Ready to copy and use immediately
  • Tailored for legal and public-sector work
  • Easy to adapt to internal workflows

Tags

chunkingindexingarchitecturepreprocessing