Live Architecture Neighborhoods Ralph v1 Archive → GitHub →
v2 shipping · 3 areas proven behind green gates · v1 archived at v1.qtown.ai · current status →

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 a polyglot microservices rewrite across 9 components (8 services + dashboard) and 12 languages — and it's now delivering. Three areas are proven end-to-end behind green CI gates: the Market (Go order book, measured 2.16 ms placement p99, real gRPC→Kafka settlement), the Academy (grounded RAG over the town's own docs with a recall@k gate), and the Tavern (real-time Kafka→Redis→WebSocket gateway with a live end-to-end gate). Two cross-service flows work: NPCs hold AI-generated conversations grounded in real town events. The remaining neighborhoods are honestly still in flight — each ships as fact only once its gate is green. See the current status.

194 Stories shipped
420 Files
12 Languages
88% AI-written

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's areas are proven in CI; this live view swaps to v2 once its services are hosted.

Tick
Day
Weather
Time
Total Gold
Population
50×50 World Map — Terrain
Active NPCs
Name Role Gold Hunger Energy Happy Age
Loading...
Data from 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  │
            └─────────────────────┘
gRPC
Service-to-service Protobuf definitions, type-safe contracts
Kafka
27 topics Event backbone, npc_id partitioning
GraphQL
Client gateway Single query fans out to 5 services
Postgres
Shared database Per-service schemas, pgvector for RAG

9 components. Each one is meant
to prove a technology works.

Python Real · gated

Town Core

Simulation engine. 30-second tick loop, 50+ NPCs deciding on needs, goals, and relationships. Now also originates market orders over gRPC, triggers NPC dialogue, and emits town events for the AI layer to ground on.

FastAPI · SQLAlchemy · Postgres
Go Proven · 6/6

Market District

Concurrent order book with real-time settlement. A real gRPC PlaceOrder → in-memory match → single-sided trade.settled on Kafka, proven by a live end-to-end CI gate. Measured 2.16 ms placement p99 at ~42k rps.

gRPC · order book · Kafka settlement
Rust In flight

Fortress

Event validation in safe Rust with a WASM sandbox boundary — every Kafka event meant to pass type-level guards before it can modify state. The validation subsystem is being reconciled and doesn't compile yet, so it ships dormant, not green.

Rust · WASM · serde
Python Proven · 6/6

Academy

Grounded RAG over the town's own docs via local Ollama + pgvector. Answers cite their sources — never a fabricated fact — and a deterministic recall@k gate guards retrieval quality in CI. NPC dialogue is grounded in real town events, not generic roleplay.

Ollama · pgvector · recall@k gate
TypeScript Proven · 6/6

Tavern

Real-time gateway: consumes town events off Kafka, fans them out over Redis pub/sub (single path, multi-instance), and pushes them to browser WebSocket channels — proven by a live Kafka + Redis end-to-end gate. Memory + a social graph are the next layer.

Fastify · WebSocket · Redis pub/sub
Python In flight

Library

Vector-based knowledge retrieval over town lore. The search + index pipeline is still being verified and has no gRPC surface yet — in flight, not gated.

Elasticsearch · embeddings · search
TypeScript In flight

Cartographer

GraphQL gateway meant to fan one dashboard query out to the backing services. The gRPC federation is currently a stub, so the dashboard reads each service's own read-model directly for now — gateway wiring in flight.

Apollo Server · gRPC federation
Python In flight

Asset Pipeline

Generative sprite/asset pipeline on ComfyUI. Batch generation runs on the GPU box; cross-service wiring (topics, triggers) is in flight, not gated.

ComfyUI · Kafka · rembg
Vue/Nuxt Real · gated

Dashboard

The window into the town — PixiJS isometric renderer, Chart.js analytics. Per-area proof panels render real, dormant-safe data (or an honest '—' when a service is down), each with an in-app "how it works" teaching layer.

Nuxt 3 · PixiJS · proof panels

Ralph 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
1,451 Commits in v1
510 Stories completed
2.5/day Average velocity
$0 Cloud LLM cost

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.

9 components. 12 languages. Kafka + gRPC between them. Every claim ships as fact only once its CI gate is green — three areas are there now, the rest in flight. v1 is archived; v2 is shipping.