Skip to content

Orchestrating Skills

Agents need to know how to choose the right skill at the right time to accomplish the task in the environment. Selectors are the specialized supervisor skills that orchestrate the skills together, determining which skill to activate based on the conditions the system needs to respond to.

Skills can be arranged in sequences or hierarchies. Arrange skills in sequences when skills need to be accopmlished in a particular order to succeed at the task. For strategies --- tasks where different skills will be chosen depending on the scenario --- arrange the skills in hierarchies.

Learn more about orchestrating skills in Designing Autnomous AI.

Adding Selectors

You specify the structure of the skills in your agent in the add_selector_skill() method calls that add the selector skill to your agent. The demo agent that we are building has one selector skill:

python
agent.add_selector_skill(target_skill, [increment_skill, decrement_skill], fixed_order=False, fixed_order_repeat=True)

The first argument is the name of the selector skill, the second argument is a list of skills that the selector supervises.

Arranging Skills in Sequences

Sometimes skills must be executed in a specific order to perform the task well. If the child skills in your selector should run in sequence, set fixed_order=True in the add_selector_skill() method call. Each skill in a fixed order sequence must meet its success criteria before passing control to the next skill in the sequence.

Looping Skill Sequences

Sometimes skill sequences should be looped, like a walking gait. When walking we rotate through a fixed set of gait phases and those phases repeat. Set fixed_order_repeat=True in the method call to loop the skills.

Arranging Skills in a Hierarchy

To arrange the skills in a hierarchy, set fixed_order=False in the add_selector_skill() method call. The selector can select any child skill, in any order, at any time.

See the two skills examples for concrete variations of skill orchestration in agents.

Setting Goals for your Agent

You will learn more about setting goals for your agent in the next section.

While each skill in an agent has objectives to meet, the goals for an entire agent live in the top most selector for the agent. That top most selector is ultimately responsible for the behavior of all skills in the agent, so the goals for that selector should be the overall goals of the agent.