axiom-ai

Agent Arena

Two AI agents debate or negotiate while a third judges, live in your browser.

Build log

Status

Not started. This log is written by Claude Code during the cloud session that builds the demo, then lightly edited.

The brief

The prompt the session received, verbatim, and a link to the cloud session and PR.

Approach

What was chosen and why. Alternatives considered. Anything reused from open source, with license and link.

Timeline

Short dated entries as the work progressed: what was tried, what broke, what fixed it.

Numbers

Rough wall-clock time, number of turns, tokens or cost if known, bundle size, frames per second on a laptop and a phone.

What I would do next

Known gaps, stretch goals, ideas.

Original spec

Agent Arena

Build a multi-agent debate and negotiation demo in projects/agent-arena/demo/index.ts following the demo contract and the LLM rules in CLAUDE.md. Use src/lib/llm.ts for all model access. There is no backend.

Goal

Let a visitor set up two AI agents with different goals or personas, watch them interact over several structured rounds, and see a judge score the exchange. The orchestration logic and prompts are the point; make them visible.

Modes

  1. Debate: a motion (free text, with a dropdown of examples). Agent A argues for, Agent B against. Rounds: opening, two rebuttals, closing. The judge scores each round on clarity, evidence and responsiveness (1 to 5 each) with a one-line reason, and declares a winner at the end.
  2. Negotiation: a scenario with hidden private information per agent (for example buyer and seller with secret reservation prices, or two roommates splitting chores with different preferences). Each agent sees only its own brief plus the public transcript. Up to 8 turns; a deal is detected when both agents emit an explicit {"accept": true, "terms": ...} JSON block. The judge reports whether a deal was reached, the surplus split if numeric, and whether either agent leaked private info.

Agents

  • Each agent has: name, persona (short text), goal, optional private brief, and a temperature. Provide 4 to 6 preset personas and allow editing.
  • Prompts are short and explicit about format: plain prose for debate turns with a hard word limit; negotiation turns end with a one-line JSON status block that you parse with extractJSON().
  • Judge is a third agent call with a strict JSON output validated via chatJSON().
  • Streaming: render tokens as they arrive. Show which agent is “thinking”.

UI

  • Setup panel: mode, topic or scenario, agent cards, rounds, model selector per CLAUDE.md (WebLLM default with download progress and WebGPU detection, or own Anthropic key with the privacy note).
  • Transcript: chat-style, colour-coded per agent, judge cards between rounds, a running scoreboard.
  • “Load example run” replays a recorded transcript from demo/example-run.json generated once during the build.
  • Export transcript as Markdown. Cancel button that aborts via AbortSignal.
  • Phone layout stacks panels.

Must handle

  • Small local models drifting off format: enforce word limits by truncation, retry JSON once, and continue the match rather than crash.
  • A visible “prompt inspector” toggle that shows the exact system and user prompts sent for the current turn.

Acceptance

  • npm run check and npm run build pass.
  • A full debate and a full negotiation complete with WebLLM on Chrome desktop; example runs replay without a model.
  • project.json status set to live, BUILD-LOG.md complete per CLAUDE.md, including all prompts.