Description
Bonsai is an open source Rust implementation of behavior trees, with Python bindings, for building deterministic AI. A behavior tree is a data structure that sets the rules for how behaviors happen and in what order; each node is a process that reports Success, Failure or Running, and parent nodes use that signal to choose what to run next. This makes complex systems modular and reactive, which is why the approach has spread from game programming to robotics and other AI fields. Bonsai provides the usual building blocks, such as Sequence, Select, If, Invert, AlwaysSucceed, Timeout and While. The Rust crate is published on crates.io and added through Cargo.toml, while the Python package is on PyPI as bonsai-bt with examples in the bonsai-py folder. The repository includes concepts, examples and a development guide.…
Highlights
- Behavior trees in Rust with Python bindings
- Sequence, Select, If, Invert, Timeout, While and more
- Success, Failure and Running node signals
- Available on crates.io and PyPI (bonsai-bt)
- Examples and a development guide
Ratings & Reviews
No ratings yet
Be the first to rate Bonsai.
People also visit
Bonsai FAQ
What is Bonsai?
A Rust library for behavior trees, used to build modular, reactive and deterministic AI, with Python bindings.
How do I add it to a Rust project?
Bonsai is on crates.io; add it as a dependency in your Cargo.toml.
Can I use it from Python?
Yes. Install bonsai-bt from PyPI; examples are in the bonsai-py folder.
Which node types are available?
The README covers Sequence, Select, If, Invert, AlwaysSucceed, Timeout and While, among others.
What are the best Bonsai alternatives?
Popular alternatives to Bonsai include Rustcrab, Rosa and Bespoke Automata. See all Bonsai alternatives




