🐝 Create powerful, collaborative AI applications.
Project description
🐝 Welcome to Beehive!
Beehive is an open-source framework for building AI agents and enabling these agents to cooperate with one another to solve tasks. This project was heavily inspired by the awesome work at Langgraph, CrewAI, and PyAutogen.
We're still in the early stages — expect breaking changes to the API. Any and all feedback is welcome! If you notice a bug or want to suggest an improvement, please open a Github PR.
Why use Beehive?
In traditional software applications, the chain of actions taken by the application in response to user input is hardcoded. Any "reasoning" that these applications employ (e.g., if the user does "X", do "Y", otherwise do "Z") can be traced to a few lines of code.
On the other hand, agents rely on a language model to decide which actions to take and in what order. Unlike traditional software applications, where the sequence of actions is predefined in the code, the language model itself is the decision-making engine.
Beehive, in particular, is great for rapidly creating complex chat patterns between agents (or invokables, in Beehive nomenclature). This includes:
- Sequential chats
- Hierarchical chats
- Multi-agent collaboration / debates
- Nested patterns
In addition, Beehive shares many features with other popular agentic frameworks:
- Loops and conditionals between agents
- State management
- Streaming support
- Memory / feedback
Installation
You can install Beehive with pip
:
pip install beehive-ai
Note that the Python OpenAI client is included in the standard Beehive installation.
Creating your first Beehive
Let's create the following Beehive:
This simple Beehive instructs two agents to work together to create a new language:
linguist_agent = BeehiveAgent(
name="Linguist",
backstory="You are an expert in linguistics. You work alongside another linguist to develop new languages."
model=OpenAIModel(
model="gpt-4-turbo",
),
)
linguist_critic = BeehiveAgent(
name="LinguistCritic",
backstory="You are an expert in linguistics. Specifically, you are great at examining grammatical rules of new languages and suggesting improvements.",
model=OpenAIModel(
model="gpt-4-turbo",
),
)
beehive = Beehive(
name="LanguageGeneratorBeehive",
backstory="You are an expert in creating new languages.",
model=OpenAIModel(
model="gpt-4-turbo",
),
execution_process=FixedExecution(route=(linguist_agent >> linguist_critic)),
chat_loop=2,
enable_questioning=True,
)
beehive.invoke(
"Develop a new language using shapes and symbols. After you have developed a comprehensive set of grammar rules, provide some examples of sentences and their representation in the new language.",
pass_back_model_errors=True
)
Note that this Beehive uses two BeehiveAgents
, which are one of the more basic invokable constructions. You can scale up the complexity by creating Beehives within Beehives ("nesting") or using more complex invokables, e.g., BeehiveEnsembles
or BeehiveDebateTeams
.
Documentation
Please check out the documentation here to get started!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file beehive_ai-0.0.2.tar.gz
.
File metadata
- Download URL: beehive_ai-0.0.2.tar.gz
- Upload date:
- Size: 549.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3286635eed670c5b1fe290d9c07f800ab6d47db0962e83389edf7b2ef67f917 |
|
MD5 | 5967fe3f8b90361a97bb806c357c9d00 |
|
BLAKE2b-256 | 1dccaed4cf444db4eb1277016a0db1cebc6d99916d4c63c2e3d9127a595a1e6c |
File details
Details for the file beehive_ai-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: beehive_ai-0.0.2-py3-none-any.whl
- Upload date:
- Size: 581.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b7998b07b87c81e15be85e49cfdd799d0dd9b068fb61bd8809c9cd823250988 |
|
MD5 | ead3c37d4b8e05997df10c677bff63bd |
|
BLAKE2b-256 | 80c8444575c3412615597a0c81bd5f86d81e50075f009dd50c4a9867681f8958 |