Types of AI Agents

Reactive Agents

13m read

Reactive Agents

Reactive agents are the simplest form of AI agent. They operate entirely in the present moment: they perceive the current state of the environment, apply a set of condition-action rules, and respond immediately — without planning ahead, maintaining history, or reasoning about future consequences.

The Reactive Architecture

In a reactive agent, there is a direct mapping from perception to action:

Input (environment state) → Rule matching → Action

No internal model of the world is maintained between steps. The agent processes each input fresh, which makes reactive agents fast and predictable, but limited in what they can handle.

# Simple rule-based reactive agent example
class ReactiveAgent:
    def __init__(self):
        self.rules = [
            (lambda state: "error" in state.lower(), self.handle_error),
            (lambda state: "question" in state.lower(), self.answer_question),
            (lambda state: "calculate" in state.lower(), self.run_calculation),
        ]
        self.default_action = self.generic_response

    def act(self, environment_state: str) -> str:
        for condition, action in self.rules:
            if condition(environment_state):
                return action(environment_state)
        return self.default_action(environment_state)

    def handle_error(self, state: str) -> str:
        return "I detected an error condition. Triggering error recovery procedure."

    def answer_question(self, state: str) -> str:
        return "Answering the detected question..."

    def run_calculation(self, state: str) -> str:
        return "Running the requested calculation..."

    def generic_response(self, state: str) -> str:
        return "Processing input..."

LLM-Powered Reactive Agents

Modern reactive agents often use an LLM as the condition-matching and action-generation engine rather than explicit rules. The LLM reads the current input and produces an immediate response — no multi-step reasoning, no tool use, no memory lookup.

This is effectively how basic chat completions work: input → LLM → output. The "rule matching" is done implicitly by the model's weights rather than by explicit if/then logic.

Strengths of Reactive Agents

Speed: No planning overhead means sub-second response times. For customer service bots or real-time notification systems, this matters.

Simplicity: Reactive agents are easy to reason about, test, and debug. You know exactly what inputs trigger what behaviors.

Predictability: The same input always produces (roughly) the same output. This makes reactive agents safe to deploy in regulated environments.

Low cost: No multi-step LLM calls means lower API costs per interaction.

Weaknesses of Reactive Agents

No memory: Each response is generated from scratch. The agent cannot say "as I mentioned earlier" or build on previous discoveries.

No planning: Reactive agents cannot break a complex task into subtasks. If a task requires three sequential actions, a reactive agent cannot execute them autonomously.

No learning from mistakes: If the agent's response was wrong, it has no way to notice and correct itself on the next step.

When Reactive Agents Are the Right Choice

Despite their limitations, reactive agents are the right tool for many real-world applications:

  • FAQ bots: Most customer questions fit a pattern. A reactive agent with a good knowledge base handles them faster and cheaper than a planning agent.
  • Monitoring alerts: "If CPU > 90%, send an alert" is a reactive pattern that doesn't need sophisticated reasoning.
  • First-pass triage: A reactive agent can categorize incoming support tickets, escalating complex cases to a planning agent.
  • Real-time applications: Anything requiring < 200ms latency (voice assistants, live coding suggestions) needs reactive architecture.

The key insight is that reactive agents and planning agents are not mutually exclusive — the best production systems often use reactive agents as the first line of response and escalate to more capable (but more expensive) agents for complex cases.