liveBook · Manning

Back chaining

As explained in AI Agents in Action

Back chaining is a goal-directed reasoning technique that derives required subgoals, actions, and conditions by working backward from a desired outcome.

Back chaining is a goal-directed way to construct an autonomous behavior tree (ABT): begin with the desired behavior, then work backward to identify actions, conditions, communication patterns, and the required tree structure. section 6.5 section 6.7

A practical back-chaining workflow is:

  • Identify the goal behavior the agent must perform. section 6.5
  • Work backward to determine the actions that lead to the goal. section 6.5
  • Specify conditions required for each action to succeed. section 6.5
  • Choose how assistants communicate, then add action and condition nodes recursively until they connect to known states or facts. section 6.5

Building an assistant

For the goal “Create an assistant that can help me do {task},” the required actions are to create, verify, test, name, and instruct the assistant. These become nodes in an ABT, with verification represented as a condition. Assistants may share a message thread, while blackboards or files can communicate information between nodes. section 6.5

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

Inspect the assistant-building ABT as a compact tree showing its root, sequence, actions, and verification condition. section 6.5

How AI Agents in Action covers it

How deep it goes
Explains a stepwise construction process and illustrates it with an assistant-building tree.
Examples
Uses an assistant-building ABT and exercises for fitness-training and financial-advisor assistants.
What you can do after
Build it from scratch by translating an assistant goal into ABT actions, conditions, communication choices, and nodes.
How it connects
Connects back chaining with behavior trees, autonomous assistants, conditions, actions, blackboards, and communication patterns.

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.