BotsOnRails was born out of a frustration with the challenges of building complex workflows involving large language models (LLMs), human interaction, and custom logic. As LLMs like GPT-3 and GPT-4 have become more powerful and accessible, there's been an explosion of interest in building applications that leverage their capabilities. However, building these applications often requires orchestrating a complex dance between AI-generated content, human review and approval, and custom processing logic.
Existing workflow orchestration tools, while powerful, often feel overly complex and rigid for these kinds of AI-driven workflows. They require a lot of upfront design and don't easily accommodate the kinds of dynamic, human-in-the-loop workflows that are common when working with LLMs.
At the same time, building these workflows from scratch using raw Python code quickly becomes unmanageable. The flow of data and control between different parts of the system becomes hard to follow, and it's easy for subtle bugs and inconsistencies to creep in.
BotsOnRails was created to provide a sweet spot between these two extremes. It offers a simple, flexible, and expressive way to define workflows as trees of nodes, where each node represents a single step or decision point. Crucially, it has first-class support for human interaction, allowing you to easily designate any node as a pause point for human review or approval.
- Tree-based orchestration: Define complex workflows as execution trees with nodes representing tasks or decisions.
- Human-in-the-loop: Seamlessly integrate human input and approvals into automated workflows.
- Dynamic routing: Route execution flow based on runtime data or conditions using functions or static mappings.
- Type checking: Ensure type safety and compatibility between nodes for robust execution.
- Visualization: Generate visual representations of your execution trees for analysis and debugging.
- Resumable execution: Restart or continue execution from specific nodes for iterative review and modification.
- Lightweight and flexible: Easy to integrate into existing projects and adapt to various use cases.
You need to install graphviz, which has different installation methods depending on your system.
We'd suggest using the .exe installer from the official graphviz website.
If you're using Ubuntu or another Debian derivative, try using apt like so:
sudo apt install graphviz
There are a number of ways to install graphviz on Mac. For example, you can use homebrew:
brew install graphviz
You can install the package directly from PyPi using pip:
pip install BotsOnRails
Check out our extensive documentation (still a work in progress).
We have a number of examples that illustrate how to build some common LLM-powered applications using BotsOnRails:
Contributions are welcome! Please see the contributing guidelines in the GitHub repository.
BotsOnRails is licensed under the MIT License.