Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš” WARROOM

Multi-Agent AI Debate Arena

Tell it anything. Four AI agents debate it. A judge gives you a verdict.

Live Demo Backend GitHub

WarRoom Banner


πŸ”— Live Links

Service URL Status
🌐 Frontend warroom-frontend.vercel.app Vercel
βš™οΈ Backend API warroom-1.onrender.com Render
πŸ“‘ Health Check /health API

Note: Backend runs on Render free tier β€” first load may take 30–50s to wake up (cold start).


What it does

You type any topic. Four AI agents take over and debate it in real time:

Agent Name Role
β–² Proponent AXIOM Argues as strongly as possible for your topic
β–Ό Opponent REFUTE Finds every weakness and argues against
β—† Fact-Checker VERITAS Neutral auditor β€” detects fallacies, verifies claims
β—‰ Judge ARBITER Scores every turn, delivers a final verdict

Works for any topic

πŸ•  "Should I buy a dog?"
πŸ’Ό  "Should I quit my job and freelance?"
🏠  "Should I rent or buy a house right now?"
⚑  "Nuclear energy is essential for net-zero"
πŸ€–  "AI development should be paused immediately"
🌍  "Social media does more harm than good"

✨ Key Features

  • ⚑ Real-time streaming β€” Every agent's response streams token-by-token via WebSocket. Watch agents think and speak live.
  • ⏸ Pause & interrupt β€” Pause any debate mid-turn. Inject evidence, challenge a claim, or redirect the conversation.
  • πŸ” Live web search β€” Fact-Checker uses Tavily to search the web in real time, verifying claims as they're made.
  • ⚠ Fallacy detection β€” Every turn scanned for 10+ fallacy types (Ad Hominem, Straw Man, False Dichotomy, etc.).
  • πŸ“Š Live metrics β€” Animated score bars, head-to-head battle view, and consensus arc update after every turn.
  • 🧬 Consensus engine β€” Vector embeddings measure stance convergence. Debate ends when agents agree enough.
  • ⏱ Time-travel & forking β€” Every round checkpointed. Jump back and fork a new debate branch from any point.
  • πŸ† Judge verdict β€” Full verdict with winner, key arguments, fallacy summary, and concrete recommendation.
  • πŸ‘€ Personal topic support β€” Detects personal decisions and adjusts agents to discuss practical, real-world impact.

Tech Stack

Frontend

  • Next.js 14 (App Router) + TypeScript
  • Pure CSS custom properties
  • WebSocket real-time streaming
  • Supabase Auth
  • Deployed on Vercel

Backend

  • FastAPI + Python
  • LangGraph state machine
  • Groq API (Llama 3.3 70B)
  • Supabase (PostgreSQL + Auth)
  • Redis (pause/interrupt state)
  • Deployed on Render

Architecture

LangGraph State Machine

flowchart TD
    START --> round_start
    round_start --> proponent
    round_start --> opponent
    round_start --> fact_checker
    proponent --> moderator
    opponent --> moderator
    fact_checker --> moderator
    moderator --> consensus
    consensus -->|continue| round_start
    consensus -->|end| judge
    judge --> END
Loading

How it works

flowchart TD
    A[User enters topic] --> B[Next.js frontend\nPOST /debates]
    B --> C[FastAPI backend\nstarts LangGraph task]
    C --> D[4 agents debate in sequence\nPro β†’ Opp β†’ Fact β†’ Mod]
    D --> E[Groq streams tokens\nLlama 3.3 70B]
    D --> F[Scoring runs parallel\nlogic + fallacies]
    E --> G[WebSocket pushes events live]
    F --> G
    G --> H[User sees live debate + verdict]
Loading

