
Ventute
AI Business Simulator
Hey Indie Hackers :)
I’ve been working as a solo builder on Ventute — an asynchronous, AI business simulation platform.
The main idea behind Ventute is to move beyond static spreadsheets and simple if-then loops, by creating dynamic economic environments where autonomous AI agents run companies, compete for market share, and you make financial decisions, and react to market shocks in real time
Building a complex multi-agent economy sounds great on paper, but it immediately introduces a massive engineering bottleneck: state drift, race conditions, and non determinism
Here is how I approached the architecture and what I learned along the way.
The Problem: When AI Meets Simulation Engines
Traditional business simulators either rely on oversimplified formulas or fail when scaling complex interactions.
When you introduce LLM driven agents into a simulation, things get even more chaotic:
AI decisions are inherently non deterministic, and they can loose context
Order of execution matters: if Engine A (Demand) runs before Engine B (Supply Chain) in one turn, after in the next, the entire economy breaks
Debugging broken states or financial balance sheets becomes impossible without reproducible history.
The Solution: Architecture Highlights
To solve this, I built the entire system (~104k+ lines of code across 389+ modules) around a strict architectural guarantee: total determinism.
Event-Sourced Kernel & Bit-Exact Replay: All non deterministic elements (AI decisions, clock reads, RNG) are isolated into a single resolution step recorded into an event log. The state reduction itself (
fold(events) -> state) is 100% pure and context-free. Any historical turn can be rerunned bit for bitTopological Dependency Resolution: Ventute consists of 24+ domain engines (Macroeconomics, HR, Double-Entry Finance, Supply Chain, Demand..). Instead of guessing execution order, engines declare their state read/write dependencies. So at registration time, the kernel derives the exact execution sequence using a topological sort
Native Rust Compute Extension: Python with FastAPI and SQLAlchemy handles the core domain logic, but for parallel Monte-Carlo forecasting rollouts, I embedded a native Rust extension (via PyO3 + Rayon). This offloads heavy compute off the Python GIL while preserving determinism invariants
Key Lessons Learned
Never let AI manage state directly: Treat LLMs as actors submitting intent events, never as state engines. The state and economic logic must be guarded by strict, immutable system laws.
Build for determinism from Day 1: Automated golden test suites that compare event log outputs saved hundreds of hours of debugging.
Keep engine boundary explicit: Type contracts (Pydantic v2) and pure state reducers make long-term refactoring painless even as the project scales past 100k lines.
Current Status & What's Next
Ventute is live and continuously evolving. I'm currently refining the multi agent market dynamics and preparing new updates.
I’d love to get your thoughts:
Have you faced non determinism or state synchronisation issues when integrating AI agents into long running tasks/simulations?
How do you approach testing complex state machines in your own projects?
Would love to hear feedback, or questions from fellow builders
Thanks!
About
Ventute solves state consistency and scaling issues in AI driven business simulations. It lets me tackle complex backend architecture and low latency engine design from first principles

Comment