Back to Catalog
Agentic AI
Planning & Control Flow
Behavior Tree Back Chaining
Construct an agent's behavior tree starting from the desired goal condition and recursively adding child nodes whose post-conditions satisfy each parent's pre-conditions.
Intent & Description
🎯 Intent
Construct an agent’s behavior tree starting from the desired goal condition and recursively adding child nodes whose post-conditions satisfy each parent’s pre-conditions.
📋 Context
A team is authoring an agentic behavior tree for a complex task. Authoring it forward — guess at the root, then the children, then leaves — leads to trees that look plausible but do not actually achieve the goal because pre-conditions of interior nodes are not satisfied by the children chosen.
💡 Solution
- Author the tree from the root downward by asking, for each new node: “What pre-conditions must hold for this to succeed, and what tasks produce those pre-conditions?” - Each task added becomes a child whose own pre-conditions trigger another round of back-chaining. - Recurse until pre-conditions are satisfied by the starting state. - Mechanical back-chaining yields broad trees; designers prune to the cases the agent will realistically encounter. - The discipline ensures every node’s children are there because they produce something the parent needs.
Real-world Use Case
- Authoring a behavior tree for a task with expressible pre/post-conditions.
- Forward-authored trees have been failing because pre-conditions were missed.
- The team values construction discipline over speed of first draft.
Source
Advantages
- Trees demonstrably achieve the goal because pre-conditions are satisfied by construction.
- Surfaces missing tasks as an obvious gap when a pre-condition has no producer.
- Trees evolve cleanly; new edge cases add a producer for a missing pre-condition.
Disadvantages
- Pre-conditions and post-conditions must be expressible — many real tasks have fuzzy conditions.
- Mechanical back-chaining produces wide trees that need pruning judgment.
- Authoring discipline costs up-front time vs intuition-driven sketching.