01 / 08
CivilizationOS
Architecture
Everything runs inside one FastAPI process: an async tick engine, a world grid, citizens, councils, a NetworkX causal graph, the TCMF retriever and a 3-tier model router. No queue, no worker, no external database.
- Python, FastAPI, React, Three.js, NetworkX, Ollama/Gemini/OpenRouter
Citizens
Citizens with routines, conversations, relationships and episodic memory, streamed live over a WebSocket to every open tab.
- 10citizens
Councils
When a crisis is injected, five roles (Historian, Strategist, Skeptic, Predictor, Synthesizer) debate in sequence and the verdict is written back into the simulation as a new causal-graph node.
- 5councils
TCMF Memory
My first fusion formula multiplied the causal term to zero. The benchmark said so before anyone else could.
- 215tests benchmark
- TCMF retrieval fusing episodic memory with proximity over a causal graph, benchmarked against 6 baselines over 300 scenarios; the original multiplicative fusion scored recall@5 0.02 on the causal signal where that signal alone reaches 1.00; normalized additive fusion recovered it
Model Router
Three tiers: local Ollama first, then Gemini, then Claude or OpenRouter, so local development runs at $0 and the public demo at near $0.
- fine-tuned Qwen2.5-3B-Instruct with LoRA (PyTorch via Unsloth + TRL SFTConfig) on a synthetic council-debate dataset, exported to GGUF, and wired into the model router as a dedicated local persona model (civos-council); runs locally via Ollama, not the deployed API
Evidence
- 76tests api
- 215tests benchmark