Skip to content

abtreeBehaviour trees for AI agents

Define agent workflows as YAML trees. The runtime hands the agent one step at a time, verifies the result, and persists the cursor — so workflows stay reproducible no matter how big they get.

abtree
from simple and ambiguousto complex and specific
simple and ambiguous
simple.yaml
seqDeploy_Service
├─ Run_Tests
├─ Build_Image
└─ Push_Image
complex and specific
deploy.yaml
seqDeploy_Service
├─ seqTest_Suite
│ ├─ Lint
│ ├─ Unit_Tests
│ └─ Integration_Tests
├─ selBuild_Strategy
│ ├─ Try_Cached_Build
│ └─ Full_Build
├─ parVerify
│ ├─ Smoke_Test
│ └─ Health_Check
└─ Push_Image
define a treethe agent drives execution
define a tree
deploy.yaml
name: deploy
version: 1.0.0
tree:
type: sequence
name: Deploy_Service
children:
-type: action
name: Run_Tests
steps:
-instruct: |
Run tests.
Store pass/fail at $LOCAL.tests_passed.
Store coverage percentage at $LOCAL.coverage.
-evaluate: |
$LOCAL.tests_passed is true.
$LOCAL.coverage is greater than $GLOBAL.threshold.
-type: action
name: Build_And_Push
steps:
-instruct: |
Build and push image to $GLOBAL.registry.
Store the pushed tag at $LOCAL.image_tag.
state:
local:
tests_passed: null
coverage: null
image_tag: null
global:
threshold: 80
registry: ghcr.io/my-app
the agent drives execution
terminal

What is abtree?

Modern LLMs follow Markdown instructions remarkably well — until workflows grow. Then two things go wrong:

  1. Instruction fatigue. A long system prompt loses focus. Agents skim, skip steps, hallucinate fields.
  2. Non-determinism. Decisions left to the model produce different paths on every run.

abtree is a CLI that solves both. You describe the workflow once as a YAML behaviour tree — the same formal structure game AI and robotics have used for decades. Your agent then drives the execution through three commands:

  • abtree next — ask the runtime what to do.
  • abtree eval — answer a precondition (true or false).
  • abtree submit — report the outcome of an instruction.

Every call returns JSON, advances the cursor, and persists the execution to disk. The agent only ever sees the next step. The path stays predictable. The state survives.

Get started in five minutes →

MIT licensed