🌳 Dendron
Dendron is a library for building artificial intelligence applications using behavior trees and large language models.
In the last few years, behavior trees have become popular in game AI development and robotics. This has happened because behavior trees make it easy to compose simple behaviors (pieces of code) into collections of complex behaviors. Behavior trees also naturally enable a high degree of code modularity and reusability that is beneficial for building AI systems that interact with the world in complex ways. On the other hand, large language models appear to be very powerful, but are not easily composable, either with other language models or classical software components. By making it easy to build behavior trees that integrate large language models, Dendron gives you the ability to easily build, use, and reuse sophisticated artificial intelligence programs.
Info
Never worked with behavior trees? We define them from scratch in Tutorial 1. Or you can find a more academic introduction in the arXiv paper that introduces Dendron: Behavior Trees Enable Structured Programming of Language Model Agents.
Installation
You can use pip
to install Dendron. For installation instructions, click here.
The Tutorial
For a tutorial overview of the library, click here. In the tutorial, you will use Dendron to build a chat agent that:
- Performs speech recognition from a microphone using a transformer-based ASR model.
- Handles chat template formatting for a quantized LLM.
- Generates speech from text using a transformer-based TTS model.
- Intelligently segments the chat output using rule-based AI to prevent overwhelming the TTS model.
- Uses another language model to classify user input to determine when it is socially appropriate for the language model to end the conversation.
The resulting behavior tree uses four different LLMs in five different ways, but can still be run on a single RTX 3090.
API Reference
For an API reference, see the menu to the left on this page.
The Paper
If you use Dendron in academic research, please cite the paper: