Follow along with the runnable example. This guide walks through the second-pass agent example in
corti-examples — bootstrap your build from it or use it as reference./transcripts, then feed the finalized result to an Agentic Framework agent — for example to produce a concise clinical summary from a diarized conversation.
This guide chains two earlier ones: the File Transcription pipeline and the agent lifecycle from On-Demand Agent (create-by-name, isolated
messageSend, prompt-driven behavior).The prompts used here are mere examples - be sure to test and refine the prompt to support your specific needs.Chain the second pass
Run the pipeline to completion, then hand the finalized transcript to the agent as a second stage. Keep them as distinct steps so the transcript is the source of truth and the agent run is an augmentation on top of it.JavaScript
Prepare the agent input
A/transcripts result is a set of segments, not a flat string. Flatten it for the agent — and prefix each segment with its speaker or channel label so the agent can reason about who said what.
JavaScript
systemPrompt:
Second-pass system prompt
Keep the transcript on agent failure
The transcript and the agent pass are independent results. If the second pass errors — a403, a timeout, an empty response — preserve the finalized transcript and surface the agent error separately. Never discard a good transcript because the augmentation failed.
Next steps
File Transcription
The
/transcripts pipeline this second pass runs on top of.On-Demand Agent
The agent lifecycle and message API, triggered manually instead.
Example code
The complete, runnable second-pass agent example in
corti-examples.Please contact us for help or questions.