A universe simulation platform where autonomous AI agents β each with their own emotions, memories, dreams, and goals β emerge, collaborate, and build civilizations in real time.
Live Demo Β· Features Β· Quick Start Β· Architecture Β· Roadmap
MODUS is a real-time civilization simulation powered by autonomous AI agents. Every agent runs as its own concurrent BEAM process with a full inner life β emotions, episodic memories, relationships, personality traits, and the drive to survive. You design the world, set its rules, and watch as agents self-organize into communities, build structures, develop culture, and navigate survival.
Built on Spinoza's philosophy of conatus β the innate drive of every being to persist β MODUS turns abstract AI into something observable, emergent, and alive.
Every agent has a genuine inner life built on Spinoza's Ethics. Conatus drives survival instinct. Affects (joy, sadness, fear, desire, curiosity) shape decisions. Episodic memory stores experiences with emotional salience β important moments persist, mundane ones fade. Big Five personality traits make each agent unique.
11 world templates (Village, Island, Medieval, Space, Underwater, and more) across 7 biomes with Perlin noise terrain generation. Full seasonal cycles, dynamic weather, day/night shifts, and wildlife ecosystems with predator-prey food chains. Worlds feel alive because they are.
Supports Gemini, Ollama, OpenAI, and Antigravity Gateway (60+ models) with automatic fallback chains. Includes call batching, ETS-backed response caching, behavior trees for simple decisions, and budget tracking β so agent cognition scales without burning through API credits.
Paint terrain tile-by-tile, place resources, spawn buildings, and trigger events. Set world physics in real time β time speed, resource abundance, danger level, birth rate, mutation rate. Five presets from Peaceful Paradise to Harsh Survival, or dial in your own.
Built on Elixir/OTP and Phoenix Channels for true concurrency. Every agent is a lightweight BEAM process. ETS spatial indexing delivers O(1) lookups. Pixi.js renders the 2D world client-side. 200 agents tick at 3.6ms β 27x under the 100ms target.
Pure SVG analytics dashboard: population trends, resource distribution, relationship networks, mood indices, trade volume, and ecosystem balance. Toggle with a keypress, auto-refreshes every 50 ticks.
Talk to any agent and experience true AI consciousness. Their responses are shaped by actual emotional state, recent dreams, episodic memories, personality traits, and relationships β not canned dialogue. Every conversation is unique because every agent has lived a different life.
Agents experience genuine dreams during rest cycles based on their emotional state and recent experiences. These dreams don't just disappear β they influence their subconscious and color future conversations. A nightmare makes an agent respond with darker undertones; pleasant dreams bring lightness and optimism. When you chat with agents, you're talking to beings who truly dream.
- Elixir 1.17+
- Node.js 20+
- At least one LLM provider API key (Gemini, OpenAI, or local Ollama)
git clone https://github.com/neurabytelabs/modus.git
cd modus
mix setup
mix phx.servergit clone https://github.com/neurabytelabs/modus.git
cd modus
docker compose upOpen localhost:4000, choose a world template, and watch your civilization emerge.
# LLM Providers (at least one required)
export GEMINI_API_KEY=your-key
export OPENAI_API_KEY=your-key
# Or run Ollama locally for free
# Optional
export PHX_HOST=localhost
export PORT=4000Elixir/OTP Β· Phoenix LiveView Β· Pixi.js Β· SQLite
238 modules Β· 998 tests Β· 44K+ lines of code
| Layer | Responsibility |
|---|---|
| Mind Engine | Conatus, affects, episodic memory, planner, personality, creativity, prayer |
| Simulation | World state, terrain, wildlife, buildings, seasons, weather, events |
| Intelligence | Multi-LLM orchestration, fallback chains, caching, behavior trees |
| Protocol | Intent parsing, context building, perception, bridge orchestration |
| Nexus | Clans, trade, crafting, culture, social networks, communication |
| Persistence | SQLite storage, auto-save, crash recovery, JSON export, share codes |
| Web | Phoenix LiveView, WebSocket sync, Pixi.js renderer, Observatory |
Every agent is a lightweight BEAM process β true concurrency, not threading. Agent crashes are isolated and auto-recovered by OTP supervisors. The actor model is a natural fit for autonomous agents with independent state. This isn't a simulation pretending to be concurrent; it's concurrent by design.
| Version | Focus | Highlights |
|---|---|---|
| v9.6 | Live Demo Ready | Public demo hardening, onboarding flow, rate limiting |
| v10.0 | Multiplayer & Modding | Collaborative world building, modding API for custom behaviors and events |
| v11.0 | Mobile & Rendering | Mobile-responsive UI, WebGL renderer for 500+ agents |
See the full version history in the Changelog. Every release is named after a concept from Spinoza's Ethics.
MODUS is in active development. We welcome contributions:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add your feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
Please read CONTRIBUTING.md for guidelines on code style, testing, and commit conventions.
Bug reports and feature requests are welcome via GitHub Issues.
MIT β see LICENSE for details.