Methodology · Agent Constructionemergingverified

Behavior Tree Back-Chaining Construction

also known as ABT back-chaining, back-chained agentic behavior tree construction

Applies to: agentmulti-agent-system

Tags: behavior-treeback-chainingabtgoal-decomposition

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 specificationThe end state the agent must reach, written as a condition you can check true or false.
  • Action inventoryThe 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 treeA 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 mapFor 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)

  1. 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.

  2. 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.

    usesAgentic Behavior TreeBehavior Tree Back Chaining

  3. 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.

  4. 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.

  5. Wire leaves to LLM calls and tool invocations

    Build each leaf as a ReAct-style LLM call, a tool call, or a sub-agent. Each leaf returns success, failure, or running, so the tree behaves correctly.

    usesReActTool Use

  6. 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)

Related compositions (1)

Related methodologies (2)

Sources (2)

Provenance

  • Added to catalog:
  • Last updated:
  • Verification status: verified