LeetCourt

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 and lawyer 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 each session
  • 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 a consistent, modern interface

AI Systems

  • ElevenLabs Conversational AI for low-latency judge, lawyer, orchestrator, and user interaction
  • Gemini Pro 2.5 for:
    • PDF case extraction and dynamic variable feeding into ElevenLabs
    • Performance feedback at the end of each session
    • Case structuring and logic analysis

Data Processing

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

Architecture Summary

  • A deterministic Finite State Machine (FSM) 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
  • Consistent judge behavior: maintaining strict, procedural, and predictable rulings required extensive prompt engineering
  • Messy PDFs: scanned or irregular files often broke extraction, requiring fallbacks and preprocessing
  • Conversation drift: without a strict FSM, courtroom phases blurred and confused the model
  • Multi-model orchestration: coordinating judge logic, scoring, and extraction without conflicting context was non-trivial

Accomplishments 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
  • Implemented a real-time scoring engine that analyzes arguments every 3 seconds
  • Designed a clean, intuitive UI that mirrors professional trial environments
  • Built a flexible case library with search, filtering, uploads, deletion, and metadata
  • Developed a scalable architecture that supports new agents, case types, and multiplayer scenarios
  • Fully integrated all requirements of DataDog, including 7 custom monitors, Real time User Monitoring, custom playlists for video playback, controlled tests for user interactions with alerts, custom dashboards, thorough case management, and even workflow automation. Went above and beyond with DataDog integration, supercharging LeetCourt's health and longevity.

What We Learned

  • Real-time voice interactions require more than strong prompts—they demand architectural discipline and flow control
  • Legal reasoning benefits from structure; FSM-based design significantly improves realism
  • LLMs perform best when each has a narrow, well-defined role
  • UX matters deeply—pacing, clarity, and visual anchors make simulations feel authentic
  • Environment design shapes agent behavior as much as prompt quality

What’s Next for LeetCourt

LeetCourt is the foundation for scalable legal and rhetorical training. Planned next steps include:

  • Multiplayer mode: human vs. AI 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 adapt to user patterns
  • Analytics dashboards 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

Share this project:

Updates