Encapsulating Reactive Behaviour in Goal-based Plans for Programming BDI Agents

Rafael H. Bordini, Rem Collier, Jomi F. Hübner, Alessandro RicciarXiv 2026

TL;DR

This paper proposes a major refinement to the Belief-Desire-Intention (BDI) agent architecture by allowing reactive behaviors to be encapsulated directly within goal-based plans. This shift from "flat" plan libraries to hierarchical, context-aware structures significantly improves code modularity and, surprisingly, boosts runtime performance by narrowing the search space for relevant agent actions.

What Problem Does This Paper Address?

In traditional BDI programming (like Jason or ASTRA), an agent’s "know-how" is stored in a plan library. These plans are typically triggered by two things: a desire to achieve a goal (proactive) or a change in the environment (reactive).

The authors identify two major pitfalls in this classic model:

  1. Lack of Encapsulation: Reactive plans are usually defined at the top level, independent of the agent's current goals. This makes it hard to track why an agent is reacting to something. For example, a robot reacting to a "low battery" event is doing so to maintain a "keep running" goal, but that link is often implicit in the code.
  2. Context Sensitivity: A subgoal might need to be pursued differently depending on which top-level goal triggered it. In flat libraries, managing this context requires messy "if-then" logic or redundant plans, leading to brittle and hard-to-maintain code.

Methods

The authors introduce a formal, language-independent extension to the BDI plan model. The core innovation is a hierarchical syntax where a plan for a goal $g$ can encapsulate:

  • A Body: A sequence of actions and subgoals to achieve $g$.
  • Sub-plans: Specific strategies for subgoals that are only relevant in the context of $g$.
  • Reactive Rules: Event-driven rules that only "fire" while the agent is actively pursuing goal $g$.

The abstract syntax for this model is shown below:

Abstract Syntax for the extended BDI model

To prove the concept, they implemented this model in two popular agent platforms, creating Jason(ER) and ASTRA(ER) (where ER stands for Encapsulated Reactivity). They also modified the standard BDI reasoning cycle to prioritize these encapsulated plans during the "plan selection" phase.

Datasets

The paper does not use traditional datasets. Instead, it evaluates the approach using a standard multi-agent benchmark: the Contract Net Protocol (CNP). In this scenario, an "initiator" agent announces a task, collects bids from "participants," and awards a contract. This is a perfect test case because the initiator must proactively manage the protocol while reactively handling incoming bids and refusals within a specific timeframe.

Key Insights and Ideas

  • Intentional Context: By nesting reactive rules inside a goal, the agent "knows" exactly why it is reacting. If it receives a bid, it processes it specifically because it is currently running a CNP.
  • Search Efficiency: In traditional BDI, every belief change forces the agent to search its entire plan library for a match. In the ER model, the agent first looks at the reactive rules encapsulated within its current intentions. This significantly reduces the number of plans the interpreter needs to evaluate.
  • Mutable Templates: The authors demonstrate a "Queue Processor" pattern. You can define a generic plan for processing a list of items and then "extend" it in a specific agent to handle different types of items (e.g., "buying apples" vs. "paying bills") by simply providing the specific reactive rules for those items.

Key Results

The experimental results show that the encapsulated model scales linearly and outperforms the traditional "flat" model in both Jason and ASTRA.

  • Jason(ER) vs. Jason: As the number of concurrent CNP sessions increases, Jason(ER) maintains a lower CPU overhead. The authors attribute this to the fact that the agent doesn't waste time checking irrelevant top-level plans for every incoming message.
Figure 2: Jason(ER) performance evaluation.
  • ASTRA(ER) vs. ASTRA: Similar gains were observed in ASTRA, confirming that the benefits of encapsulation are platform-independent.
Figure 3: ASTRA(ER) performance evaluation.

Limitations and Future Work

While the results are promising, the authors note a few areas for further exploration:

  • Complexity of Reasoning: While the search space is smaller, the logic for "dropping" achieved goals becomes slightly more complex because the interpreter must check goal conditions from the bottom to the top of the intention stack.
  • Broader Language Support: The model has only been implemented in Jason and ASTRA. Future work involves bringing these features to other BDI languages like Gwendolen or JACK.
  • Real-world Scaling: The benchmarks used (CNP and Queue Processing) are relatively clean. Testing the ER model in massive, messy industrial multi-agent systems is the next logical step to fully assess its practical impact.

Summary updated

Abstract

Reactive behaviour in BDI-based models and architectures adopted in agent programming is typically specified in terms of reactive plans not bound to any specific goal. In this paper, we present and discuss an extension of the plan model used in BDI programming languages in which goal-based plans encapsulate both proactive and reactive behaviour. This brings important benefits both to the practice of agent programming and in supporting agent reasoning at runtime. The paper first introduces the model formally, abstracting away from particular programming languages. The approach is then evaluated through concrete implementations based on two existing agent programming platforms, namely Jason and ASTRA. The paper reports on experiments showing that the approach provides for elegant programming and can also be efficient.
BibTeX
@misc{bordini2026encapsulating,
  author = {Rafael H. Bordini and Rem Collier and Jomi F. Hübner and Alessandro Ricci},
  title = {{Encapsulating Reactive Behaviour in Goal-based Plans for Programming BDI Agents}},
  year = {2026},
  eprint = {2611.23496},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23496},
}
Figure