QuestionQ37

VerifiedContext Compression and Compaction

A context engineer is debugging a long-running data pipeline orchestration agent that runs multi-step workflows using registered Databricks tools such as run_job, query_catalog, and validate_schema. After compaction occurs at turn 40, the agent starts re-invoking tools it successfully called earlier in the session and ignores results that downstream steps depend on. Inspection of the compacted context shows that the summarization prompt was instructed to retain only the final state of each pipeline stage. The current compaction prompt reads: “Summarize the current pipeline state in a few sentences and include only what is necessary.”

Which revision to the compaction prompt addresses the coherence failure while keeping token cost low?

Explanation

A compact record of each tool call, its key arguments, and its result preserves evidence of completed actions and the results needed by downstream steps. It avoids the token cost of retaining every input and response field. Compaction should preserve critical context while discarding redundant detail. (anthropic.com)

Learn more

Community Discussion

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