Digital-twin platforms are usually enterprise products with enterprise pricing. WorldSim AI is the opposite: a free, MIT-licensed, agent-based simulation platform with real-time 3D visualization, machine-learning forecasting, and distributed scaling — clone it and run it on your own machine with one Docker command.
Try it: git clone https://github.com/rudra496/worldsim-ai && cd worldsim-ai && docker-compose up --build, then open http://localhost:3000. Source: github.com/rudra496/worldsim-ai.
What it does
WorldSim AI lets you model, predict, and optimize real-world systems — smart cities, factories, energy grids, logistics networks — as living simulations rather than static diagrams.
Agent-based modeling
Four agent types (Vehicle, Human, Machine, EnergyUnit) move and act through rule-based or probabilistic behaviors, coordinated by an autonomous multi-agent system: Planner, Predictor, and Optimizer agents cooperate through an AgentCoordinator. The world itself is a 2D grid or graph with 8 zone types — residential, industrial, commercial, road, park, power plant, water treatment, warehouse — and tracked resources (energy, water, materials, bandwidth).
The AI layer
- Forecasting: a PyTorch LSTM predicts time series, with a NumPy fallback when PyTorch is not installed.
- Anomaly detection: an unsupervised autoencoder flags drift and outliers.
- Optimization: scipy linear programming allocates resources; a greedy priority scheduler orders tasks.
- Reinforcement learning: a Gymnasium-compatible environment ships with PPO and Q-learning agents, closing an adaptive loop of simulation → prediction → optimization → correction.
Real-time 3D and data ingestion
The React + Three.js frontend (React Three Fiber) renders zones and agents in interactive 3D — orbit, pan, zoom, a day/night cycle, and a seamless 2D ↔ 3D switcher. On the data side, WorldSim ingests live input from MQTT (IoT sensors), CSV/JSON/JSONL files, REST polling, or its own synthetic simulator with noise, drift, and failure injection, and raises CRITICAL/WARNING/INFO alerts.
Distributed simulation and digital-twin sync
A multi-node engine scales horizontally with grid-based spatial partitioning, threshold-based load balancing, and gRPC messaging (dataclass serialization — no protoc needed). Digital-twin modes cover live mirroring, historical replay, or a hybrid of both, with GIS integration: GeoJSON loading, coordinate transforms, and ray-casting geofencing. A hot-reloadable plugin system ships with logging, Prometheus metrics export, and Slack notification plugins, plus a REST + WebSocket connector with API-key auth, role-based access control, and token-bucket rate limiting.
Stack and links
Python 3.10+ / FastAPI backend, React 18 + Three.js frontend, NumPy, optional PyTorch, Docker-ready, MIT licensed. Released as v0.1.0 and archived on Zenodo (DOI 10.5281/zenodo.22118796).
- GitHub: https://github.com/rudra496/worldsim-ai
- Docs and quick start: see the README for the one-command Docker start and the Python-only demo path (
python run_demo.py)
If you build a city, a factory floor, or an energy grid on it, the Discussions tab is open — feature requests and PRs are welcome.

Comments(0)
Join the discussion securely with your ZyVOP account.
Continue on ZyVOP to CommentNo comments yet. Be the first to comment!