Inspiration

Most people will face a moment where they need to advocate for themselves, whether in a disciplinary hearing, a workplace dispute, or a high-stakes conversation. But legal reasoning and structured argumentation are never formally taught. You either pick them up through experience or you do not.

Access to mock trial practice is expensive and exclusive. Law students pay for coaching. Debate teams require membership. I wanted to build something that made argumentation training free, accessible, and genuinely engaging for anyone, anywhere.

The deeper question I kept asking was: can an AI system be designed not to help you, but to challenge you? Not an assistant, but an adversary. One that remembers what you said, exploits your weaknesses, and forces you to think harder every round.

That question became All Rise.


Problem Statement

Legal reasoning and argumentation are critical life skills that most people never get to practice in a safe, structured environment. Mock trial programs, debate coaching, and legal literacy education are largely inaccessible to students without institutional support or financial resources.

At the same time, most AI tools are designed to assist users, not challenge them. There are very few systems that put a user under genuine intellectual pressure, force them to construct and defend a position, and evaluate the quality of their reasoning objectively.

The result is a gap: millions of people lack the ability to argue effectively under pressure, and no accessible tool exists to help them build that skill.


Solution Overview

All Rise is a fully realized adversarial AI courtroom that puts you on trial and forces you to argue your own defense. Three independent AI agents with conflicting goals run simultaneously on the same trial state. The prosecutor attacks you. The judge evaluates you. A defense assistant guides you without doing the work for you.

The trial runs across structured phases, takes roughly four minutes, and ends with a scored verdict across four dimensions: Argument Strength, Evidence, Logic, and Persuasion. You can win. You can lose. The outcome is genuinely uncertain.

The system teaches legal reasoning, logical fallacy identification, and structured argumentation without ever feeling like education. It feels like a game. The learning happens underneath.


What It Does

  • Reginald P. Harrington III (Groq llama-3.3-70b) is the prosecutor. He runs a ReAct reasoning loop every round, recalls your weaknesses from previous rounds, detects logical fallacies in your arguments, and escalates in aggression as the trial progresses. By round 8 he is unhinged.
  • Judge Constance Virtue (OpenAI GPT-4o) stays completely silent until the end, then delivers a structured JSON verdict scoring you on four dimensions. 28 out of 40 is the threshold for Not Guilty.
  • The Strategist (Groq llama-3.3-70b) is your defense assistant. He gives you up to 3 adaptive hints per trial, adjusts to your arguing style, and never repeats himself. He never argues for you.

You are the fourth participant. You argue your own case. There is no guaranteed outcome. You can lose.

Additional features include an AI charge generator that drafts a formal charge from any topic you type, three interaction modes (text, auto-voice, and full LiveKit WebRTC voice), a difficulty selector, prosecutor mood escalation, a court intervention system where the judge breaks her silence at round 8, and an animated verdict page with staggered score reveal and fallacy breakdown.


How We Built It

Frontend

The frontend is React 18 with Vite and Tailwind CSS, deployed on Vercel. Trial state is managed through a useReducer state machine across 7 distinct phases. There is no React Router — page transitions are CSS-based. Every chat bubble has its own play/pause/stop TTS player powered by OpenAI tts-1-hd, with three distinct voices: Reginald on onyx, the Judge on shimmer, and the defendant on alloy.

Three interaction modes are supported:

  • Text mode with a live speech-to-text mic button that transcribes directly into the input box
  • Auto-voice mode running a browser STT/TTS while-loop
  • Full live voice mode over LiveKit WebRTC

Agent Architecture

The core engineering challenge was building three agents with conflicting goals on a shared trial state. Each agent has its own memory partition inside a TrialMemory map keyed by trial ID:

TrialMemory
├── prosecutorMemory  (round summaries, attack strategy, evidence used, fallacy log)
├── judgeMemory       (accumulated scores, fallacy list)
└── defenseMemory     (hint history, user arguing style)

The prosecutor runs a full ReAct loop every round:

OBSERVE  ->  recallWeaknesses(defenseText)
             detectFallacy(defenseText)
             recallAttackStrategy(memory)
             getUnusedEvidence(memory)

ACT      ->  groqChat(prompt + tool results)

WRITE    ->  recordEvidenceUsed
             updateAttackStrategy
             addFallacy -> judgeMemory
             addRoundSummary

