Cerebral Courtroom
Build a real-time, multi-agent courtroom simulator powered by GPT-5-Codex that allows users to present legal arguments and receive dynamic feedback from AI agents playing the roles of Judge, Opposing Counsel, and Jury.
Core trick
Runs judge, opposing-counsel, and jury agents in a FastAPI backend that responds to submitted legal arguments.
Description
Build a real-time, multi-agent courtroom simulator powered by GPT-5-Codex that allows users to present legal arguments and receive dynamic feedback from AI agents playing the roles of Judge, Opposing Counsel, and Jury. The system predicts trial outcomes and highlights persuasive strategies.
README excerpt
# Cerebral Courtroom
MVP scaffold for Cerebral Courtroom — a multi-agent courtroom simulation using GPT-5-Codex.
Quickstart
1. Create a Python virtual environment and activate it.
2. Install backend dependencies:
```powershell
python -m venv .venv
.\.venv\Scripts\activate
pip install -r backend/requirements.txt
```
3. Set your OpenAI API key in the environment:
```powershell
$env:OPENAI_API_KEY = "sk-..."
```
4. Run the backend:
```powershell
uvicorn backend.main:app --reload --port 8000
```
Demo endpoint (single-agent opposing counsel):
1. Start the backend as above.
2. POST to `http://localhost:8000/api/demo/opposing` with JSON:
```powershell
curl -X POST "http://localhost:8000/api/demo/opposing" -H "Content-Type: application/json" -d '{"facts": "Alice saw Bob at the store.", "argument": "The defendant was at the scene."}'
```
This returns a JSON `reply` from the Opposing Counsel agent.
Frontend and further instructions will be added during the hackathon.
Running end-to-end Playwright tests
- Mocked (default, safe for CI):
```powershell
# from the project root
python -m pytest tests/e2e/test_demo_playwright.py -q -s
```
- Real OpenAI API (opt-in):
```powershell
# set your API key and enable real API mode
$env:OPENAI_API_KEY = "sk-..."
$env:DEMO_USE_REAL_API = "1"
python -m pytest tests/e2e/test_demo_playwright.py -q -s
```
Or use pytest CLI flag (sets the env var for y