Behavior Tree Back-Chaining Construction
also known as ABT back-chaining, back-chained agentic behavior tree construction
Build an agentic behavior tree by working backwards from the goal. Start at the goal. Add an action whose result meets the goal. That action has its own needs, so add actions that meet those needs. Keep going until every leaf is something you can run directly. Behavior trees give you tidy, modular control flow. Working backwards (back-chaining) means every node is there for a reason, not bolted on by hand. Leaves mix LLM calls and tool calls. The tree itself becomes the record of how the agent's behaviour was put together.
Methodology process overview
Intent. Build a behavior tree where every node exists only because it helps meet its parent's needs, so there are no dead branches and no hand-bolted structure.
When to apply. Use this when you need structured agent control flow that mixes LLM nodes and tool nodes: game-like worlds, multi-step task agents, or involved workflows. It helps most when a prompt-only agent has turned into spaghetti. Don't apply it for a simple straight-line pipeline or a single-shot prompt, where a tree is just overhead. Skip it too when the task is truly open-ended exploration that you cannot break into goals.
Inputs
- Goal specification — The end state the agent must reach, written as a condition you can check true or false.
- Action inventory — The candidate actions: LLM prompts, tool calls, and sub-agents. Each one lists what it needs before it runs and what it makes true after.
Outputs
- Agentic behavior tree — A runnable tree. The root is the goal. The leaves are real LLM or tool actions. Every node is there because back-chaining put it there.
- Pre/post-condition map — For each node, what must be true before it runs and what it makes true after. This is the contract the tree was built against.
Steps (6)
State the goal as a root precondition
Write the agent's end goal as a condition to satisfy. That condition becomes the precondition of the root node.
Find actions whose post-conditions satisfy the parent
Search the action inventory for actions whose result makes the parent's condition true. Each one you find becomes a child node.
Recurse on each child's preconditions
Treat each child's needs as new sub-goals and repeat. Stop when an action's needs are already true at the start or are easy to observe.
Choose composite node types
For each non-leaf node, pick how its children combine. Use a sequence when all must happen, a fallback when they are alternatives, and parallel when they are independent.
Validate the tree end-to-end
Walk the tree from the leaves up. Check that each node's children together make its condition true. Trim or fix any branch that does not.
Framework-specific instructions
Pick a framework and generate a framework-targeted rewrite of this methodology's steps.
Choose framework
AI-generated for Agent Development Kit (ADK) (Google) — verify against official docs.
Principles
- Every node exists because it meets its parent's need. No bolt-on nodes.
- Before and after conditions are real contracts, not comments.
- Pick the composite node on purpose: sequence for all-of, fallback for one-of, parallel for independent.
- Leaves mix LLM and tool calls. Behavior trees are not LLM-only.
Known failure modes (2)
Related patterns (5)
- ·Agentic Behavior Tree
Borrow the behavior-tree formalism: leaves are LLM calls or tools that return success/failure; a tree of selectors and sequences orchestrates 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.
- ★★ReAct
Interleave a single thought, a single tool call, and a single observation per step so the agent reasons over fresh evidence.
- ★★Tool Use
Let the LLM produce typed calls against an external toolkit instead of producing free-form text the surrounding system has to parse.
- ★★Goal Decomposition
Decompose a goal into sub-goals recursively until each leaf is directly actionable.
Related compositions (1)
Related methodologies (2)
- Agentic Workflow Construction★★
Make agent authors name the four parts and the freedom level before they code, so a failure points to one part instead of smearing across a vague agent.
- SPAR Agent Loop Design★
Give every agent the same four named phases, Sense, Plan, Act, and Reflect, so behaviour, traces, and failures line up with a phase instead of hiding in one murky loop.
Sources (2)
AI Agents in Action
Ch 6 'Building autonomous assistants', §6.5 'Building ABTs with back chaining' “6.5 Building ABTs with back chaining”
"AI Agents in Action" book: A Deep Dive into the Future of Intelligent Systems
“Agentic Behavior Trees (ABTs) sequence a series of nodes that consist of LLM calls and tool use”
Provenance
- Added to catalog:
- Last updated:
- Verification status: verified