// the find
Sollimann/bonsai
Rust implementation of behavior trees for deterministic AI (now with Python bindings)
Bonsai is a Rust behavior tree library aimed at game AI and robotics, covering the standard node types (Sequence, Select, While, WhenAll/Any, Race, After) plus async task dispatch. It's a continuation of the dormant `ai_behavior` crate with added Python bindings via PyO3 and a live visualizer.
Built-in telemetry and a live web visualizer so you can watch the tree execute in real time — rare for a BT library of this size. Python bindings are properly typed (.pyi stubs, py.typed marker, mypy strict tests), not just a thin ctypes hack. The async drone example shows a real pattern for long-running tasks without blocking the tick loop. CI is solid: separate workflows for Rust and Python wheels, codecov integration, and pre-commit hooks.
549 stars after what looks like several years means adoption is thin; you won't find community answers when you hit edge cases. The blackboard (shared state between nodes) appears to be a plain HashMap under the hood — no type safety, no scoping, which gets painful in large trees. Python bindings expose the core but the surface area is limited; anything not explicitly wrapped (custom events, dynamic subtree swaps) requires dropping to Rust. No persistence or serialization of tree state, so if your process crashes mid-execution you start over.