Overview
The Transcript Chunks API handles storage and retrieval of speech-to-text chunks during live debates. Each chunk represents a segment of speech with precise timing information and tracks whether it has been processed for claim extraction. Function Types:- Public Mutations:
insert,triggerExtraction - Public Query:
listByDebate - Internal Query:
getUnprocessed - Internal Mutation:
markProcessed
insert
Parameters
The ID of the debate this transcript belongs to
Which speaker is talking (0 = Speaker A, 1 = Speaker B)
The transcribed text content
Unix timestamp (milliseconds) when this speech segment started
Unix timestamp (milliseconds) when this speech segment ended
Returns
Returns null on success
Behavior
- Automatically sets
processedForClaimstofalse - Chunks are ready for claim extraction processing
triggerExtraction
Parameters
The ID of the debate to process
Returns
Returns null on success
Behavior
- Schedules
internal.claimExtraction.extractto run immediately (0ms delay) - Does not wait for extraction to complete
- Can be called multiple times safely
listByDebate
Parameters
The ID of the debate to retrieve transcripts for
Returns
Array of all transcript chunks for the debate
Chunk Object Structure
Unique chunk identifier
Convex automatic creation timestamp
ID of the associated debate
Which speaker produced this chunk (0 = Speaker A, 1 = Speaker B)
The transcribed text content
Unix timestamp when speech segment started
Unix timestamp when speech segment ended
Whether this chunk has been processed for claim extraction
Behavior
- Uses
by_debate_and_timeindex for efficient querying - Results ordered by start time (implicit from index)
getUnprocessed
Parameters
The ID of the debate
Returns
Array of unprocessed chunks (where
processedForClaims === false)Behavior
- Uses
by_debate_unprocessedcompound index for efficient filtering - Only returns chunks with
processedForClaims: false
markProcessed
Parameters
Array of chunk IDs to mark as processed
Returns
Returns null on success
Behavior
- Sets
processedForClaims: truefor each provided chunk ID - Processes chunks sequentially in a loop
- Prevents duplicate claim extraction from same chunks
Validation Schema
Processing Flow
Typical Usage Pattern
- During Debate: Call
insertfor each speech segment as it’s transcribed - Periodic or End: Call
triggerExtractionto process accumulated chunks - Extraction Action: Uses
getUnprocessedto fetch new chunks - After Processing: Calls
markProcessedto prevent reprocessing
Timing Information
ThestartTime and endTime fields enable:
- Precise temporal tracking of when claims were made
- Synchronization with audio/video playback
- Time-based analysis of debate flow
- Chronological ordering of transcript segments