Beehave logo

Beehave

Community
jame581
beehave

Use when using the Beehave addon — pure-GDScript behavior trees with composites, decorators, leaves, a blackboard, and a visual runtime debugger

Overview

Publisherjame581
RepositoryGodotPrompter
Skill namebeehave
Stars
808
Forks
47
Bundled files
1
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.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Beehave 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/jame581/GodotPrompter/tree/master/skills/beehave
  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/jame581/GodotPrompter.git /tmp/GodotPrompter
mkdir -p .claude/skills
cp -r /tmp/GodotPrompter/skills/beehave .claude/skills/beehave
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Beehave 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 Beehave 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 Beehave 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.

Beehave

Related skills: ai-navigation for the movement leaves drive, state-machine for core-engine FSM, limboai for a heavier C++ BT+HSM alternative, godot-brainstorming for choosing an AI approach.

Addon: Beehave · version v2.9.2 · Godot 4.1+ · MIT · source: https://github.com/bitbrain/beehave · written in GDScript (no official C# API — this skill is GDScript-only by design).


1. When to use Beehave

ApproachBest for
Core-engine FSM (state-machine skill)Simple agents, < 5 states, no addon
Beehave (GDScript addon)Lightweight BT, GDScript-only projects, fast iteration
LimboAIBT and HSM together, visual editor, C++ performance, C# support (module build)

Choose Beehave when your project is GDScript-only, you want a behavior tree without a custom engine build, and you value a simple node-in-scene-tree authoring workflow. Beehave trees live entirely in the scene tree — every composite, decorator, and leaf is a regular Node child. For a heavier C++/C# solution with HSM integration, use the limboai skill instead. For plain state machines without a BT, use the built-in state-machine skill.

C# note: Beehave has no official C# API (zero .cs files in addons/beehave/). From C# you can call the GDScript API via Godot cross-language interop (GetNode<Node>(...).Call("tick", actor, blackboard)), but Beehave provides no typed C# classes.


2. Install & enable

  1. Godot AssetLib → search "Beehave" → Download → Reload project.
    Or copy the addons/beehave/ folder from the GitHub release into res://addons/beehave/.
  2. Enable the plugin: Project → Project Settings → Plugins → tick Beehave.
    Two autoloads are registered: BeehaveGlobalMetrics and BeehaveGlobalDebugger.
  3. Optional — copy script_templates/ from the addon into the project root for leaf scaffolding templates.

3. Tree composition

A Beehave tree is built from three kinds of nodes, all placed as regular scene-tree children:

RoleNodeBehavior
Tree rootBeehaveTreeTicks the child every frame (or physics/manual); extends Node (not BeehaveNode)
CompositesSequenceComposite, SelectorComposite, SimpleParallelComposite, …Flow control — AND / OR / parallel logic
DecoratorsInverterDecorator, CooldownDecorator, RepeaterDecorator, …Wrap one child to modify its result
LeavesActionLeaf, ConditionLeaf subclassesYour custom game logic

Composite quick reference

ClassLogic
SequenceCompositeAND — all children must succeed; fails on first failure
SequenceReactiveCompositeAND — re-evaluates from first child every tick while running
SelectorCompositeOR — succeeds on first success; fails if all fail
SelectorReactiveCompositeOR — re-evaluates from first child every tick while running
SimpleParallelCompositeRuns two children simultaneously; result follows primary (child 0)
SequenceRandomCompositeShuffled AND — executes children in random order
SelectorRandomCompositeShuffled OR — tries children in random order

Decorator quick reference

ClassEffect
InverterDecoratorFlips SUCCESS ↔ FAILURE; passes RUNNING through
AlwaysSucceedDecoratorForces SUCCESS; passes RUNNING through
AlwaysFailDecoratorForces FAILURE; passes RUNNING through
RepeaterDecoratorRe-runs child until it succeeds repetitions times
LimiterDecoratorCaps child to max_count running ticks, then FAILURE
CooldownDecoratorBlocks re-execution for wait_time seconds after child finishes
TimeLimiterDecoratorGives child wait_time seconds; interrupts if still running
DelayDecoratorWaits wait_time seconds before first executing child
UntilFailDecoratorLoops child until it returns FAILURE, then returns SUCCESS

Minimal scene-tree example

gdscript
# Scene tree:
#   Enemy (CharacterBody2D)
#     BeehaveTree               ← tick_rate = 1, process_thread = PHYSICS
#       SelectorComposite
#         SequenceComposite     ← "attack if in range"
#           IsInRangeCondition
#           AttackAction
#         PatrolAction          ← fallback

# BeehaveTree exports:
# @export var enabled: bool = true
# @export var tick_rate: int = 1          (1 = every frame; 3 = every 3 frames)
# @export var process_thread: ProcessThread = PHYSICS
# @export var blackboard: Blackboard      (auto-created if not set)
# @export_node_path var actor_node_path   (defaults to parent node)

# Access the tree from code if you need manual control:
@onready var bt: BeehaveTree = $BeehaveTree

func _ready() -> void:
    # Reduce tick cost: evaluate AI every 3 physics frames
    bt.tick_rate = 3
    # Default process_thread is PHYSICS — switch to IDLE if actor uses _process
    bt.process_thread = BeehaveTree.ProcessThread.IDLE

tick_rate note: tick_rate = 1 evaluates every frame; tick_rate = 3 every 3 frames. Increase for distant/background NPCs to save CPU. Default process thread is PHYSICS — if the actor script uses _process instead of _physics_process, set process_thread = IDLE to keep them in sync.


