Creating an IVE – Part IV: Plotting, scheming, making plans

In this blog series, we will show you how to create an intelligent virtual entity (IVE) that can monitor your social media channels — such as Facebook, LinkedIn, or Twitter — and react to positive or negative posts about your products. To that end, we will need to set up the IVE and teach it to run a sentiment analysis on any social media post mentioning one of your products or brands.

In this part of the series, we will take a look at the IVE’s planning capabilities.

What I need…is a plan

Once the IVE has decided on a goal, it’s time to get to work actually achieving it. As with every goal (however ambitious), it is paramount to have a decent plan for reaching it. The same holds true for our IVEs. In the IVE’s world, the way it goes about reaching a goal depends on its own current needs and the state of the world around it. There are always multiple ways to go about solving a problem or, in this case, attaining a goal. The IVE’s planning module is responsible for choosing the best way to reach a goal given the current set of circumstances.

The planning module examines the IVE’s goal and comes up with several different plans to achieve it. It then proposes the best one (i.e. the one with the lowest required effort) to the IVE’s cognition model for execution. A finished plan consists of a sequence of actions that the IVE can execute in a certain order. Once the final step of the plan has been executed, the goal is attained…or is it?

What if the world has changed?

Plans can be quite complex and dozens, if not hundreds, of steps might be needed for the IVE to reach its goal. As you might imagine, there is a good likelihood that the IVE’s world will change while the IVE is carrying out the plan. And those changes might well make the original plan obsolete. If the new circumstances make it impossible for the IVE to reach its goal with the current plan, we wouldn’t want it to keep working away at a futile mission. And it won’t!

To keep the IVE from plugging away at an impossible task, the planner module revalidates the plan before the IVE executes each new step. It takes the IVE’s updated knowledge about the world around it and analyzes it to see whether the goal can still be reached with the current plan.

If the plan is obsolete, it then checks to see if the goal can be reached at all.  If the goal is still attainable, a new plan is devised and the IVE sets about completing it. If the goal cannot be reached at all anymore, the IVE needs to come up with a new goal.

But there is yet another aspect to all this…

Inferring opportunities and threats

Not every change in the IVE’s world makes it harder to reach its goals. Some changes might actually prove a boon and shorten the time needed to achieve a goal. These are known as opportunities, and the IVE uses inference to identify them. Just as the planning module re-verifies that the current plan is still valid, it also analyzes each new bit of information about the IVE’s world to see if any of it will provide an opportunity that can be exploited. If it finds one, it updates the plan accordingly so the IVE can reach its goal more quickly.

Of course, things can also go the other way. Some changes go beyond “bad” or “problematic”— they might be downright catastrophic. When the IVE infers that a change in its world could pose a threat, it pauses the current plan to react to the emergency directly.

The threat must be dealt with before the IVE can do anything else. So, if it identifies a threat, it injects a new top-priority goal of resolving it. As always, a plan to achieve this new goal is created, regularly re-evaluated and executed. Once the threat has been eliminated, the IVE returns to the original goal, checks it for validity, and gets back to work.

Building blocks of a good plan

The mechanism we use to define, verify and execute plans is called an HTN (Hierarchical Task Network). HTNs are a powerful way for AI entities to handle planning  and allow very complex goals to be resolved into working plans.

Our planning module offers a noteworthy special feature: a concept called “delayed gratification.” Essentially, our planner is able to accept setbacks in the short run to gain an advantage later on. This allows the planner to be far more effective, achieving goals more quickly in general and attaining goals that other planning systems would have difficulty achieving at all.

As the designer of a world model, you are not stuck with a “planning black box”. Rather, you have fine-grained control over how the planner works and how it achieves goals. This gives you a great deal of power to create IVEs that are capable of achieving extremely complex goals. And you can do all that visually in the NXS Editor.

Up next: The IVE and its workplace.