Add hierarchical organization meta-agent example (Mesa 3.x compatible)#344
Add hierarchical organization meta-agent example (Mesa 3.x compatible)#344BittuAgarwal1237 wants to merge 6 commits intomesa:mainfrom
Conversation
|
The write up on this is overly AI generated heavy. Meta-agents never existed in Mesa 2, so the Mesa 3 syntax focus is irrelevant. What is the actual purpose of the model? |
|
Hey @tpike3 , thanks for the feedback — fair points, let me answer each one.
Happy to address any other questions, fix anything that needs changing, or add features if that would help , just let me know. i will be happy . |
@BittuAgarwal1237 Apologies I should have been more explicit, your readme should capture these ideas about the model. I would also get rid of the requirements.txt. All the requirement can be met with |
7901710 to
0587099
Compare
for more information, see https://pre-commit.ci
|
Done! Removed requirements.txt, updated the README with pip install mesa[rec] and added the model to the repo index. Let me know if anything else needs changing. @tpike3 Also working on a SEIR epidemic model with a vaccination policy meta-agent as a follow-up contribution , will open a separate PR soon. |
Overview
This example implements a three-level agent hierarchy:
Employees → Departments → Organization
The model avoids legacy scheduler APIs and instead uses explicit activation ordering to remain fully compatible with Mesa 3.x and future versions.
Motive
While working with mesa-examples in a clean environment, I noticed that:
Legacy scheduler usage is no longer applicable in Mesa 3.x
Activation semantics are not consistently illustrated
Visualization dependencies can be implicit
There are few examples demonstrating hierarchical/meta-agent patterns
This model aims to provide a clear, modern reference implementation for:
Explicit hierarchical activation
Meta-agent structuring
Solara-based visualization
Reproducible dependency declaration
Model Features
Hierarchical meta-agent structure
Adaptive performance threshold (scales with department size)
Damped workload adjustment (prevents oscillatory instability)
Additive policy intervention (avoids exponential morale growth)
External shock events with bounded impact
Workload clamping for stability
Parameter sliders for experimentation
Mesa 3.x compatible architecture
Stability Improvements (Compared to Initial Prototype)
The current version includes:
Damped feedback instead of abrupt threshold reactions
Additive (not multiplicative) policy adjustments
Bounded morale and workload dynamics
Controlled shock intensity
Adaptive performance targets
These changes were made to improve interpretability and prevent runaway oscillations.
Tested With
Mesa 3.3.x
Python 3.11
Happy to adjust structure, naming, or conventions based on maintainer feedback. Happy to learn from you.

Looking forward to your thoughts.