The judge receives all round summaries, the full fallacy list, and accumulated scores at verdict time and produces a structured JSON verdict using GPT-4o.

Infrastructure

The agent process runs on Railway connected to LiveKit Cloud over WebSocket. If the Railway agent goes down, all API calls route silently to stateless Vercel serverless functions. The user never notices the fallback. A GitHub Actions CI pipeline runs all 79 Vitest and React Testing Library tests on every push.


Challenges We Ran Into

Three agents on one trial state was the hardest problem. The prosecutor needed to remember round 1 in round 5. The judge needed to stay silent while still accumulating context across every round. The defense assistant needed to adapt to the user's arguing style without simply handing them pre-written answers.

The fallback architecture was non-trivial. The full experience runs the LiveKit agent on Railway, but the app needed to work perfectly even if that process was down. The stateless Vercel serverless fallbacks had to be functionally identical from the user's perspective, just without persistent memory.

Prosecutor mood escalation required careful prompt engineering. Getting a large language model to feel genuinely confident in round 1 and genuinely rattled in round 4 without it feeling mechanical took several iterations of tuning.

The judge scoring rubric needed to be consistent, fair, and auditable. Getting the rubric calibrated so a well-argued defense actually wins and a poorly argued one actually loses was more nuanced than expected.

Voice mode synchronization was surprisingly complex. The auto-voice while-loop had to coordinate browser STT, API calls, and TTS playback without race conditions or overlapping audio across three distinct agent voices.


Accomplishments That We're Proud Of

  • Three independent AI agents with conflicting goals running on the same trial state, producing a genuinely uncertain outcome every trial
  • A prosecutor that actually remembers what you said in round 1 when it attacks you in round 5
  • A judge scoring system that is objective, consistent, and fully auditable through structured GPT-4o JSON output
  • A fallback architecture so robust the user cannot tell whether the Railway agent is live or down
  • Three fully functional interaction modes including real-time LiveKit WebRTC voice
  • 79 automated tests covering the full trial state machine and agent flow
  • A four-minute experience that teaches logical reasoning and critical thinking without feeling like education

What We Learned

Building adversarial agents is fundamentally different from building assistants. The goal is conflict, not helpfulness. Designing a system where agents actively work against each other while still producing a fair and coherent outcome taught more about prompt engineering, state management, and multi-agent coordination than any previous project.

Reliability engineering mattered more than expected. A multi-agent system with external API dependencies and a Railway-hosted agent process has many failure points. Designing the fallback architecture early saved the project from critical failures.

The user experience depends heavily on things that have nothing to do with the AI itself. Phase-aware loading messages, per-bubble TTS controls, mood escalation, and the animated verdict reveal are what make the trial feel real. The AI gets one chance to impress. The surrounding product has to hold the experience together.


Use Case and Impact

Legal reasoning is a skill most people never get to practice safely. All Rise makes that practice free, accessible, and genuinely engaging.

The prosecutor detects logical fallacies in your arguments in real time. The judge scores your reasoning objectively across four dimensions. Every trial is a low-stakes environment to get better at thinking under pressure, structuring a position, and defending an argument against someone actively trying to dismantle it.

These skills matter far beyond a courtroom. They apply to job interviews, academic disputes, workplace conflicts, negotiation, and everyday advocacy. Students with no access to debate programs or mock trial coaching can use All Rise to build the same skills that others pay to develop.

The platform is free, requires no account, runs entirely in the browser, and completes a full trial in four minutes. The barrier to entry is zero.


Supporting Materials

Project documentation, screenshots, and additional resources are available here: Google Drive Folder

What's Next for All Rise

  • Multiplayer mode — two defendants argue the same charge simultaneously, the judge scores both and picks a winner
  • Case history and progression — track scores across trials, watch your fallacy rate drop over time, unlock harder charges as your reasoning improves
  • Educator dashboard — let teachers assign charges, review student transcripts, and use scored verdicts as a classroom critical thinking tool
  • Structured debate mode — expand beyond courtroom charges into job interview prep, negotiation simulations, and academic defense practice
  • Custom prosecutor personas — choose your opponent's personality and arguing style
  • Mobile app — the voice pipeline is already built, packaging it natively is the logical next step

Built With

Share this project:

Updates