`` `

Project Structure

WarRoom/
β”œβ”€β”€ frontend/                  # Next.js app
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ page.tsx           # Landing page
β”‚   β”‚   β”œβ”€β”€ auth/              # Login + Signup
β”‚   β”‚   β”œβ”€β”€ debate/
β”‚   β”‚   β”‚   β”œβ”€β”€ new/           # Create debate form
β”‚   β”‚   β”‚   └── [id]/          # Live debate arena
β”‚   β”‚   └── history/           # Past debates
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ agents/            # AgentCard
β”‚   β”‚   β”œβ”€β”€ dashboard/         # LiveMetricsPanel, ConsensusGauge
β”‚   β”‚   β”œβ”€β”€ debate/            # DebateFeed, InterruptModal, DebateControls
β”‚   β”‚   β”œβ”€β”€ graph/             # GraphCanvas (React Flow)
β”‚   β”‚   β”œβ”€β”€ timeline/          # DebateTimeline, ForkModal
β”‚   β”‚   └── ui/                # Button, Badge, Tooltip
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useAuth.ts         # Supabase session
β”‚   β”‚   β”œβ”€β”€ useDebate.ts       # Debate state + WS events
β”‚   β”‚   └── useCheckpoints.ts  # Time-travel / fork
β”‚   └── lib/
β”‚       β”œβ”€β”€ api.ts             # FastAPI client
β”‚       β”œβ”€β”€ supabase.ts        # Supabase client
β”‚       β”œβ”€β”€ types.ts           # TypeScript interfaces
β”‚       └── constants.ts       # Shared constants
β”‚
└── backend/                   # FastAPI app
    β”œβ”€β”€ main.py                # Entry point + CORS
    β”œβ”€β”€ models/schemas.py      # Pydantic models
    β”œβ”€β”€ routers/
    β”‚   β”œβ”€β”€ debates.py         # REST endpoints
    β”‚   └── ws.py              # WebSocket manager
    β”œβ”€β”€ agents/
    β”‚   β”œβ”€β”€ graph.py           # LangGraph state machine
    β”‚   β”œβ”€β”€ consensus.py       # Vector embedding engine
    β”‚   β”œβ”€β”€ prompts.py         # System prompts
    β”‚   └── scoring.py         # Per-turn scoring
    └── services/
        β”œβ”€β”€ groq_client.py     # Groq API
        β”œβ”€β”€ supabase_client.py # DB operations
        └── redis_client.py    # Ephemeral state

Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • Supabase project (free)
  • Groq API key (free)
  • Tavily API key (optional β€” enables web search)

1. Clone the repo

git clone https://github.com/harshitayadavv/warroom.git
cd warroom

2. Database setup

  1. Go to your Supabase project β†’ SQL Editor β†’ New query
  2. Paste the contents of backend/supabase_schema.sql
  3. Click Run

3. Frontend

cd frontend
npm install

Create frontend/.env.local:

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_API_URL=http://localhost:8000
npm run dev   # http://localhost:3000

4. Backend

cd backend
python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install -r requirements.txt

Create backend/.env:

GROQ_API_KEY=gsk_your_key
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your-service-role-key
REDIS_URL=redis://localhost:6379
TAVILY_API_KEY=tvly-your-key
CORS_ORIGINS=http://localhost:3000,https://warroom-frontend.vercel.app
DEBUG=true
uvicorn main:app --reload --port 8000   # http://localhost:8000

Deployment

Frontend β†’ Vercel

Variable Value
NEXT_PUBLIC_API_URL https://warroom-1.onrender.com
NEXT_PUBLIC_SUPABASE_URL Your Supabase URL
NEXT_PUBLIC_SUPABASE_ANON_KEY Your anon key

Backend β†’ Render

Variable Value
GROQ_API_KEY Your Groq key
SUPABASE_URL Your Supabase URL
SUPABASE_SERVICE_KEY Your service role key
CORS_ORIGINS http://localhost:3000,https://warroom-frontend.vercel.app
TAVILY_API_KEY Your Tavily key (optional)

Start command: uvicorn main:app --host 0.0.0.0 --port 8000


Groq Models

Agent Model
Proponent, Opponent, Judge llama-3.3-70b-versatile
Fact-Checker llama-3.3-70b-versatile
Scoring gemma2-9b-it (separate quota)

License

MIT β€” do whatever you want with it.


Built with βš” by Harshita Yadav

Deploy with Vercel

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages