Overview
Stanzo’s Convex database schema defines four core tables for managing debates, transcripts, claims, and AI extraction sessions. The schema uses Convex’s built-in authentication tables and defines custom tables with indexes for efficient querying.Schema Definition
Tables
debates
Stores debate sessions with speaker information and status tracking.Fields
Reference to the user who created the debate (from Convex Auth)
Display name for the first speaker
Display name for the second speaker
Current debate status:
"active": Debate is ongoing"ended": Debate has concluded
Unix timestamp (milliseconds) when debate began
Unix timestamp (milliseconds) when debate ended (optional, only set when status is “ended”)
Indexes
Enables efficient queries for all debates by a specific user
Enables efficient queries for user’s active or ended debates
transcriptChunks
Stores real-time speech-to-text segments with timing and processing status.Fields
Reference to the parent debate
Which speaker produced this chunk:
0: Speaker A1: Speaker B
The transcribed text content
Unix timestamp (milliseconds) when speech segment started
Unix timestamp (milliseconds) when speech segment ended
Whether this chunk has been analyzed for claim extraction:
false: Not yet processedtrue: Already processed, skip in future extractions
Indexes
Retrieves all chunks for a debate
Retrieves chunks for a debate in chronological order
Efficiently finds unprocessed chunks for claim extraction
claims
Stores extracted factual claims with fact-checking results.Fields
Reference to the parent debate
Which speaker made the claim:
0: Speaker A1: Speaker B
The extracted factual claim statement
The original transcript text from which the claim was extracted
Current fact-checking status:
"pending": Awaiting fact-check"checking": Fact-check in progress"true": Verified as accurate"false": Verified as inaccurate"mixed": Partially true/false"unverifiable": Cannot be verified
Human-readable explanation of the fact-check result (optional)
Corrected version of the claim if it was false or mixed (optional)
Array of source URLs used for fact-checking (optional)
Unix timestamp (milliseconds) when claim was extracted
Unix timestamp (milliseconds) when fact-check completed (optional)
Indexes
Retrieves all claims for a debate
Retrieves claims for a debate filtered by status (e.g., all pending claims)
Retrieves all claims with a specific status across all debates
extractionSessions
Stores Gemini AI conversation history for multi-turn claim extraction context.Fields
Reference to the parent debate (one-to-one relationship)
Array of conversation messages in chronological order
The role of each message:
"user": System prompts and transcript inputs"model": Gemini AI responses with extracted claims
The message content (prompt text or AI response)
Indexes
Retrieves the session for a specific debate (at most one per debate)
Authentication Tables
Stanzo uses@convex-dev/auth which automatically provides:
- users: User accounts and profiles
- authSessions: Active authentication sessions
- authAccounts: OAuth provider connections
- authRefreshTokens: Token refresh management
- authVerificationCodes: Email/phone verification codes
- authRateLimits: Rate limiting for auth operations
Relationships
Relationship Details
- users → debates: One-to-many (user can create multiple debates)
- debates → transcriptChunks: One-to-many (debate contains multiple transcript chunks)
- debates → claims: One-to-many (debate contains multiple claims)
- debates → extractionSessions: One-to-one (debate has at most one extraction session)
Type Definitions
Speaker Type
0: Speaker A1: Speaker B