Inspiration

Legal argumentation is a skill that traditionally requires in-person training, expert feedback, and structured courtroom environments, none of which are easily accessible to most students or professionals. Despite the rise of AI tools for writing and research, there is still no platform that allows users to practice real-time courtroom reasoning, face objections, or learn procedural flow in a fun and engaging way.

We wanted to build something that feels like LeetCode for legal reasoning: a place where anyone can practice arguments, improve rhetorical clarity, and simulate real trial pressure with an AI judge that behaves like the real thing.
This project was inspired by a gap we repeatedly saw among law students, debaters, and public speakers: they have theory, but no way to practice execution in an engaging format.


What it does

LeetCourt is an AI-driven, voice-interactive courtroom simulator that allows users to:

  • Conduct realistic Opening, Direct, Cross, and Closing phases
  • Face live objections such as Relevance, Hearsay, Speculation, and Leading
  • Upload any PDF case file and have an AI extract facts, evidence, and precedents
  • Receive performance analysis at the end of the game
  • Track clarity, logic, persuasiveness, and precedent usage
  • Interact with a fully voice-enabled multi-agent AI judge, Lawyer, and Orchestrator built using ElevenLabs Conversational AI
  • Access an integrated tools panel with evidence, notes, and case summaries

How we built it

LeetCourt integrates multiple advanced systems into a single cohesive simulation:

Frontend & UI Architecture

  • React 18.3 + Vite for high-performance rendering
  • TailwindCSS + Shadcn UI for consistent, modern UI

AI Systems

  • ElevenLabs Conversational AI for low-latency judge, lawyer, orchestrator, and user interaction
  • OpenRouter (GPT-5.1) for:
    • PDF case extraction and feeding dynamic variables for ElevenLabs
    • Performance feedback at the end of the game
    • Case structuring

Data Processing

  • pdf.js to extract unstructured text
  • JSON-normalized case structure for dynamic injection into agents

Architecture Summary

  • A deterministic Finite State Machine manages trial phases
  • A reactive scoring engine evaluates arguments at fixed intervals
  • A voice pipeline manages streaming input/output from the judge

Challenges we ran into

  • Latency management: synchronizing real-time speech with LLM responses required heavy optimization and caching.
  • Maintaining consistent judge behavior: the judge must be strict, procedural, and predictable—requiring extensive prompt engineering and reinforcement rules.
  • Handling messy PDFs: scanned or irregular files often broke extraction, forcing us to implement fallbacks and preprocessing.
  • Conversation drift: without a strict FSM, courtroom phases would blur and confuse the model; designing the conversation structure was non-trivial.
  • Integrating multiple models: coordinating judge logic, scoring, and extraction without conflicting context required careful orchestration.

Accomplishments that we're proud of

  • Built a fully voice-interactive courtroom simulator with realistic objections.
  • Created a dynamic PDF-to-case extraction pipeline that works on nearly any legal document.
  • Successfully implemented a real-time scoring engine that analyzes user arguments every 3 seconds.
  • Developed a clean, intuitive UI that mirrors professional trial environments.
  • Designed a flexible case library that supports search, filtering, uploading, deletion, and metadata.
  • Created a scalable architecture that can support new agents, new case types, and multiplayer scenarios.

What we learned

  • Real-time voice interactions require more than LLM prompts—they need architectural discipline, buffering, and predictable flow control.
  • Legal reasoning benefits from structure: an FSM model greatly improves accuracy and realism.
  • LLMs perform best when each is assigned a specific, narrow function (judge, analyzer, extractor).
  • User experience matters: trial simulations need pacing, clarity, and visual anchors to feel authentic.
  • High-quality prompts aren’t enough—environment design determines how well agents behave.

What's next for LeetCourt

We see LeetCourt as the foundation for scalable legal and rhetorical training. Planned next steps include:

  • Multiplayer Mode: human vs. AI opposing counsel or human vs. human with an AI judge
  • Mobile App for on-the-go argument practice
  • Community Case Marketplace for user-submitted scenarios
  • Institutional versions for law schools, debate clubs, and training programs
  • Advanced scoring models that learn from user patterns
  • Analytics dashboard showing improvement over time
  • Scenario-based learning tracks (Criminal Law, Torts, Contracts, Evidence, Constitutional Law)

LeetCourt aims to become the first platform that makes courtroom reasoning truly accessible, interactive, and measurable.

Built With

  • elevenlabs
  • openrouter
  • react
Share this project:

Updates