Alterlab Abm Mesa logo

Alterlab Abm Mesa

Organization
NVlabs
alterlab-abm-mesa

Builds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(seed=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite.

Overview

PublisherNVlabs
RepositorySkill2Env
Skill namealterlab-abm-mesa
Stars
189
Forks
18
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NVlabs on GitHub. Read the source before you install it.

Installation

Install the Alterlab Abm Mesa AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/NVlabs/Skill2Env/tree/main/SkillHub/skills/alterlab-abm-mesa
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NVlabs/Skill2Env.git /tmp/Skill2Env
mkdir -p .claude/skills
cp -r /tmp/Skill2Env/SkillHub/skills/alterlab-abm-mesa .claude/skills/alterlab-abm-mesa
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alterlab Abm Mesa in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alterlab Abm Mesa on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alterlab Abm Mesa is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent-Based Modeling with Mesa 3 — Micro Rules, Macro Emergence

Skill type: ANALYSIS MODULE. Builds ABMs where macro patterns emerge from local agent rules (Schelling segregation, opinion dynamics, diffusion, cooperation). The discipline: use the current Mesa 3 API, and treat the model as a generative explanation that must be validated (swept, replicated, compared to a target pattern), not a toy that merely runs.

Core Mission

THE MODEL IS A THEORY OF HOW MACRO EMERGES FROM MICRO. USE MESA 3 CORRECTLY, THEN VALIDATE.

When to Use This Skill

  • "Build an agent-based model / Mesa model of [segregation, diffusion, opinion, cooperation]."
  • "Simulate many interacting heterogeneous agents and watch what emerges."
  • "Do a parameter sweep over my ABM and collect outcomes."

Does NOT Trigger

The request is really about…Route toWhy not this skill
Discrete-event / queueing / process simulationalterlab-simpyEvent-driven processes, not interacting agents on a grid/network.
Reinforcement learning (an agent learning a policy)alterlab-stable-baselines3Policy optimization, not generative social simulation.
Whether ABM is the right method at allalterlab-ssci-design-gateDesign routing, upstream.
System-dynamics / ODE compartment modelsalterlab-statistical-analysisAggregate dynamics, not agent-level.

The Mesa 3 API (verified — do not ship Mesa 2 patterns)

Mesa 3 removed mesa.time schedulers (RandomActivation, etc.). Agents auto-register into model.agents; unique_id is auto-assigned; the model must call super().__init__(seed=...).

python
import mesa

class MoneyAgent(mesa.Agent):
    def __init__(self, model):                 # NO unique_id argument in Mesa 3
        super().__init__(model)
        self.wealth = 1

    def step(self):
        if self.wealth > 0:
            other = self.random.choice(self.model.agents)
            other.wealth += 1
            self.wealth -= 1

class MoneyModel(mesa.Model):
    def __init__(self, n=10, seed=None):
        super().__init__(seed=seed)            # mandatory in Mesa 3
        MoneyAgent.create_agents(self, n)      # bulk creation helper
        self.datacollector = mesa.DataCollector(
            model_reporters={"Gini": compute_gini},
            agent_reporters={"Wealth": "wealth"})

    def step(self):
        self.datacollector.collect(self)
        self.agents.shuffle_do("step")         # replaces RandomActivation
  • Scheduling: model.agents.shuffle_do("step") (random activation), model.agents.do("step") (fixed order), do("step") then do("advance") (simultaneous), model.agents_by_type[Type].shuffle_do("step") (staged). model.steps auto-increments.
  • Space: classic mesa.space.MultiGrid/SingleGrid/NetworkGrid (maintenance mode) with place_agent/move_agent; new cell space mesa.discrete_space.OrthogonalMooreGrid((w,h), torus=...) / OrthogonalVonNeumannGrid / HexGrid.
  • Batch sweeps: mesa.batch_run(MoneyModel, parameters={"n":[10,50,100]}, iterations=20, max_steps=100, data_collection_period=-1) → list of dicts.
  • Visualization: from mesa.visualization import SolaraViz, make_space_component, make_plot_component.

Full validated skeleton (Schelling + a network model), the space-API choice, and the validation checklist: references/mesa_patterns.md.

The validation discipline

An ABM that runs is not evidence. Report:

  1. Replication — multiple runs with different seeds; report the distribution of the macro outcome, not one run (fix seed= for reproducibility, vary it for the distribution).
  2. Parameter sweep — batch_run across the key parameters; show how the emergent outcome depends on them (phase transitions, tipping points).
  3. Pattern-oriented validation — does the model reproduce the target stylized fact it was built to explain (e.g. Schelling's high segregation from mild preferences)?
  4. Sensitivity — which assumptions drive the result; state them.

Output Template

MODEL:       <agents, their state, the local step rule; space = grid/network/none>
SCHEDULE:    <shuffle_do / do / staged> (Mesa 3 AgentSet)
MACRO OUTCOME: <the emergent quantity the DataCollector tracks>
VALIDATION:  <n seeds -> distribution; batch_run sweep; target pattern reproduced?>
CLAIM SCOPE: generative (a sufficient micro mechanism), NOT the unique/true mechanism

References

  • references/mesa_patterns.md — validated Mesa 3 skeletons (grid + network), space-API selection, batch_run sweep, validation checklist.

Part of the AlterLab Academic Skills suite.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alterlab Abm Mesa AI skill do?

Builds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(seed=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request ment...

Why use Alterlab Abm Mesa on TypingMind?

Because you install it once and use it with any model. Alterlab Abm Mesa is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alterlab Abm Mesa in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NVlabs/Skill2Env/tree/main/SkillHub/skills/alterlab-abm-mesa. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alterlab Abm Mesa?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alterlab Abm Mesa?

As many as you like. As long as a model supports skills, you can use Alterlab Abm Mesa with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alterlab Abm Mesa AI skill free?

Yes. It is published on GitHub by NVlabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