In artificial intelligence, reactive agents are autonomous systems that select actions based on current stimuli without relying on an internal model of the world. They are a key concept in reactive planning, a group of techniques for action selection that differ from classical planning in two ways: they operate in a timely fashion, coping with highly dynamic and unpredictable environments, and they compute just one next action at each instant based on the current context. The term reactive planning dates back to at least 1988 and is synonymous with the more modern term dynamic planning.
Reactive agents do not maintain a persistent internal state, such as a world model or memory of past events. Instead, they respond directly to sensor inputs or environmental cues, making them simple, fast, and robust in changing conditions. This contrasts with deliberative agents that plan sequences of actions using symbolic reasoning. Reactive agents are often implemented using reactive plans, which are stored structures describing the agent's priorities and behavior.
Reactive Plan Representation
Reactive plans can be represented in several ways, each requiring a basic representational unit and a means to compose these units into plans. Common representations include condition-action rules, finite-state machines, fuzzy logic, and connectionist networks.
Condition-Action Rules
A condition-action rule, or if-then rule, is a rule in the form: if condition then action. These rules are called productions. The meaning is straightforward: if the condition holds, perform the action. The action can be external (e.g., picking something up) or internal (e.g., writing a fact into memory or evaluating a new set of rules). Conditions are normally boolean, and actions are either performed or not.
Production rules may be organized in flat structures or hierarchies. For example, the subsumption architecture consists of layers of interconnected behaviors, each a finite-state machine that responds to appropriate input. These layers are organized into a stack, with higher layers subsuming the goals of lower ones. Other systems use trees or include mechanisms for changing which rule subset is currently most important. Flat structures are easy to build but allow only simple behavior or require complex conditions to compensate for lack of structure.
An important part of distributed action selection is conflict resolution, which resolves conflicts when multiple rules' conditions hold simultaneously. Methods include assigning fixed priorities, assigning preferences (as in the Soar architecture), learning relative utilities (as in ACT-R), or exploiting a form of planning. Expert systems often use simpler heuristics like recency, but guaranteeing good behavior in large systems with simple approaches is difficult. Conflict resolution is necessary only for rules that propose mutually exclusive actions.
Finite-State Machines
A finite-state machine (FSM) is a model of system behavior widely used in computer science. For agent behavior, a typical FSM consists of states and transitions between them. Transitions are condition-action rules of the form: if condition then activate-new-state. At each instant, only one state is active, and its transitions are evaluated. Transitions can also connect to the same state to allow executing transition actions without changing state.
Behavior can be produced in two ways: states can be associated with atomic actions (acts) or with scripts. An act is performed every time step the state is active. More often, each state is associated with a script describing a sequence of actions; if a transition activates a new state, the former script is interrupted and the new one starts. Complex scripts can be broken down into hierarchical FSMs, where states contain substates. Hierarchical FSMs are computationally equivalent to standard FSMs but facilitate design. An example is the use of hierarchical FSMs for computer game bots, as described by Damian Isla in 2005.
Fuzzy Approaches
If-then rules and FSMs can be combined with fuzzy logic, making conditions, states, and actions approximate and smooth rather than boolean. This results in smoother behavior, especially during task transitions. However, evaluating fuzzy conditions is much slower than evaluating crisp counterparts. Architectures like those proposed by Alex Champandard have explored this approach.
Connectionist Approaches
Reactive plans can also be expressed using connectionist networks, such as artificial neural networks or free-flow hierarchies. The basic unit has input links that feed abstract activity and output links that propagate activity to following units. Units act as activity transducers, typically connected in layered structures. Advantages include smoother behavior, adaptivity, and the ability to use inhibition for proscriptive description. Disadvantages include difficulty in designing behavior and limitations to relatively simple behaviors, especially when adaptivity is required.
Reactive Planning Algorithms
Typical reactive planning algorithms evaluate if-then rules or compute the state of a connectionist network. Some algorithms have special features. For example, the Rete evaluation algorithm uses a cache from the previous step to avoid re-evaluating all rules at every time step, improving efficiency. Scripting languages can also be used, where rules or FSMs are primitives of an architecture, allowing flexible and rapid development.
Applications and Significance
Reactive agents are widely used in robotics, computer games, and simulation systems where environments are dynamic and unpredictable. They are a foundational concept in artificial intelligence, contrasting with more deliberative approaches. The simplicity and speed of reactive agents make them suitable for real-time control, such as in autonomous vehicles and game characters. Research in this area has influenced fields like machine learning and neural networks, where connectionist reactive plans are implemented.
Limitations and Extensions
Reactive agents lack the ability to plan ahead or reason about long-term consequences, which limits their use in tasks requiring strategic thinking. However, they can be combined with deliberative systems in hybrid architectures. Extensions include hierarchical FSMs, fuzzy logic, and learning mechanisms to adapt behavior over time. The field continues to evolve with advances in deep learning and large language models, though reactive agents remain a distinct and practical approach for many real-time applications.