Behavior Trees logo

Behavior Trees

Community
kevinpbuckley
behavior-trees

Create, inspect, and edit Behavior Tree and Blackboard assets — composites, tasks, decorators, services, node properties, blackboard key bindings, key CRUD and metadata, tree round-trips and validation (BehaviorTreeService + BlackboardService). Use when the user asks to build a Behavior Tree, add BT nodes or decorators, bind blackboard keys, author a blackboard, or validate/repair a BT asset.

Overview

Publisherkevinpbuckley
RepositoryVibeUE
Skill namebehavior-trees
Stars
735
Forks
161
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by kevinpbuckley on GitHub. Read the source before you install it.

Installation

Install the Behavior Trees AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/kevinpbuckley/VibeUE/tree/master/Content/Skills/behavior-trees
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevinpbuckley/VibeUE.git /tmp/VibeUE
mkdir -p .claude/skills
cp -r /tmp/VibeUE/Content/Skills/behavior-trees .claude/skills/behavior-trees
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Behavior Trees in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Behavior Trees on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Behavior Trees is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

🧠 Brains complement: IF an unreal-engine-skills-manager tool (external MCP) exists in this session, call it with {action: "load", skill: "ai-and-navigation"} for UE domain knowledge on Behavior Trees — architecture, node semantics, best practices. If no such tool is available, skip this line entirely and proceed with this skill alone — do NOT attempt the call.

Behavior Trees Skill

Two services, reachable from Python (unreal.BehaviorTreeService.*, unreal.BlackboardService.*) and as AICallable tools:

BlackboardService     → UBlackboardData assets: create, key CRUD, metadata, re-parenting
BehaviorTreeService   → UBehaviorTree assets: structure, sub-nodes, properties, build, validate

Discover exact signatures with discover_python_class('unreal.BehaviorTreeService') — this skill teaches the concepts and the gotchas, not the call shapes.

The golden workflow

python
import unreal
BT = unreal.BehaviorTreeService
BB = unreal.BlackboardService

# 1. Blackboard first — key bindings resolve against the TREE'S board, so assign it at creation.
BB.create_blackboard("/Game/AI/BB_Guard")
BB.add_blackboard_key("/Game/AI/BB_Guard", "TargetActor", "Object")
BB.set_blackboard_key_object_class("/Game/AI/BB_Guard", "TargetActor", "/Script/Engine.Actor")

# 2. Tree on that board.
BT.create_behavior_tree("/Game/AI/BT_Guard", "/Game/AI/BB_Guard")

# 3. Structure. Every mutator returns the new node's PATH (or "ERROR: ...").
sel = BT.add_node("/Game/AI/BT_Guard", "Root", "BTComposite_Selector")          # Root/Selector[0]
seq = BT.add_node("/Game/AI/BT_Guard", sel, "BTComposite_Sequence")
wait = BT.add_node("/Game/AI/BT_Guard", seq, "BTTask_Wait")

# 4. Properties and bindings.
BT.set_node_property_value("/Game/AI/BT_Guard", wait, "WaitTime", '(DefaultValue=3.5,Key="")')
dec = BT.add_decorator("/Game/AI/BT_Guard", seq, "BTDecorator_Blackboard")
BT.set_node_blackboard_key("/Game/AI/BT_Guard", dec, "BlackboardKey", "TargetActor")

# 5. Verify.
print(BT.validate_tree("/Game/AI/BT_Guard"))   # [] == clean
print(BT.get_tree("/Game/AI/BT_Guard"))        # whole tree as JSON

Every mutator saves the asset itself — there is no separate "commit" step to forget. compile_and_save exists for re-running layout + save on a tree edited some other way.

Node paths — the addressing scheme

  • Root/Selector[0]/Sequence[1]/Wait[0] — segments are node TITLES with an index among same-named siblings. Root is a keyword (the graph root), not a title.
  • Sub-nodes: <owner path>/@decorator[n] / <owner path>/@service[n] — by slot, in order.
  • Paths are positional, not identities. Inserting/removing a sibling renumbers later ones; renaming a node changes its segment. Hold the node's guid (from GetTree/GetNodeInfo) across edits, and re-read GetTree after a rename. set_node_name refuses names the grammar cannot express (/, leading @, trailing [n]) — on both the direct route and via the NodeName property.

