# mango

A lightweight, asyncio-based Python library for building and simulating multi-agent systems, aimed at researchers and engineers who need reproducible agent behavior and controlled experimental conditions.

mango (modular python agent framework) is a Python library built on asyncio for building and simulating multi-agent systems, targeting researchers and engineers who need reproducible agent behavior, structured agent architectures, and controlled experimental conditions without losing ease of prototyping. Agents are co-located inside containers that exchange local messages without serialization overhead, using a standardized FIPA ACL message envelope with built-in JSON and protobuf codecs, and communicate across process or machine boundaries over TCP sockets or an external MQTT broker.

Complex agent behavior can be factored into loosely coupled, independently testable role objects, and every agent subclasses a base Agent class that handles incoming messages and exposes lifecycle hooks for when it joins its container and when external messaging becomes safe. A `schedule_periodic_task` method registers a coroutine that runs on a fixed interval for polling or broadcasting.

A discrete-event SimulationWorld replaces the network layer with a clock-driven, deterministic execution model with configurable communication delay and loss and spatial environments, since running agents over a real network introduces timing variability that makes experiments hard to reproduce. It installs with `pip install mango-agents` and requires Python 3.10 or later.

Website: https://mango.offis.de/mango.py
