An autonomous town
where NPCs run
the economy.
v1 shipped: a Python monolith with 510 stories, 1,451 commits, 88% written by Ralph (an AI developer). v2 is being built right now — a polyglot microservices rewrite across 9 services and 12 languages. Each neighborhood will prove a different technology.
v1 is still running.
Live data below is from v1.qtown.ai — the v1 monolith preserved as a working archive. Every 30 seconds the v1 tick loop fires; NPCs make decisions, trade, gossip, and age. v2 will replace this once it's done.
| Name | Role | Gold | Hunger | Energy | Happy | Age |
|---|---|---|---|---|---|---|
| Loading... | ||||||
v1.qtown.ai/api/world · Refreshes every 30s
Polyglot microservices.
Each service earns its stack.
No technology chosen for show. Go for the order book because concurrency matters. Rust for the fortress because correctness matters. Python for AI agents because the ecosystem matters.
┌───────────────────────────────────────────────────────┐
│ Dashboard (Nuxt 3) │
│ qtown.ai — PixiJS + Chart.js │
└────────────────────────┬──────────────────────────────┘
│ GraphQL
┌────────────────────────┴──────────────────────────────┐
│ Cartographer (GraphQL Gateway) │
│ Apollo Server + TS │
└──┬──────┬──────┬──────┬──────┬──────┬──────┬─────────┘
│ │ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼ ▼
┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐
│Town ││ Mkt ││Fort-││Acad-││Tav- ││Lib- ││Asset│
│Core ││Dist ││ress ││emy ││ern ││rary ││Pipe │
│ Py ││ Go ││Rust ││ Py ││ TS ││ Py ││ Py │
└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘
└──────┴──────┴──────┴──────┴──────┴──────┘
Kafka
┌─────────────────────┐
│ Infrastructure │
│ Postgres · Redis │
│ Kafka · ES · Jaeger │
└─────────────────────┘
9 districts. Each one proves
a technology works.
Town Core
Simulation engine. 30-second tick loop. 50+ NPCs making autonomous decisions based on needs, goals, and social relationships.
FastAPI · SQLAlchemy · PostgresMarket District
Concurrent order book with real-time trade settlement. Goroutines handle parallel bid/ask matching. <5ms p99 at 10K orders/sec.
gRPC · goroutines · channel-basedFortress
Event validation with zero unsafe code. Every Kafka event passes through type-level guards before it can modify game state.
Actix · serde · zero-copy deserializationAcademy
Local AI agents via Ollama. NPCs learn skills, take courses, and generate knowledge. RAG pipeline over the town's history.
Ollama · pgvector · LangChainTavern
Social hub. Real-time WebSocket connections for NPC gossip propagation. Rumors spread across the social graph with decay.
Fastify · WebSocket · social graphLibrary
Vector-based knowledge retrieval. Town lore indexed with pgvector embeddings. NPCs query their own history.
pgvector · embeddings · semantic searchCartographer
GraphQL gateway. Single entry point for the dashboard — one query fans out to up to five services via schema stitching.
Apollo Server · schema stitchingAsset Pipeline
Background job processing with Celery. Sprite generation, map rendering, NPC portrait creation — all async.
Celery · Redis · image processingDashboard
Real-time visualization. PixiJS isometric renderer, Chart.js analytics, live NPC tracking. The window into the town.
Nuxt 3 · PixiJS · Chart.jsRalph wrote 88% of this.
An autonomous AI developer running local models via Ollama. No cloud APIs. No pair programming. Hand it a spec, come back to review the PR.
The Loop
// Ralph's core loop — simple by design
while stories_remaining:
story = worklist.next()
code = model.generate(story.spec)
result = test_runner.run(code)
if result.passed:
git.commit(story.id)
worklist.complete(story)
else:
code = model.fix(result.errors)
// retry until green or limit
v2 Model Lineup
| Tier | Model | Use Case |
|---|---|---|
| Primary | Qwen3-Coder-Next | Day-to-day code generation across all services |
| Heavy | Qwen 3.5:27b | Complex multi-file changes, architecture decisions |
| Debug | DeepSeek R1:14b | Error diagnosis, test failure analysis |
The code is open.
420 files. 12 languages. 27 Kafka topics. Every commit has a story ID. v1 is live; v2 is on the way.