Things that are not obvious and will bite you

  • WaitTime and friends are structs. In UE 5.8 many numeric BT properties are FValueOrBBKey_*: pass '(DefaultValue=3.5,Key="")', not '3.5'. Read the current value first (get_node_property_value) and mirror its shape.
  • Blackboard key selectors are not values. Always set_node_blackboard_key, never set_node_property_value, for anything get_node_property_names flags bIsBlackboardKeySelector. The service validates the key's TYPE against the selector's filter up front — a mistyped binding would otherwise resolve, read back fine, and be silently cleared by the engine on the next save.
  • SimpleParallel has two fixed slots, not a child list: slot 0 = main task (tasks only), slot 1 = background branch. The engine refills an empty background slot with a Wait task on every save, so the background branch can only ever be REPLACED (add_node(parallel, cls, 1)), never removed or moved away.
  • Root-level decorators go on the top composite (the node under Root), not on Root itself — add_decorator(asset, "Root/Selector", ...) is the correct call and the refusal message on Root says so.
  • set_node_property_value verifies after the save. ValueAfterWrite is re-read from the asset, not echoed; if the engine rewrote the value at save time the call reports failure and tells you what is actually on disk. Trust it.
  • Injected nodes (from RunBehavior subtrees) are read-only everywhere. Edit the subtree asset.
  • Comments: set_node_comment writes the graph comment bubble — annotation only, survives GetTree→BuildTree round-trips. Use it to record WHY a subtree exists.

Round-trips, repair, safety

  • get_tree → edit the JSON → build_tree(target, json, bReplaceExisting) replays it through the ordinary mutators. One save per node/property — fine for tens of nodes, not a bulk-import path for thousands. With bReplaceExisting=true the result's PreReplaceSnapshot holds the target's previous tree; if the build fails midway, feed that snapshot back to build_tree to restore.
  • Composite (logic-operator) decorators cannot be recreated by BuildTree (editor-only sub-graphs; reported per-node) — author those in the BT editor.
  • Writes are refused while PIE runs, while an editor is open on the asset, and when the commit would destroy or crash on the runtime tree (sparse graph / instance-less root). Refusals name the mechanism and the fix; read them.
  • repair_graph_from_runtime_tree rebuilds a sparse editor graph from the runtime tree — explicit, never implicit. validate_tree is the read-only diagnostic sweep (orphans, broken key bindings at any nesting depth, empty composites, misplaced sub-nodes).

Blackboards beyond key CRUD

  • set_blackboard_key_instance_synced, set_blackboard_key_metadata (category + description), set_blackboard_parent (cycle- and shadowing-checked) — all post-creation editable.
  • find_blackboard_key_references(board, key) lists every BT selector bound to a key, formatted <btPath>:<node>.<property> — run it BEFORE remove_blackboard_key or rename_blackboard_key; rename returns the same list after the fact (those bindings broke).
  • SelfActor on a parent-less board is engine-persistent and cannot be removed.
  • Blueprint node classes (BTT_*, BTD_*, BTS_*) are created with the blueprints skill (parent class BTTask_BlueprintBase etc.); get_available_node_types lists them once they exist, and add_node resolves them by short name, _C name, or full object path.

Frequently asked questions

What does the Behavior Trees AI skill do?

Create, inspect, and edit Behavior Tree and Blackboard assets — composites, tasks, decorators, services, node properties, blackboard key bindings, key CRUD and metadata, tree round-trips and validation (BehaviorTreeService + BlackboardService). Use when the user asks to build a Behavior Tree, add BT nodes or decorators, bind blackboard keys, author a blackboard, or validate/repair a BT asset.

Why use Behavior Trees on TypingMind?

Because you install it once and use it with any model. Behavior Trees is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Behavior Trees in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kevinpbuckley/VibeUE/tree/master/Content/Skills/behavior-trees. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Behavior Trees?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Behavior Trees?

As many as you like. As long as a model supports skills, you can use Behavior Trees with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Behavior Trees AI skill free?

Yes. It is published on GitHub by kevinpbuckley under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