Skip to main content

A library for working with LLMs and behavior trees.

Project description

🌳 Dendron

Dendron is a library for building software agents using behavior trees and language models.

News

April 2024: New on arXiv: Behavior Trees Enable Structured Programming of Language Model Agents

Behavior Trees for Structured Programming of LLMs

Behavior trees are a technique for building complex reactive agents by composing simpler behaviors in a principled way. The behavior tree abstraction arose from Robotics and Game AI, but the premise of Dendron is that this abstraction can enable more sophisticated language-based agents.

Here is an example behavior tree that implements a chat agent. This agent listens to a human via microphone, performs automatic speech recognition (ASR), uses a chat model to generate a response, and plays the audio of that response using a text-to-speech (TTS) system. All locally, using models downloaded from Hugging Face:

image

You can build this agent by following the tutorial here.

Installation

To install Dendron, run

pip install dendron

This will automatically install torch, transformers, bitsandbytes, accelerate, and sentencepiece, and protobuf. You should consider installing and using Flash Attention, which is just a pip install, but has prerequisites that you should manually check. It's worth it though - maybe doubling your inference speeds.

Examples

For examples of basic language model node usage, see the example notebooks in this repository. For larger and more interesting examples, see the examples repo.

Documentation

You can find the main documentation for Dendron here. This includes a full tutorial building a chat agent that has text-to-speech and automatic speech recognition capabilities, and an API reference.

The Paper

If you use Dendron in academic research, please cite the paper:

@misc{kelley2024behavior,
      title={Behavior Trees Enable Structured Programming of Language Model Agents}, 
      author={Richard Kelley},
      year={2024},
      eprint={2404.07439},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}

Acknowledgements

This work was supported in part by the Federal Transit Administration and the Regional Transportation Commission of Washoe County.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dendron-0.1.6.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

dendron-0.1.6-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file dendron-0.1.6.tar.gz.

File metadata

  • Download URL: dendron-0.1.6.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for dendron-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d8d4110048b7b262b2b8f494a7bee5967694db05524ac222e3697a34f9d332ae
MD5 b4afce8461c2c4cbd2c017af5316f7ba
BLAKE2b-256 4aa40415406914ae02adfbb75790450905990972e653b7db0826a75c9e61c20f

See more details on using hashes here.

File details

Details for the file dendron-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: dendron-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for dendron-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 35551595de31fa883e0223a6c45ab488d9b1a9d3541d2ebf1300c56337a64ca9
MD5 e90e0e27c3ca7e9b28d0894453000509
BLAKE2b-256 1aabae652734b41fafeab11d40564f15851017e29fc9c858959744375022672e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page