Vector Stream Systems logo Vector Stream Systems

Open source · Agent-based modeling · MIT licensed

Design systems that
surprise you

CAS Studio is an open-source studio for designing and simulating complex adaptive systems. Define agents with local rules, connect them, open the boundaries. Then watch emergence happen, measure it, and stress it. The seven properties of complexity are instrumented features, not marketing copy.

Live Demo Run it locally Star on GitHub Documentation

The seven properties, instrumented

Complexity you can measure

Emergence

Macro metrics (mean field, variance, active-cluster count, order parameter) are computed every step from micro interactions. Discontinuous macro shifts under constant inputs are flagged as emergence events, with the heuristic stated plainly.

Nonlinearity

Perturb any parameter by a ladder of deltas and compare response ratios. The sensitivity analyzer flags superlinear regimes, thresholds, and sign flips: where a nudge cascades and a shove fizzles.

Decentralization

Agents see only their own state, neighbor aggregates, and the shared environment. The rule DSL makes global state unrepresentable by construction. Order can only arise by self-organization, tracked with a Moran’s-I-style correlation metric.

Feedback loops

Elementary cycles in the interaction graph are enumerated and classified (reinforcing or balancing by negative-coupling parity) with loop gains and per-loop activity measured during each run.

Adaptation

Agent types can declare a target variable and learning rate. During a run, agents reinforce parameter nudges that move them toward the target and reverse ones that don’t, deterministic given a seed.

Open boundaries

Environments have sources and sinks; agents exchange conserved quantities with them through flux rules. Inject exogenous pulses mid-scenario to probe how the system absorbs shocks.

Nested hierarchy

Systems contain subsystems, which contain systems. Roll-up reports aggregate child runs into parent-level macro metrics, so you can study each level on its own terms.

How it works

A deterministic engine under an open API

Local-rule engine

Agents evaluate a small JSON rule DSL against a shared snapshot each step: synchronous updates, no order artifacts, seeded RNG. Same model plus same seed reproduces a run exactly.

FastAPI + SQL persistence

Every model, run, and analysis lives behind a REST API with SQLAlchemy persistence and Alembic migrations. Ships on SQLite; point DATABASE_URL at Postgres when you outgrow it.

MCP-native

A Model Context Protocol stdio server exposes the whole studio (build models, launch runs, pull emergence events and loop analyses) to AI hosts like Cursor and Claude Desktop.

Quickstart

From clone to cascade in a minute

git clone https://github.com/radsilent/cas-studio.git
cd cas-studio
./run.sh          # http://127.0.0.1:8000

The seeded innovation-diffusion market demonstrates the whole point: forty agents, reinforcing adoption loops, balancing skeptic loops, and an S-curve adoption cascade that fizzles if you remove a single innovator.

View the repository Talk to us