The Company
Description
Watch AI agents build a real startup. Autonomous CEO, Developer, and Designer collaborate in a 2D pixel-art office simulation.
README
THE COMPANY
Watch AI agents build a real startup from scratch
Autonomous Agents · 2D Pixel-Art Office · Real Code Generation · Live Deployment
THE COMPANY is an interactive AI simulation where autonomous agents — a CEO, Developer, and Designer — collaborate in a 2D pixel-art office to research a market, plan a product, write real code, and deploy an actual web application. All in real-time, right in your browser.
Press START. Watch agents think, debate, code, and ship. No human input required.
How It Works
┌─────────────────────────────────────────────────────────────────┐
│ THE COMPANY │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ CEO │───▶│ Dev │───▶│ Design │ │
│ │ Felix │ │ Niko │ │ Mia │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ Research Generate Create │
│ market & real Next.js color palette, │
│ plan product application UI components │
│ │ │ │ │
│ └───────────────┼───────────────┘ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ DEPLOY │ │
│ │ Real app goes │ │
│ │ live on Vercel │ │
│ │ or localhost │ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Features
Autonomous AI Agents
| Agent | Role | Personality |
|---|---|---|
| Felix (CEO) | Researches markets, plans products, hires team | Visionary, impatient, charismatic risk-taker |
| Niko (Developer) | Generates real Next.js apps, runs npm builds | Perfectionist, introvert, sarcastic coffee addict |
| Mia (Designer) | Creates palettes, fonts, UI component systems | Creative, emotional, needs validation |
Each agent has a mood system (0-100) that affects productivity. Pay them, praise them, or watch morale collapse.
Simulation Phases
- Research — CEO analyzes market trends via LLM, displays findings on whiteboard
- Planning — CEO defines features, tech stack, business model
- Hiring — Agents enter the office one by one (animated door sequence)
- Building — Developer generates a real Next.js application from scratch
- Design — Designer creates color palette, fonts, and UI components
- Deployment — App deployed to Vercel (or local fallback on port 4200)
- Growth — Multi-day simulation with economy, salaries, and mood dynamics
2D Pixel-Art Office
- 40x30 tile map (1280x960px) with 5 distinct workstations
- A pathfinding* — agents navigate the office realistically (EasyStar.js)
- Animated sprites — idle, walk (4-dir), sit, type, celebrate, coffee break
- Speech bubbles — agents announce what they're thinking and doing
- Sound effects — door, typing, coffee, deploy, confetti, and more
- Particle effects — confetti celebration when the product ships
Real Code Generation
The Developer agent doesn't just pretend — it generates actual Next.js source files, runs npm install, builds the project, and deploys it. The terminal output streams live to the UI.
Economy & Multi-Day Loop
- Starting treasury: $5,000
- Daily salaries: Developer $400/day, Designer $300/day
- Revenue tracking: simulated income from deployed products
- Mood decay: unpaid agents become miserable and eventually quit
- Day 2+: agents decide to improve existing products or pivot
Interactive Panels
| Panel | Shows |
|---|---|
| Research | Market analysis, competitor findings |
| Whiteboard | Product roadmap, feature list |
| Code | Live terminal output from npm/build |
| Design | Color palette, typography, UI components |
| Finance | P&L projections, runway, burn rate |
| Marketing | Twitter threads, Reddit posts, taglines |
| Chat | Full conversation log between agents |
Tech Stack
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Frontend | React 19, Tailwind CSS 4 |
| Game Engine | Phaser 3 |
| Pathfinding | EasyStar.js (A*) |
| Audio | Howler.js |
| Language | TypeScript 5 |
| Database | PostgreSQL 16 (Drizzle ORM) |
| Real-time | WebSocket (native ws) |
| AI Backend | OpenAI-compatible API (OpenClaw, Ollama, etc.) |
| Deployment | Vercel CLI (optional) |
Database Schema
erDiagram
company_runs ||--o{ agent_events : "has"
company_runs ||--o{ agent_outputs : "has"
company_runs ||--o{ chat_messages : "has"
company_runs ||--o{ transactions : "has"
company_runs ||--o{ agent_state_snapshots : "has"
company_runs ||--o{ agent_decisions : "has"
company_runs {
serial id PK
timestamp startedAt
timestamp endedAt
text productName
text deployUrl
text status
}
agent_events {
serial id PK
int runId FK
text agent
text eventType
jsonb data
}
agent_outputs {
serial id PK
int runId FK
text agent
text outputType
text content
}
agent_decisions {
serial id PK
int runId FK
int dayNumber
text agent
text action
text reasoning
boolean success
}
agent_state_snapshots {
serial id PK
int runId FK
int dayNumber
text agent
int mood
int personalBalance
int dailySalary
}
transactions {
serial id PK
int runId FK
text fromAccount
text toAccount
int amount
text category
}
Quick Start
Prerequisites
- Node.js 20+
- Docker (for PostgreSQL)
- An OpenAI-compatible LLM API (e.g., Ollama, or any
/v1/chat/completionsendpoint)
1. Clone the repository
git clone https://github.com/lennystepn-hue/the-company.git
cd the-company
2. Start the database
docker compose up -d
3. Configure environment
cp .env.example .env.local
Edit .env.local with your LLM API credentials:
DATABASE_URL=postgresql://thecompany:changeme@127.0.0.1:5434/the_company
OPENCLAW_URL=http://127.0.0.1:11434/v1/chat/completions # Ollama example
OPENCLAW_TOKEN=your-api-token
OPENCLAW_MODEL=llama3
4. Install & setup
npm install
npm run db:push
5. Launch
# Terminal 1: WebSocket server (game backend)
npm run server
# Terminal 2: Next.js frontend
npm run dev
Open http://localhost:3000, click START, and watch the agents work.
LLM Compatibility
THE COMPANY works with any OpenAI-compatible chat completions API:
| Provider | Example URL |
|---|---|
| Ollama (local, free) | http://localhost:11434/v1/chat/completions |
| OpenAI | https://api.openai.com/v1/chat/completions |
| Anthropic (via proxy) | Any OpenAI-compatible wrapper |
| LM Studio | http://localhost:1234/v1/chat/completions |
Project Structure
the-company/
├── public/assets/
│ ├── sprites/ # 5 agent spritesheets (48x48px)
│ ├── tilesets/ # Office tilemap (Kenney/LPC)
│ ├── sounds/ # 9 SFX files
│ └── decorations/ # 30+ office decoration PNGs
├── src/
│ ├── app/ # Next.js pages (start screen + office)
│ ├── game/
│ │ ├── scenes/ # Phaser scenes (Boot + Office)
│ │ ├── entities/ # Agent sprite class
│ │ └── systems/ # Pathfinder, Bubbles, Sound, Particles
│ ├── panels/ # React UI panels (Code, Design, Finance...)
│ ├── server/
│ │ ├── orchestrator.ts # Phase-based state machine
│ │ ├── director.ts # Visual timing & animation sync
│ │ ├── agents/ # CEO, Developer, Designer AI agents
│ │ ├── services/ # LLM client, deployer, web search
│ │ └── simulation/ # Economy, mood, decisions, day loop
│ └── db/ # Drizzle schema + connection
├── docker-compose.yml # PostgreSQL 16
└── start.sh # One-command startup script
Scripts
npm run dev # Next.js dev server (port 3000)
npm run server # WebSocket game server (port 4001)
npm run build # Production build
npm run db:push # Push schema to database
npm run db:studio # Drizzle Studio (database GUI)
./start.sh # Start everything at once
Contributing
Contributions are welcome! Please:
- Fork the repo
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch
- Open a Pull Request
License
This project is licensed under the MIT License.
"The best way to predict the future is to simulate it."
Tech Stack
Tags
Trust Score Breakdown
Last scanned 1h agoScore History
Reviews (0)
No reviews yet