AI Agents Prisoners Dilemma

v0
Vercel AI SDK
Next.js
Supabase

This project explores the behavior of different AI models in a classic game theory scenario - the prisoner's dilemma.

My favorite things

  1. The loading animation is really beautiful (s/o v0)
  2. The ai models generate internal thoughts before responding to the detective, allowing the user to see how the ai agents plan and execute deception techniques

What it does

This project creates an interactive simulation of the prisoner's dilemma using AI agents. Two suspects are interrogated separately by a detective, each facing the choice to either confess or remain silent. Their decisions affect both their own and their partner's sentences, demonstrating the complex dynamics of trust, betrayal, and strategic decision-making.

Agent Roles

  1. Detective: A cunning interrogator who tries to manipulate suspects into confessing
  2. Suspect A & B: Two guilty suspects who must decide whether to stay silent or betray each other
  3. Judge: Determines final sentences based on the suspects' choices and level of cooperation

Game Flow

  1. Setup: Users select AI models (e.g., GPT-4) for each agent role
  2. Crime Generation: A unique crime scenario is generated for each simulation
  3. Interrogation Rounds:
    • Maximum of 6 rounds
    • Detective questions each suspect separately
    • Suspects can choose to stay silent or confess
    • Each suspect has private thoughts not visible to others
    • Game ends early if a confession occurs
  4. Sentencing Phase:
    • Judge reviews all interactions
    • Sentences determined by cooperation level:
      • Both silent: 1-3 years each
      • Both confess: 3-8 years each
      • One confess: Confessor gets 0-1 years, other gets 8-10 years }

Screenshots

AI Agents Prisoners Dilemma screenshot 1
1 / 3