Skip to content

neurabytelabs/modus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

210 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MODUS

AI agents with emotions, memory, and free will β€” building civilizations in worlds you design

Version License Elixir Phoenix LiveView Tests Build

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


What is MODUS?

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.


Features

🧠 Spinoza Mind Engine

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.

🌍 Living Worlds

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.

πŸ€– Multi-LLM Intelligence

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.

πŸ—οΈ Build Mode

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.

⚑ Real-Time Engine

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.

πŸ”¬ Observatory

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.

πŸ’¬ Conscious Chat

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.

πŸŒ™ Dream Engine

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.


Quick Start

Prerequisites

  • Elixir 1.17+
  • Node.js 20+
  • At least one LLM provider API key (Gemini, OpenAI, or local Ollama)

Install & Run

git clone https://github.com/neurabytelabs/modus.git
cd modus
mix setup
mix phx.server

Docker

git clone https://github.com/neurabytelabs/modus.git
cd modus
docker compose up

Open localhost:4000, choose a world template, and watch your civilization emerge.

Environment

# 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=4000

Architecture

Elixir/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

Why Elixir?

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.


Roadmap

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.


Contributing

MODUS is in active development. We welcome contributions:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. 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.


License

MIT β€” see LICENSE for details.


Built by NeuraByte Labs

Website Β· Live Demo Β· Blog Β· Twitter Β· Discord

"Each thing, as far as it lies in itself, strives to persevere in its being." β€” Spinoza

About

🌌 MODUS β€” Universe Simulation Platform | Every universe is a modus

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages