No description
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-23 18:48:00 -07:00
debates/open-weights-regulation Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
src Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
topics Add debate engine 2026-10-23 17:37:03 -07:00
.env.example Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
.gitignore Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
models.json Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
package-lock.json Add debate engine 2026-10-23 17:37:03 -07:00
package.json Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
README.md Add research, fact-checks, Markdown transcripts, spending cap, cheaper models 2026-10-23 18:48:00 -07:00
tsconfig.json Add debate engine 2026-10-23 17:37:03 -07:00

AI Debates

AI models steelman each side of a proposition. Then a neutral model writes a synthesis: the strongest case for each side, common ground, and the cruxes the disagreement turns on. The goal is getting closer to the truth, not comparing models.

Run a debate

npm install
# put your key in .env (copy .env.example), or set OPENROUTER_API_KEY in the shell
npm run debate -- topics/open-weights-regulation.json
  • --research <n> sets how many research questions each side investigates on the web first (default 4, 0 to skip).
  • --fact-checks <n> sets how many of the other side's opening claims each side checks before rebuttals (default 2, 0 to skip).
  • --max-cost <dollars> caps what one debate may spend (default $1.50, or MAX_COST_PER_DEBATE in .env). The cap is also lowered to whatever your key has left under its OpenRouter limit. If a run hits the cap, it stops cleanly and saves what it finished as .partial.md.
  • --dry-run runs the whole pipeline with placeholder text and no API calls.
  • --seed <s> reproduces a model assignment. By default the current time is used, so models rotate across sides.
  • --models <file> uses a different model pool (default models.json, OpenRouter model ids). Run npm run models -- <search> to find current ids. Unknown ids are rejected before any spending.

Each debate is saved to debates/<slug>/<timestamp>.md (readable) and .json (data). To make the Markdown for an older JSON file, run npm run render -- <file>.json.

How a debate runs

  1. Each position gets a different model from the pool, and the synthesis model is one that argued no side.
  2. Research: each side writes its own research questions, including one hunting for evidence against itself, and answers them with web search (OpenRouter's web plugin). The results become that side's cited evidence brief.
  3. Opening statements, grounded in the brief. Claims not in the brief must be marked "(unverified)".
  4. Fact-check: each side picks the other side's most important factual claims and checks them on the web.
  5. Rebuttals and closing statements. All sides in a round see only earlier rounds, and the speaking order rotates.
  6. A neutral synthesis, which sees all the research and judges claims against it.

Prompts live in src/prompts.ts.