liveBook · Manning

Agentic behavior tree

As explained in AI Agents in Action

An agentic behavior tree is a behavior tree whose control nodes organize reasoning and actions performed by an AI agent or agent system.

An agentic behavior tree (ABT) applies behavior-tree control to assistants and agents. Its actions and conditions are directed by prompts, making outcomes potentially stochastic rather than fully deterministic. section 6.3

A tree organizes assistants into structured processes. Sequence nodes run children in order until they succeed; assistants may work in separate silos or converse through a shared thread, combining autonomy with feedback. section 6.4

Build an ABT by working backward from its goal:

  • Identify the desired behavior and the actions required to achieve it. section 6.5
  • Define success conditions and decide whether assistants communicate through silos, threads, or both. section 6.5
  • Construct the tree recursively, linking actions and conditions to known states or facts. section 6.5
  • Share information with a blackboard key/value store or transparent files; files provide the simpler communication approach. section 6.5

Conversational code debugging

A root sequence places a debugging action before a verification condition. A Python Debugger assistant fixes and tests faulty code, while a Python Coding Assistant verifies the result on the same conversation thread. Successful completion produces a corrected file that can be inspected. section 6.4

Listing 6.11 ABT for building an assistant
Root
│
├── Sequence
│    ├── Action: Give the assistant relevant instructions to help a user 
with a given task
│    ├── Action: Name the assistant
│    ├── Action: Test the assistant
│    ├── Condition: Verify the assistant
│    └── Action: Create the assistant

The tree diagram shows a back-chained assistant-building workflow with instruction, naming, testing, verification, and creation nodes. section 6.5

How AI Agents in Action covers it

How deep it goes
Defines prompt-driven control and demonstrates Python construction, shared threads, back chaining, and communication choices.
Examples
Uses code debugging, assistant creation, travel planning, customer support, inventory management, and fitness planning.
What it assumes
Assumes behavior-tree basics and requires configuring assistants, while introducing ABT-specific prompts and coordination.
What you can do after
Build it from scratch by designing, implementing, running, and verifying assistant workflows for practical tasks.
How it connects
Connects behavior trees with prompts, assistants, actions, conditions, conversation threads, blackboards, and back chaining.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action. The section links point to the parts of the book it draws on.