On the external concurrency of current BDI frameworks for MAS

Martina Baiardi, Samuele Burattini, Giovanni Ciatto, Danilo Pianini, Alessandro Ricci, Andrea OmiciniarXiv 2024 · DOI

TL;DR

This paper introduces a clear distinction between internal concurrency (how an individual agent manages its own goals and intentions) and external concurrency (how multiple agents are mapped onto underlying computational primitives like threads or event loops) within Multi-Agent Systems (MAS). By evaluating seven major Belief-Desire-Intention (BDI) frameworks, the authors reveal that external concurrency models are frequently hidden "under the hood," unnecessarily depriving developers of control over critical system properties like performance, determinism, and reproducibility.

What Problem Does This Paper Address?

In Agent-Oriented Programming (AOP), particularly within the Belief-Desire-Intention (BDI) model, agents are autonomous entities that perceive their environment, deliberate on actions, and execute plans concurrently. While a vast amount of literature focuses on how an individual agent schedules its internal intentions, very little attention has been paid to external concurrency—how the control loops of multiple agents are mapped onto the underlying operating system or platform abstractions (e.g., Java Virtual Machine threads).

Currently, most BDI frameworks hardcode or obscure this mapping. This opacity creates a significant challenge for engineers:

  • Simulation environments require strict determinism and reproducibility, which is ruined by the unpredictable thread interleaving of standard OS scheduling.
  • Production environments require high efficiency and parallelism to scale across multi-core processors.

Without the ability to configure external concurrency, developers cannot easily optimize their MAS for these contrasting use cases without rewriting the core framework code.

Methods

The authors tackled this problem by establishing a formal taxonomy of external concurrency models and evaluating existing BDI frameworks using a three-step methodology:

  1. Taxonomy Definition: They classified external concurrency into five primary patterns:
  2. One-Agent-One-Thread (1A1T): Each agent gets its own dedicated thread.
  3. All-Agents-One-Thread (AA1T): A single thread sequentially executes all agents using a custom scheduler (e.g., round-robin).
  4. All-Agents-One-Event-Loop (AA1EL): Agents are executed as tasks on a single event loop with a FIFO queue.
  5. All-Agents-One-Executor (AA1E): Agents are dispatched as tasks to a thread pool (fixed or variable size), decoupling agent count from thread count.
  6. One-Agent-One-Process (1A1P): Each agent runs in an isolated process, requiring serialization for communication.
  7. Empirical Evaluation: They built a synthetic "ping-pong" protocol benchmark where two agents rapidly exchange messages. By injecting a custom action (revealCurrentThread), they traced exactly which threads executed which agent intentions across different frameworks.
  8. Code Inspection & Maintainer Verification: They audited the source code of seven prominent, actively maintained BDI frameworks (Astra, Goal, Jadex, JaKtA, Jason, Phidias, and Spade-BDI) and contacted the maintainers to validate their findings.

Datasets

The paper does not use traditional datasets. Instead, the authors developed a open-source synthetic benchmark repository specifically designed to analyze thread allocation and interleaving in MAS frameworks.

Key Insights and Ideas

  • The Hidden Constraint: External concurrency and internal concurrency share a bi-directional relationship. If a framework forces a single-threaded external model (like AA1T), even a highly parallelized internal intention model will fail to achieve true speedups.
  • The Superiority of Executors (AA1E): The authors argue that the All-Agents-One-Executor model is generally superior to the traditional One-Agent-One-Thread model. AA1E decouples the number of agents from the number of system threads, preventing performance degradation when agent counts vastly exceed the number of physical CPU cores.
  • Architectural Separation is Key: The core recommendation of the paper is a strict separation of concerns: developers should write their MAS behavior specifications once, and be allowed to swap out the underlying concurrency model via a clean API depending on whether they are debugging, simulating, or deploying to production.

Key Results

The architectural analysis of the seven BDI frameworks yielded highly varied results regarding customizability (summarized in the paper's Table 1):

  • Highly Configurable: Frameworks like Jason and JaKtA treat the concurrency model as a first-class abstraction. Jason allows switching between 1A1T, AA1T, AA1E, and 1A1P by changing its underlying infrastructure configuration. JaKtA defaults to AA1T for reproducible debugging but natively supports switching to 1A1T or AA1E.
  • Hardcoded/Rigid: Goal and Phidias are strictly bound to the 1A1T model due to deep architectural integrations (e.g., Goal's integration with SWI-Prolog), making alternative concurrency models impossible to implement without major code rewrites.
  • Asynchronous by Design: Spade-BDI (built on Python's asyncio) natively leverages the AA1EL (Event Loop) model, making it highly efficient for I/O-bound tasks but rigid regarding thread customizability.

Limitations and Future Work

The authors acknowledge two main limitations:

  1. Scope of Frameworks: The study focuses on a relatively small, select group of well-established BDI frameworks. They plan to expand this inspection to non-BDI Agent-Oriented frameworks (such as JADE or SARL).
  2. Simplified Interaction Model: The ping-pong benchmark assumes message passing is an atomic, local operation. In real-world distributed systems, network latency and complex interaction protocols heavily intertwine with concurrency models. Future work will focus on exploring this interplay between concurrency and distributed agent interactions.

Summary updated

Abstract

The execution of Belief-Desire-Intention (BDI) agents in a Multi-Agent System (MAS) can be practically implemented on top of low-level concurrency mechanisms that impact on efficiency, determinism, and reproducibility. We argue that developers should specify the MAS behaviour independently of the execution model, and choose or configure the concurrency model later on, according to the specific needs of their target domain, leaving the MAS specification unaffected. We identify patterns for mapping the agent execution over the underlying concurrency abstractions, and investigate which concurrency models are supported by some of the most commonly used BDI platforms. Although most frameworks support multiple concurrency models, we find that they mostly hide them under the hood, making them opaque to the developer, and actually limiting the possibility of fine-tuning the MAS.
BibTeX
@misc{baiardi2024external,
  author = {Martina Baiardi and Samuele Burattini and Giovanni Ciatto and Danilo Pianini and Alessandro Ricci and Andrea Omicini},
  title = {{On the external concurrency of current BDI frameworks for MAS}},
  year = {2024},
  eprint = {2404.10397},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.10397},
}

Loading related content...

Figure