Transcripts · Updated 2026-11-20
How to send a long call transcript to an LLM without summarizing it first
An hour-long sales, support or meeting recording turns into a transcript that is too long for one prompt, and summarizing it first rewrites the exact words you wanted to quote. Clean it to one turn per line, split it into segments, and keep only the turns that answer your question, so the model reads what was actually said.
Why does a call transcript overflow the context window?
Long calls make long transcripts. Caption files wrap every turn in timing lines, cue ids and markup. Much of a call is greetings, scheduling, filler and repetition. The usual fix is to chunk the transcript and summarize each part, then summarize the summaries, which rewrites the words. Twilio notes that summarizers "tend to lose specifics like order numbers and dates unless you instruct them to keep identifiers intact." When you need what the customer actually said about price, a deadline or a commitment, that is the part you cannot afford to lose.
How should I prepare the transcript first?
Put one speaker turn on one line, with its start time and speaker name on the same line, for example [00:12:31] Dana: We can renew if the March invoice is fixed. Drop the WEBVTT header, NOTE and STYLE blocks, cue identifiers and markup tags. Decode character references such as & back to plain text. SuperCompress keeps whole lines, so a turn split across several lines can be separated from its speaker or its time. Keep each line short too: split a long monologue into several lines that each repeat the same timestamp and speaker, and give each speaker in a shared cue their own line. In the WebVTT format, voice tags like <v Name> carry the speaker. SRT files work the same way, with a comma before the milliseconds.
How do I compress a transcript with the SuperCompress API?
curl -X POST https://www.supercompress.dev/api/v1/compress \
-H "X-API-Key: $SUPERCOMPRESS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"context": "<one turn per line>", "query": "What did the customer say about renewal, and who owns the next step?"}'
import html
import os
import re
import requests
API_URL = "https://www.supercompress.dev/api/v1/compress"
TRANSCRIPT_PATH = "call.vtt" # a WebVTT or SRT transcript
QUESTION = "What did the customer say about renewal, and who owns the next step?"
MAX_CHARS = 120000
TURNS_PER_SEGMENT = 200
MAX_LINE_CHARS = 400 # keep each labelled line short
TIMING = re.compile(r"^(\S+)\s+-->\s+\S+")
VOICE = re.compile(r"<v(?:\.[^ >]+)?\s+([^>]+)>")
TAG = re.compile(r"<[^>]+>")
def clean(text):
# Remove markup first, then decode & < and friends.
return html.unescape(TAG.sub("", text)).strip()
def short_lines(prefix, words, limit):
"""Split a long turn into lines that each carry the same label."""
room = max(80, limit - len(prefix))
lines = []
while len(words) > room:
cut = max(words.rfind(". ", 0, room), words.rfind("? ", 0, room))
if cut < room // 2:
cut = words.rfind(" ", 0, room)
if cut <= 0:
cut = room - 1
lines.append(prefix + words[:cut + 1].strip())
words = words[cut + 1:].strip()
if words:
lines.append(prefix + words)
return lines
def vtt_to_turns(text):
"""One labelled line per speaker turn: [start] Speaker: words."""
turns = []
for block in re.split(r"\n\s*\n", text.replace("\r\n", "\n")):
lines = [ln.strip() for ln in block.split("\n") if ln.strip()]
timing = next((i for i, ln in enumerate(lines) if TIMING.match(ln)), None)
if timing is None:
continue # WEBVTT header, NOTE or STYLE block
start = re.split(r"[.,]", TIMING.match(lines[timing]).group(1))[0]
body = " ".join(lines[timing + 1:])
voices = list(VOICE.finditer(body))
if voices:
# A cue can hold several voice spans; keep each speaker with their words.
spans = []
if clean(body[:voices[0].start()]):
spans.append(("", body[:voices[0].start()]))
for i, v in enumerate(voices):
end = voices[i + 1].start() if i + 1 < len(voices) else len(body)
spans.append((clean(v.group(1)), body[v.end():end]))
else:
spans = [("", body)]
for speaker, raw in spans:
words = clean(raw)
if words:
prefix = f"[{start}] {speaker}: " if speaker else f"[{start}] "
turns.extend(short_lines(prefix, words, MAX_LINE_CHARS))
return turns
def js_len(s):
return len(s.encode("utf-16-le")) // 2
def segments(turns, max_turns, max_chars):
buf = []
size = 0
for turn in turns:
line = turn + "\n"
if buf and (len(buf) >= max_turns or size + js_len(line) > max_chars):
yield "".join(buf)
buf = []
size = 0
buf.append(line)
size += js_len(line)
if buf:
yield "".join(buf)
with open(TRANSCRIPT_PATH, encoding="utf-8") as f:
turns = vtt_to_turns(f.read())
parts = []
for segment in segments(turns, TURNS_PER_SEGMENT, MAX_CHARS):
kept = segment # fail open: default to the original segment
try:
r = requests.post(
API_URL,
headers={"X-API-Key": os.environ["SUPERCOMPRESS_API_KEY"]},
json={"context": segment, "query": QUESTION},
timeout=60,
)
r.raise_for_status()
kept = r.json().get("compressed_text") or segment
except requests.RequestException:
pass
parts.append(kept if kept.endswith("\n") else kept + "\n")
compressed_transcript = "".join(parts)
print(compressed_transcript)
The context field is limited to 120,000 characters per call. Longer input returns HTTP 422 with "context too long (120k max)". Empty context returns 422 with "context required". The example measures segments in UTF-16 units because the limit is counted the way JavaScript counts string length. SuperCompress is extractive and query-aware: it selects whole lines from the original rather than writing a summary, so the words, speaker names and timestamps in the kept lines stay as written; preprocessing may rewrite JSON, or split a line at labels such as "Question:" or "Title:", before lines are chosen. It works per line, which is why one turn per line matters. Lines that do not match the question are dropped, so check important answers against the full transcript. Each response reports original_tokens and kept_tokens, which are estimates, not provider-billed totals. When the saving would be too small the call passes through: passthrough is true, compressed_text is the original and kept_tokens equals original_tokens.
How should I split a long call?
Split by turns or by time (for example every 10 to 15 minutes of the call), keep each segment well under 120,000 characters, send every segment with the same question, and join the kept lines in call order. The timestamps on each line let the model, and you, place every kept turn in the call. Then send the joined result to your model with the question.
What question should I send?
Send the question you actually want answered: what the customer said about renewal or pricing, which objections came up, what each person agreed to do next, or everything said about one feature. Compress once per question if you have several. Leaving the query empty, or sending a generic request such as "summarize this text", gets the broader digest labelled query_mode "dump".
When is a summary the better tool?
When you want a recap of the whole call for a human, the overall tone, or the gist of a long meeting, a summary fits; short calls that already fit the window need neither; when you need the full record, keep the full transcript. Many pipelines do both: pull the exact turns for the question, and summarize the rest. See extractive vs abstractive compression and how compression compares with summarization. For a fuller decision guide, see when prompt compression is worth it.
How do I know it helped?
Run the same calls with and without compression and check whether the model quotes the right turn and timestamp. Log original_tokens and kept_tokens (estimates). Confirm cost on your provider bill. See whether context compression lowers your bill. Logs work the same way; see how to compress Kubernetes logs before an LLM reads them.
Frequently asked questions
Can I send a whole call transcript in one request?
Only up to 120,000 characters of context per call. Convert it to one line per turn, split long calls into segments and compress each one with the same question.
Will compression change what people said?
SuperCompress selects original lines rather than writing a summary, so the words, speaker names and timestamps in the kept lines stay as written. Lines that do not match your question are dropped, so check important answers against the full transcript.
Does it work with VTT and SRT files?
The API only sees text. Convert the captions to one line per cue with the start time and speaker, as in the example above, then compress the result.
Do I need to send a question?
Yes, for a targeted result. Without a query, or with a generic one like "summarize this text", the API returns a broader digest and labels the response query_mode "dump".