A simulation environment built with Phaser where AI agents explore maps, interact with each other, and engage in autonomous conversations powered by the @chirper/agent package.
- AI-Powered Agents: Autonomous agents with persistent memory, relationships, and chat capabilities
- Interactive World: Navigate a Stanford Prison-themed map with regions, doors, and collision detection
- Real-time Conversations: Watch agents discover each other, start chats, and form relationships
- Pathfinding: Smart A* pathfinding with door state awareness
- Build Mode: Create and modify regions and doors in the simulation
- Responsive UI: HUD showing agent status, conversations, and world state
- Phaser 3.90: Game engine for rendering and physics
- React 19: UI overlay components
- TypeScript: Type-safe development
- @chirper/agent: AI agent system with plugins for memory, chat, movement, and relationships
- OpenRouter/DeepSeek: LLM backend for agent intelligence
- Tailwind CSS: Styling for UI components
- Node.js (see
.nvmrcfor version) - pnpm package manager
- OpenRouter API key
From the monorepo root:
pnpm installCreate a .env.local file in this directory:
cp .env.example .env.localAdd your OpenRouter API key:
VITE_OPENROUTER_API_KEY=your_api_key_here
Run the simulation in development mode:
pnpm devOpen http://localhost:5173 to view it in the browser.
Build for production:
pnpm buildsrc/
├── components/ # React UI components (HUD, overlays, dialogs)
├── managers/ # Agent manager for spawning and coordination
├── scenes/ # Phaser game scenes (Boot, Main)
├── services/ # Agent service integration with @chirper/agent
├── sprites/ # Phaser game objects (Agent, Door, Region)
├── store/ # State management (agents, chats, simulation)
├── utils/ # Utilities (pathfinding)
├── constants/ # Game constants and configurations
└── prompt/ # AI prompt templates for agent behavior
Agents use the @chirper/agent package with multiple plugins:
- MemoryPlugin: Form and recall memories of interactions
- ChatPlugin: Discover nearby agents and start group conversations
- MovePlugin: Navigate to different regions using pathfinding
- RelationshipPlugin: Track feelings toward other agents
- TimePlugin: Track time and schedule actions
See README-AGENT-SERVICE.md for detailed agent documentation.
- WASD / Arrow Keys: Move camera
- Space: Toggle pause
- Click Agent: View agent details
- B: Toggle build mode (doors/regions)