4. The leaf contract

Leaves hold your game logic. Subclass ActionLeaf for multi-tick work or ConditionLeaf for single-frame checks, then override tick(actor, blackboard).

gdscript
# IsInRangeCondition.gd
class_name IsInRangeCondition
extends ConditionLeaf

@export var detection_range: float = 150.0

func tick(actor: Node, blackboard: Blackboard) -> int:
    # Beehave types `actor` as Node; cast to your concrete type for 2D members.
    var body := actor as Node2D
    var target: Node2D = blackboard.get_value("target")
    if body == null or not is_instance_valid(target):
        return FAILURE
    var in_range := body.global_position.distance_to(target.global_position) <= detection_range
    return SUCCESS if in_range else FAILURE
gdscript
# AttackAction.gd
class_name AttackAction
extends ActionLeaf

@export var attack_duration: float = 0.5

func tick(actor: Node, blackboard: Blackboard) -> int:
    var elapsed: float = blackboard.get_value("attack_elapsed", 0.0)
    elapsed += get_physics_process_delta_time()

    if elapsed >= attack_duration:
        blackboard.erase_value("attack_elapsed")
        # `actor` is typed Node; guard game-specific methods (or cast to your actor type).
        if actor.has_method("play_attack_animation"):
            actor.call("play_attack_animation")
        return SUCCESS

    blackboard.set_value("attack_elapsed", elapsed)
    return RUNNING

func after_run(actor: Node, blackboard: Blackboard) -> void:
    # Clean up any per-run state when the tree interrupts this action
    blackboard.erase_value("attack_elapsed")

Return codes (defined on BeehaveNode):

  • SUCCESS — action complete / condition met.
  • FAILURE — action failed / condition not met; parent composite decides what to do next.
  • RUNNING — action needs more frames; tree will call tick() again next frame (ActionLeaf only — ConditionLeaf should never return RUNNING).

Optional overrides:

  • before_run(actor, blackboard) — called once before the first tick of a run.
  • after_run(actor, blackboard) — called when the child finishes (SUCCESS/FAILURE) or is interrupted.
  • interrupt(actor, blackboard) — called when the tree interrupts a running node.

5. Blackboard

The Blackboard node is a shared key/value store passed to every tick() call. BeehaveTree auto-creates an internal one if you don't assign an external Blackboard node.

gdscript
# Share one Blackboard across multiple BeehaveTrees on the same actor.
# Assign the same exported Blackboard node to each tree in the Inspector.

# Read / write from any leaf's tick():
func tick(actor: Node, blackboard: Blackboard) -> int:
    # Write
    blackboard.set_value("target", actor.get_nearest_enemy())

    # Read with default
    var speed: float = blackboard.get_value("move_speed", 200.0)

    # Conditional check
    if blackboard.has_value("stunned"):
        return FAILURE

    # Erase (sets key to null; has_value returns false after erase)
    blackboard.erase_value("temp_flag")

    return SUCCESS

Named namespaces: every method accepts an optional blackboard_name: String parameter (default "default"). Use this to keep separate namespaces on one Blackboard node without name collisions (e.g., per-enemy state vs. shared world state).

Built-in expression leaves: BlackboardSetAction, BlackboardEraseAction, BlackboardHasCondition, and BlackboardCompareCondition let you manipulate the Blackboard entirely via Inspector exports (no GDScript required). Expressions run via Godot's Expression.execute([], blackboard) — so you can call get_value("key") directly in the expression string.


6. Visual debugger

Beehave ships an EditorDebuggerPlugin that adds a 🐝 Beehave tab to the bottom editor panel while your game is running:

  1. Run the project from the Godot editor.
  2. Open the Debugger panel → click the 🐝 Beehave tab.
  3. Select a tree from the list to activate live visualization — active nodes are highlighted each tick.
  4. Optional: click the detach button to float the panel, or set Project Settings → beehave/debugger/start_detached = true to always start detached.

To track per-tree CPU cost in the Performance panel, set custom_monitor = true on the BeehaveTree node. This registers beehave [microseconds]/process_time_<actor_name>-<id> as a Performance monitor.

For a walkthrough of writing custom decorators and conditions, see references/custom-nodes.md.


Implementation checklist

  • addons/beehave/ copied into project; plugin enabled in Project Settings → Plugins
  • BeehaveTree added as a child of the actor; actor_node_path set (or left blank to default to parent)
  • process_thread matches actor's loop: PHYSICS for _physics_process, IDLE for _process
  • tick_rate tuned — increase for background NPCs (e.g., 3) to reduce per-frame cost
  • Every tick() override returns SUCCESS, FAILURE, or RUNNING — never void/null
  • ConditionLeaf subclasses never return RUNNING
  • Per-run state written to the Blackboard, not stored on the leaf node itself (leaf nodes are shared)
  • after_run or interrupt cleans up any Blackboard keys the action wrote
  • External Blackboard node exported and shared when multiple BeehaveTree nodes need the same data
  • Visual debugger checked at runtime to verify tick flow before shipping AI logic

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Beehave AI skill do?

Use when using the Beehave addon — pure-GDScript behavior trees with composites, decorators, leaves, a blackboard, and a visual runtime debugger

Why use Beehave on TypingMind?

Because you install it once and use it with any model. Beehave 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 Beehave in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jame581/GodotPrompter/tree/master/skills/beehave. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Beehave?

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 Beehave?

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

Is the Beehave AI skill free?

Yes. It is published on GitHub by jame581 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 👇