QuestionQ15

VerifiedContext Compression and Compaction

A context engineer is building a retrieval-augmented generation agent on Databricks to answer questions about a large collection of legal contracts. Each contract is a structured PDF averaging 40 pages, with clearly defined sections such as “Definitions,” “Obligations,” and “Termination Clauses.” The embedding model in use has a 512-token context window. User queries are highly targeted, such as “What are the termination conditions in the indemnification clause?”, and require precise, clause-level retrieval rather than broad document summaries.

Which chunking strategy should the context engineer use?

Explanation

Splitting at section boundaries preserves the contracts’ meaningful structure, while subdividing sections above 400 tokens produces more focused chunks for clause-level retrieval and leaves room within the embedding model’s 512-token limit. Paragraph-only chunking does not guarantee that each chunk fits the limit; fixed-size chunking can split related provisions across boundaries. (docs.databricks.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!