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
