QuestionQ7

VerifiedContext Compression and Compaction

A context engineer is developing a Databricks agent for a financial research platform that answers analyst queries using a vector search index over earnings reports. The agent uses a 180-token system prompt, a 250-token conversation history window, and a RAG pipeline that retrieves 8 document chunks at runtime. Each chunk contains 550 tokens, contributing 4,400 tokens of retrieved context. The model’s context window is 8,192 tokens, leaving just 3,362 tokens for the analyst query and model response. Profiling shows that the retrieved chunks consistently contain repetitive regulatory boilerplate and duplicated table headers that are rarely cited in the model’s final answers.

Which two changes should the context engineer make to reduce the token footprint of retrieved context without discarding relevant financial content?

Choose two
Explanation

Reranking an initial candidate set and passing the three most relevant 550-token chunks to the model reduces retrieved context from 4,400 to 1,650 tokens, a 62.5% reduction. Smaller, semantically coherent chunks and removal of repeated boilerplate and duplicate headers further reduce irrelevant text while retaining financial information. Necessary table headings and context should be preserved, and recall should be evaluated because a three-chunk limit can omit relevant material. (docs.databricks.com)

Learn more

Community Discussion

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