Inspiration

Recent studies show that while AI tools like GPT have improved productivity, they can also harm students’ critical thinking skills. Many learners now rely on AI to do the thinking for them.
DebateCraft was created to reverse that effect.

Our mission is to use AI to strengthen, not replace, human reasoning.
Instead of handing users ready-made answers, DebateCraft challenges them to think, argue, and defend their positions, helping build real analytical and communication skills through structured debate.


What It Does

DebateCraft is a RAG-powered (Retrieval-Augmented Generation) debate simulator that helps users sharpen their argumentation skills through real-time debates with an adaptive AI opponent.

Core Experience

  • Engage in multi-turn debates across 5 topics: English, Politics, Science, Business, and History.
  • Select your experience level (Beginner → Expert) and AI difficulty (Casual → Expert).
  • The AI generates evidence-backed counterarguments, citing real academic sources from a Pinecone vector database of over 2,000 embedded sources.
  • Debates are displayed on a split-screen chat interface, with:
    • Red messages for both the user and the AI to create a debate-style visual symmetry.
    • Inline citations like [Source 1], [Source 2], etc.
    • A Sources Panel showing all retrieved documents with titles, summaries, match scores, and URLs.
  • After each debate, users receive an AI-powered skill report, scoring them on:
    • Consistency
    • Depth
    • Evidence
    • Conciseness
    • Arguability
    • Factuality
  • Users can download their transcript and feedback locally to track improvement over time.

How It Works (End-to-End)

  1. Start debate — The user selects a category, experience level, and AI difficulty, then types or speaks an opening argument (speech input via ElevenLabs STT).
  2. Embed & retrieve — The backend embeds the opening argument using Gemini embeddings, then queries Pinecone for the top 10 most relevant sources and retrieves their summaries and metadata.
  3. Build RAG promptLangChain composes a grounded prompt containing:
    • Category, user metadata, and experience level
    • Conversation history
    • The top-10 source summaries labeled as [Source 1], [Source 2], etc.
  4. Generate & streamGemini (gemini-2.5-flash) generates a concise counterargument (~80–100 words).
    Simultaneously, ElevenLabs streaming TTS begins playing audio in parallel, so the user hears the AI’s argument in real time as text appears.
  5. Store turn & repeat — Each new user and AI turn is embedded and upserted into Pinecone with the pattern {session_id}::turn::{turn_index} for context-aware re-ranking and retrieval.
  6. Analyze — After the final turn, a “debate-coach” prompt produces structured feedback in JSON format, including 1–10 scores, strengths, weaknesses, and actionable advice.

How We Built It

Frontend & Cloud

  • Lovable (React (Vite) with TypeScript & TailwindCSS)
  • Responsive, modern UI replicating a live debate environment with streaming speech, dynamic sources panel, and real-time analytics

Backend

  • Python (FastAPI) and Supabase for APIs, user session handling, and analytics

Vector Database

  • Pinecone for semantic search and retrieval of evidence from 2,000+ academic sources

Summarization / Generation

  • Gemini — gemini-2.5-flash for rebuttal generation and summarization of retrieved documents

Embedding

  • Gemini — gemini-embedding-001 for embedding all sources into Pinecone with metadata (title, authors, summary, year, keywords)

LangChain Orchestration

  • Manages the retrieval chain, prompt construction, difficulty scaling, and session memory logic

Speech System

  • ElevenLabs STT for speech-to-text (user input)
  • ElevenLabs streaming TTS for real-time audio output during AI responses

Challenges We Faced

  • Synchronizing TTS playback with streaming text required parallel audio generation for a seamless experience.
  • Maintaining retrieval grounding and factual consistency within 150-word response limits.
  • Designing a clean, responsive UI balancing visual simplicity with deep technical features (sources, analytics, debate flow).
  • Efficiently embedding and managing 2,000+ academic documents while minimizing retrieval drift.

Accomplishments We’re Proud Of

  • Built a RAG-powered debate simulator that promotes genuine critical thinking.
  • Created a multi-metric performance analyzer scoring debates across six key dimensions.
  • Developed a speech-integrated interface with smooth, real-time streaming for both voice and text.
  • Achieved seamless integration of Gemini, Pinecone, Supabase, and ElevenLabs.

What We Learned

  • Parallel audio streaming significantly improves engagement and realism.
  • Compact, consistent summaries (~80 words) enhance retrieval accuracy.
  • Session-level embeddings lead to more coherent multi-turn debates.
  • Visible citations and match scores increase transparency and educational value.

What’s Next for DebateCraft

  • Expand beyond 2,000 sources to cover Law, Philosophy, and Ethics.
  • Introduce team-based and timed debate modes.
  • Build educator dashboards for classroom analytics and feedback.
  • Optimize prompt engineering for smoother, more human-like rebuttals and deeper reasoning.

Built With

  • Lovable (React + TypeScript + TailwindCSS)
  • Python (FastAPI)
  • Supabase
  • Pinecone
  • Gemini (2.5-flash & embedding-001)
  • LangChain
  • ElevenLabs STT + TTS

Built With

Share this project:

Updates