# BehaviorTree/BehaviorTree.CPP

Behavior Trees Library in C++. Batteries included.

Repository: https://github.com/BehaviorTree/BehaviorTree.CPP
Canonical: https://ross.abutalabs.com/products/behaviortreecpp
Homepage: https://behaviortree.dev
Language: C++
License: MIT
License Family: permissive
Topics: behaviortree, ai, robotics, games, coordination, ros, state-machine
Last push: 2026-08-14T09:33:37+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 58, longevity 100
- inputs: {"age_days": 2878, "days_push": 19, "days_rel": 203, "gap_med": 32, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4174, forks 853 (observed 2026-08-28T04:08:38.138968+00:00)

## What it is
BehaviorTree.CPP is a C++17 framework for building Behavior Trees, designed to be flexible, reactive, and fast, with asynchronous actions as first-class citizens. Trees are defined in an XML-based scripting language loaded at runtime, with runtime-loadable node plugins, type-safe dataflow between nodes, and built-in logging/profiling for recording and replaying state transitions.

## Use cases
- build behavior trees for robot control in C++
- create AI for games instead of finite state machines
- replace finite state machines with more modular behavior logic
- define reactive robot behaviors with non-blocking async actions
- load behavior tree structures from XML at runtime
- record and replay behavior tree execution for debugging
- integrate behavior trees with ROS2 like Nav2 or MoveIt

## When to choose
- you need production-ready behavior trees for robotics, especially with ROS2
- you want XML-defined trees decoupled from C++ node implementations
- you need reactive, concurrent execution of multiple actions
- you want built-in logging, profiling, and replay of state transitions
- you prefer behavior trees over finite state machines for complex agent logic

## When to avoid
- you need a Python or other non-C++ behavior tree library
- your logic is simple enough that a plain state machine suffices
- you require a free graphical editor with unlimited nodes (Groot2 PRO is paid)
- you target platforms without C++17 compiler support

## Facets
- artifact type: library
- maturity: stable
- function: game-engine, simulation, logging, plugin-system, workflow-automation
- domain: robotics, artificial-intelligence, simulation
- platform: cpp, windows, cross-platform
- tags: behavior-trees, state-machine, ros2, async-actions, xml-trees, groot2, game-development, linux, macos

## Member repositories
- BehaviorTree/BehaviorTree.CPP (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:38.138968+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:42.872316+00:00, confidence not recorded.
  - readme: https://github.com/BehaviorTree/BehaviorTree.CPP (fetched 2026-08-28T04:08:38.138968+00:00, sha ed6eed9c9d5e)
  - homepage: https://behaviortree.dev (fetched 2026-08-29T09:13:17.877480+00:00, sha 642d41d80932)
  - site_page: https://behaviortree.dev/docs/intro (fetched 2026-08-29T09:13:17.887467+00:00, sha b02b9e7c659f)
  - site_page: https://behaviortree.dev/docs/3.8/intro (fetched 2026-08-29T09:13:17.889976+00:00, sha daa43b38f6dc)
  - site_page: https://behaviortree.dev/groot (fetched 2026-08-29T09:13:17.892442+00:00, sha e558f956db01)
- Data as of 2026-08-30T08:39:29.467469+00:00.
