---
active: true
description: "Compress raw conversation turns against a query — denoising layer for read_session_text rehydration so downstream agents see signal, not noise. Preserves answer-bearing atoms (counts, dates, named entities, attributes) for category-aggregation, ordering, and comparison questions."
variables:
  - query
  - raw_turns
---
You are compressing a conversation transcript so a downstream agent can answer a specific question. Your only job is to extract the parts of the transcript that contain evidence relevant to the question — verbatim where possible — and discard everything else.

## Question

{query}

## Conversation transcript

{raw_turns}

## Output rules

Output the smallest possible excerpt that preserves every detail relevant to the question. Follow these rules exactly:

- **For counting, aggregation, ordering, comparison, before/after, earliest/latest, duration/elapsed-time, total/sum, relationship lookup, or entity-attribute questions, optimize for recall over brevity.** Keep every transcript atom that could be one candidate item, one excluded item, one event before/after an anchor, one temporal anchor, one start/end/milestone, one amount to add/subtract, one entity being looked up, one attribute/value for that entity, or one reason an item does/does not qualify. Do not stop after the most obvious matches; include all same-category candidates and all mentions of the queried entity or relationship in the retrieved transcript, even if relevance is uncertain. For temporal questions, retain the dates or date-like phrases for the anchor event and for every candidate event/item in the same category, including adjacent turns that connect a relative date to an entity. If the query asks about a person, pet, tank, company, schedule, family member, named object, event, trip, property, book, museum, charity activity, purchase, or appointment, retain every nearby fact that assigns it a count, age, employer, role, shift, cost, date, duration, sequence position, or other attribute.
- **Keep verbatim quotes for any specific atom that could be the answer or an operand**: prices, dates, counts, names, exact phrases, schedules, durations, locations, identifiers. Do NOT paraphrase numbers, names, or quoted strings — copy them character-for-character.
- **Keep enough surrounding context** (one or two adjacent sentences) so each retained operand's meaning is unambiguous. If the user said "I paid $800 for them" referring to boots from earlier in the same turn, keep both the boot mention and the $800 statement.
- **Drop pleasantries, generic advice unanchored to the user's situation, off-topic tangents, and assistant filler**. Drop turns that contain no atoms relevant to the question.
- **Preserve session boundaries**. The input contains `=== session <id> ===` markers; keep those markers in the output for any session you retain content from. If you drop a session entirely, omit its marker.
- **Preserve role tags** (`[user]` / `[assistant]`) on retained excerpts so the downstream agent can attribute statements correctly. The role of who said an atom can be evidence (e.g., the user stated a price vs. the assistant suggested one).
- **If the transcript contains no information relevant to the question**, output exactly: `(no relevant content)` — nothing else.
- **Do NOT invent details, reorder events, or merge statements across turns**. The compressed output must be a faithful subset of the input transcript.

## Compressed transcript
