Project Info
This project did not submit a demo video on Devpost.
Inspiration
Arguments happen everywhere, but strong reasoning often gets lost beneath confidence, interruptions, and rhetorical tricks. We built Collina to make debates clearer and more entertaining by turning argument analysis into a live, game-show-style experience.
What it does
Collina is an AI referee for spoken debates. It separates speakers, generates a live transcript, flags logical fallacies, rewards strong arguments and rebuttals, updates an explainable scoreboard, calls fouls out loud, and crowns a winner with a punchy final verdict.
How we built it
Next.js, React, TypeScript, and Tailwind CSS: Power the debate interface, transcript, foul flags, animations, and live scoreboard. Deepgram: Provides speech recognition, speaker diarization, and spoken referee callouts. Claude: Analyzes each turn for argument strength and fallacies, then generates the final verdict. Redis Vector Search: Retrieves the most relevant definitions from our 17-fallacy taxonomy for grounded analysis. Hugging Face Transformers: Generates local sentence embeddings for semantic fallacy retrieval. A shared debate client supports both a stage-safe prerecorded demo and a live microphone mode using the same analysis and scoring pipeline. Challenges we faced Our biggest challenge was balancing speed with accuracy. The referee must react quickly enough to feel live, but false fallacy calls can make the entire experience feel unfair. We also had to design scoring rules that were consistent, explainable, and immediately understandable to an audience. Reliability was equally important, so we built an offline mock demo and a local semantic-search fallback that keep the core experience working when an external service is unavailable.
Collina โ AI Debate Referee
Two people argue out loud. Collina separates their voices, catches logical fallacies in real time, moves a live scoreboard, calls out fouls in a dramatic AI voice, and crowns a winner.
Built with Deepgram (speech-to-text + diarization + text-to-speech), Claude (fallacy analysis + verdict), and Redis (fallacy vector search).
โก TL;DR
npm install
npm run dev
Open http://localhost:3000 โ click "Call to order". That's the full demo, no keys needed.
๐ฎ Two ways to run it
| Button | What it does | Needs keys? |
|---|---|---|
| Call to order | Plays a scripted courtroom rehearsal. Polished, offline, can't fail. Keep this as the stage backup. | โ No |
| Go live (mic) | Pick any topic, debate through the mic, and watch the real AI pipeline judge each turn. | โ Yes (see below) |
1๏ธโฃ Mock demo (works right now)
npm install # one time
npm run dev # start the app
- Open http://localhost:3000
- Press
Ffor fullscreen presentation mode - Click "Call to order"
No API keys, no internet, no setup. This is the stage-safe demo.
2๏ธโฃ Live mode (real mic + real AI)
Live mode needs three services. Do these once:
Step 1 โ Add your keys
Copy the example file and fill it in:
cp .env.example .env.local
Edit .env.local:
ANTHROPIC_API_KEY=sk-ant-... # Claude (analysis + verdict)
DEEPGRAM_API_KEY=... # Deepgram (mic + voice) โ needs "Member" role
REDIS_URL=redis://localhost:6379
NEXT_PUBLIC_USE_REAL_PIPELINE=true # turn the real pipeline ON
Step 2 โ Start Redis
docker run -d --name debate-redis -p 6379:6379 redis/redis-stack:latest
npm run seed:redis # load the fallacy taxonomy (run once)
Step 3 โ Run it
npm run dev
Open http://localhost:3000 โ enter a topic โ click "Go live (mic)" โ allow the microphone โ debate โ click "End debate" for the verdict.
๐๏ธ Tip for clean voice separation: take clear turns, don't talk over each other, and ideally use two distinct-sounding voices.
โจ๏ธ Controls
| Key / Button | Action |
|---|---|
Call to order | Run the scripted courtroom rehearsal |
Go live (mic) | Start a real-time mic debate |
End debate | Stop the mic and get the verdict |
F | Fullscreen presentation mode |
M | Mute / unmute the AI ref voice |
R | Restart the debate |
๐งฐ Commands
npm run dev # start the app (http://localhost:3000)
npm run build # production build
npm run lint # strict TypeScript check
npm run seed:redis # load fallacies into Redis (live mode)
npm run test:scoring # verify the scoring math
npm run test:analyze # test fallacy detection (needs Anthropic key + Redis)
npm run test:transcribe -- <audio-file> # test a recorded clip
๐ฉน Troubleshooting
| Problem | Fix |
|---|---|
| "credit balance too low" (analysis/verdict fail) | Add credits to your Anthropic account โ console.anthropic.com โ Plans & Billing |
| 403 on mic / "Insufficient permissions" | Your Deepgram key needs the Member role โ create a new key with it |
| Live mic does nothing | Check NEXT_PUBLIC_USE_REAL_PIPELINE=true, all keys set, Redis running, mic permission allowed |
| Redis errors | Start it: docker start debate-redis (then npm run seed:redis) |
| Falls back to mock | That's intentional when keys/flag are missing โ the demo always works |
๐ง How it works
Audio โโถ Deepgram (transcribe + who-said-what)
โโถ split into turns
โโถ Redis finds the most relevant fallacies
โโถ Claude judges the turn (fallacies + strength)
โโถ score updates live + Deepgram voices the foul
End โโถ Claude delivers the winner's verdict
The UI imports only startDebate and getVerdict from lib/debate-client.ts. Mock and real pipelines share that exact contract, so the UI is identical either way.
Analysis
View
Metric
- 6
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- Next.jsIn code
- ReactIn code
- RedisIn code
- Tailwind CSSIn code
- TypeScriptIn code
7 of 7 appear in the indexed code.
AI coding agents
- Claude CodeCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
158 KB
Source files
47
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
EvxLee/Collina
53 files ยท 268 KB ยท @ 3d28ff6
Structure
Interface
10 files ยท 19%Screens, components and styles rendered to the user.
API & routing
5 files ยท 9%Request entry points: routes, handlers and controllers.
Application logic
21 files ยท 40%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- TypeScript70%
- CSS27%
- Markdown3%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm ยท 18- @anthropic-ai/sdk
- @deepgram/sdk
- @huggingface/transformers
- @next/env
- next
- react
- react-dom
- redis
- zod
- +9 more
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
Claude-generated final verdictVerified
Claude generates the final verdict, crowning a winner with a punchy final verdict
Claimed on Devposthigh confidencelib/verdict.ts:12โ generateVerdict computes the winner deterministically then calls Claude to write a punchy 3-4 sentence verdict consistent with that winnerapp/api/verdict/route.ts:1โ API route exists to expose verdict generation to the client
Fallacy detection via ClaudeVerified
Claude analyzes each turn for argument strength and fallacies
Claimed on Devposthigh confidencelib/analyze.ts:103โ analyzeTurn calls Claude (claude-sonnet-4-6) with a schema-constrained prompt returning fallacies, argumentStrength, and isRebuttal
Fullscreen presentation mode and keyboard controls (F/M/R)Verified
F for fullscreen presentation mode, M to mute/unmute, R to restart
Claimed on readmehigh confidencecomponents/DebateArena.tsx:217โ Keydown handler checks for 'f', 'm', 'r' keys and calls toggleFullscreen, toggleMuted, and runDebate respectively
Live explainable scoreboard updatesVerified
Updates an explainable scoreboard in real time
Claimed on Devposthigh confidencelib/scoring.ts:21โ computePointDelta deterministically derives point changes from argumentStrength, rebuttal bonus, and fallacy penalties so the score reason is legiblecomponents/Scoreboard.tsx:118โ Scoreboard component animates score changes live and shows a legend explaining point deltas
Live mic mode with real-time diarized streamingVerified
Go live (mic): pick any topic, debate through the mic, and watch the real AI pipeline judge each turn
Claimed on readmehigh confidencelib/realtimeDebateClient.ts:46โ startMicDebate opens a Deepgram live websocket with diarize:true, streams MediaRecorder audio, and assembles turns via LiveTurnAssemblerlib/liveSegmentation.ts:32โ LiveTurnAssembler merges diarized word stream into per-speaker turns with flicker suppression
Local semantic-search fallback when Redis is unavailableVerified
We built a local semantic-search fallback that keeps the core experience working when an external service is unavailable
Claimed on Devposthigh confidencelib/fallacyStore.ts:155โ retrieveFallacies catches Redis errors and falls back to localFallback, an in-process cosine similarity search over the same embedded snippets
Local sentence embeddings via Hugging Face Transformers.jsVerified
Hugging Face Transformers generates local sentence embeddings for semantic fallacy retrieval
Claimed on Devposthigh confidencelib/embeddings.ts:4โ Uses @huggingface/transformers pipeline with Xenova/all-MiniLM-L6-v2 to produce 384-dim normalized embeddings locally, no external API key
Next.js/React/TypeScript/Tailwind debate interfaceVerified
Next.js, React, TypeScript, and Tailwind CSS power the debate interface, transcript, foul flags, animations, and live scoreboard
Claimed on Devposthigh confidencecomponents/DebateArena.tsx:1โ Main React/TSX component orchestrating the debate UI, fullscreen mode, and keyboard shortcutstailwind.config.ts:1โ Tailwind CSS configuration presentcomponents/FallacyFlag.tsx:1โ Dedicated component for rendering fallacy/foul flags
Redis vector search over a 17-fallacy taxonomyVerified
Redis Vector Search retrieves the most relevant definitions from a 17-fallacy taxonomy for grounded analysis
Claimed on Devposthigh confidencelib/fallacyStore.ts:118โ retrieveFallacies runs a Redis FT.SEARCH KNN query over embedded fallacy snippets to ground the Claude promptlib/fallacies.ts:8โ FALLACIES array contains exactly 17 named fallacy definitions, confirmed by counting name: entriesscripts/seed-redis.ts:1โ seed script exists to load the taxonomy into Redis (npm run seed:redis)
Rewards for strong arguments and rebuttalsVerified
Rewards strong arguments and rebuttals
Claimed on Devposthigh confidencelib/scoring.ts:21โ basePoints rewards higher argumentStrength and computePointDelta adds a rebuttal bonus when isRebuttal is true and base>0
Scripted test commands (scoring, analyze, transcribe)Verified
npm run test:scoring, test:analyze, test:transcribe verify the scoring math, fallacy detection, and transcription
Claimed on readmemedium confidencescripts/test-scoring.ts:1โ Test script for scoring math existsscripts/test-analyze.ts:1โ Test script for fallacy analysis existsscripts/test-transcribe.ts:1โ Test script for transcription exists
Speech-to-text with speaker diarizationVerified
Deepgram provides speech recognition and speaker diarization to separate speakers and generate a live transcript
Claimed on readmehigh confidencelib/deepgram.ts:58โ transcribeClip calls Deepgram's transcribeFile with diarize: true and utterances: true, mapping results to speaker-tagged utterancesapp/api/transcribe/route.ts:44โ API route calls transcribeClip then segmentTurns to produce diarized turns from an uploaded or demo clip
Spoken foul callouts (referee voice)Verified
Calls fouls out loud in a dramatic AI voice using Deepgram TTS
Claimed on readmehigh confidencelib/callout.ts:7โ buildCalloutText generates a spoken foul line like 'X! Minus N, Speaker Y' for moderate+ severity fallacieslib/tts.ts:7โ synthesizeSpeech calls Deepgram's speak API (aura-orion-en voice) to turn callout text into audiolib/realtimeDebateClient.ts:93โ processTurn calls buildCalloutText then posts to /api/tts to attach callout audio to the turn
Stage-safe prerecorded mock demoVerified
A shared debate client supports both a stage-safe prerecorded demo (Call to order) and a live microphone mode using the same analysis and scoring pipeline
Claimed on Devposthigh confidencelib/mockDebateClient.ts:10โ startDebate replays pre-scored mockTurns on a timer with zero backend callslib/debate-client.ts:19โ Shared startDebate/getVerdict contract dispatches to mock or real implementation based on source and NEXT_PUBLIC_USE_REAL_PIPELINE flag, both consumed identically by the UI
An AI agent derived these features from the projectโs Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.