A Simple Autonomous AI Agent Framework: OODA + Planning

Leveraging the OODA decision cycle to create adaptive AI agents for dynamic environments

Alejandro López Correa

10/28/20244 min read

In this article, I will describe a possible framework for implementing an autonomous agent using a Large Language Model (LLM) as the foundation. This agent will be always active, ready to act according to the given directives. I will focus on the OODA decision-making process, initially developed for military contexts but effectively applicable to autonomous agents operating in civil and commercial environments.

The OODA cycle includes four steps: Observe, Orient, Decide, and Act, which are repeated continuously. This cycle allows our agent to remain always active and in constant adaptation to its environment. As an example, let us consider an agent designed to manage customer support on a company’s social media.

Step 1: Observe

The Observe step involves gathering information. The agent evaluates both its internal state and external events. The internal state includes available resources, schedules, and any other relevant elements for the agent’s operation. With this information, it can make decisions autonomously. Regarding external observation, information is obtained from commands provided by the supervisor and the state of the systems managed by the agent. This step not only acquires new information but also updates the existing information for the next cycle.

In our customer support example, the agent would gather information about the company, such as new product launches, updates to existing products, and marketing campaigns. Additionally, it would collect social media posts that mention the company or its products.

Step 2: Orient

In the Orient step, the agent analyzes the information gathered in the previous step. This analysis is carried out according to predefined objectives, which determine where the agent’s attention will focus. The goal is to preprocess and analyze the information so it can be used effectively in the next step.

Our public relations agent would analyze the new information to update the internal memory, recording details such as the list of products offered by the company, updates to each product (new versions, release notes, incidents), and more. Regarding social media posts, it would tag messages to identify their type (complaint, question, praise) and gather information about the author, such as comment history, the social network used, etc. The result of this analysis would generate a profile to characterize the user in question.

Step 3: Decide

The Decide step is where a decision is made based on the gathered and analyzed information. Here, the agent must generate an action plan consisting of a series of specific actions to execute. It is important to consider granularity: in certain scenarios, the agent can make instant decisions, while in others, the OODA cycle might run once a day. Additionally, these action plans may include actions focused on interacting with the agent’s external environment as well as actions intended to update long-term internal memory.

For our public relations agent, possible actions include posting messages on social media to announce product updates, responding to complaints or inquiries, or creating internal tickets. The goal of this step is to create a new action plan or update those already in progress.

Step 4: Act

In this step, the agent executes the planned actions. The ongoing plans contain a list of simple actions that need to be carried out. As many individual actions as possible will be executed within the assigned time, thereby ensuring the efficiency and responsiveness of the agent.

Action Planning

A plan consists of a sequence of simple actions that the agent can execute using the tools at its disposal. It can have multiple plans running simultaneously. In the Act step, one or more actions are executed, and the plan is updated with the result. To generate a plan, the process begins with a complex task, such as managing a post on social media.

With all the information processed in the Observe and Orient steps, a recursive decomposition process is carried out with the help of the LLM. If a task can be completed with a single action (e.g., publishing a post), the plan for that task is complete; otherwise, the LLM generates a list of simpler subtasks, and each one is processed in the same way. The result is a sequence of simple, executable actions that will solve the initial complex task.

Handling Failures

It is important to consider the possibility of failures. For example, the plan might require a response to a user’s post that never arrives. Each simple task must incorporate result validation, so that an alternative plan can be generated if any action fails. This adaptability is key to the agent’s reliability.

Conclusion

We have presented a general framework for implementing an autonomous agent with artificial intelligence using the OODA cycle. Although this outline is useful as a starting point, implementation is key: it is essential to design and maintain the data collection and processing process, as well as the tools assigned to the agent to perform its tasks. This type of agent has the potential to provide a significant competitive advantage in environments that require continuous adaptation and action. It frees human workers from the most tedious and repetitive aspects, instead putting them in charge of supervising and adjusting the process, maintaining the tools, and handling those incidents that the agent cannot manage.