I have been exploring techniques for building larger programs with LLMs, and have found that behavior trees (from Game AI and Robotics) are a useful abstraction for building agents that use LLMs. I have collected some of the patterns I have found useful into an open-source library named Dendron (Ancient Greek for "tree").<p>I'm linking to the GitHub repo, and from there you can find a tutorial for building a fully local chatbot that uses text-to-speech and speech recognition. I believe that behavior trees can play a significant role in building more capable LLM agents, and I hope you find Dendron useful.