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.2.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dendron-0.2.0-py3-none-any.whl (54.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dendron-0.2.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for dendron-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fda0e4369b767a3b35016be4b5ee49507e6f0181bdec0ae4287b322dc50f5668
MD5 081af9b39d9e9f5bbe9075001be18874
BLAKE2b-256 cece09b5367c4b8c58dcd34fa8d98cf64e36984c3712bb0353c095090a520c82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dendron-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 54.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for dendron-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 717c6e664e9949b4c12145c5f183093fb4d25c6f6921679a3d69b7381b11c334
MD5 40b2b2248ce6764554dc446355b994ad
BLAKE2b-256 f20e7fb9d86e2aa8cf63461460ad746c94bfc39bbfe659d7982484d1d1f7c6d7

See more details on using hashes here.

Supported by

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