finds.dev← search

// the find

mesa/mesa

★ 3,687 · Python · Apache-2.0 · updated Jun 2026

Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.

Mesa is the Python equivalent of NetLogo for agent-based modeling — you define agents, give them rules, drop them in a spatial or network environment, and watch emergent behavior unfold. It's been around for a decade and is the de facto standard for ABM in Python. Aimed at researchers, academics, and anyone who needs to simulate systems where individual behaviors produce collective outcomes.

The AgentSet API is genuinely well-designed — filtering, selecting, and applying functions across agents is clean and doesn't require manual loops. The spatial primitives (grids, Voronoi, networks, continuous space) cover most real use cases without forcing you to write geometry from scratch. The Solara-based browser visualization works without fighting it — sliders, live plots, and spatial rendering all compose nicely. The bundled examples (wolf-sheep, Schelling, Sugarscape) are full implementations, not toy stubs, which makes them actually useful as starting templates.

Mesa 4 has been 'in active development' for a while with pre-releases but no stable release — if you're starting a project today you're choosing between a stable Mesa 3 or betting on a moving target. Performance hits a wall fast: 10k+ agents doing spatial lookups in Python is genuinely slow, and there's no built-in parallelism; serious simulations end up needing custom NumPy arrays or Cython anyway. The DataCollector API is functional but awkward — it pulls data via lambdas at step boundaries, which makes it hard to track event-driven state changes without contorting your model. GIS integration is listed as a topic but the actual spatial support for real-world coordinate systems is thin and lives in third-party extensions.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →