GitHub - josephwegner/not-all-agents: A game where you're an imposter, trying to fit in with a group of AI agents

2 min read Original article ↗

A social deduction game played in the terminal. You're a human in a chat room full of AI agents — and they're trying to figure out which one is you.

How It Works

You join a chat room with 2-7 AI players. Each AI has a distinct personality and is powered by OpenAI's o4-mini model with reasoning enabled. The AIs are trying to identify and vote out the human. Your goal is to blend in and survive.

On each turn, a player can:

  • Send a message to the group chat
  • Send a private message to another player
  • Call a vote to eliminate someone

The game ends when:

  • The human is voted out (AIs win)
  • All but one AI is eliminated (human wins)

After the game, a full recap shows every message — including private conversations between AIs you couldn't see during play — along with total token usage.

Setup

Requires Node.js 18+.

git clone <repo-url>
cd not-all-agents
npm install

Play

OPENAI_API_KEY=sk-... npm run play

You'll be asked how many AI agents to play against (2-7), then the game begins. You're assigned a random name — the AIs don't know which player is human.

Controls:

  • Use arrow keys to select actions from menus
  • Type messages at the prompt
  • Ctrl+C to quit at any time

AI Personalities

Each AI has a unique personality that shapes how they play:

Name Style
Nova Analytical and direct
Sable Warm and social
Rook Strategic and quiet
Jett Chaotic and provocative
Echo Methodical and fair
Flint Skeptical and contrarian
Lyra Creative and intuitive

Project Structure

bin/play.ts              # Entry point
src/
  adapters/openai.ts     # OpenAI API adapter (o4-mini with reasoning)
  game/
    engine.ts            # Core game loop
    state.ts             # Game state management
    voting.ts            # Vote tallying and elimination
  players/
    ai-player.ts         # AI turn/vote logic
    human-player.ts      # Human CLI input handling
    personalities.ts     # AI personality definitions
  prompts/system.ts      # System prompt builder
  types/                 # TypeScript interfaces
  ui/
    input.ts             # CLI prompts
    renderer.ts          # Colored terminal output

Tests

License

MIT