DEV Community

Alain Airom
Alain Airom

Posted on

Impressive evolution of BeeAI

Image description

TL;DR — Introduction

Agents 🤖 are coming and they are almost everywhere!

IBM research has done an awesome job buy building and providing as open source the BeeAI framework. Until some few days ago, BeeAI framework was to be used by accessing different repositories to clone locally (or not) afor building ad-hoc use-cases. Now BeeAI has done a quantum leap and comes out as an “Open Platform”. 👏

First things first!

What is BeeAI?

BeeAI is an open platform to help you discover, run, and compose AI agents from any framework and language. Whether building your agents or looking for powerful existing solutions, BeeAI makes it easy to find, connect, and orchestrate AI agents seamlessly (description from the public GitHub repository).

Key features of BeeAI

🌐 Framework agnostic: Integrate AI agents seamlessly, no matter the language or platform.
⚙️ Composition: Build complex, multi-agent workflows from simple building blocks.
🔍 Discoverability: Explore a powerful agent catalog with integrated search.
🐝 BeeAI ecosystem: First-class support for Python and TypeScript agent developers via BeeAI Framework.

Installation

The setup and local configuration as a service is now sort of ‘industrialized’ I would say.

brew install i-am-bee/beeai/beeai
brew services start beeai

# Configure LLM provider:
beeai env setup

# Launch the web interface: (o yes :))
beeai ui
Enter fullscreen mode Exit fullscreen mode

I use it with Ollama and a llama LLM installed locally!
As I’m a lazy guy, I made a bash script to start/stop/… the service on my laptop!

#!/bin/bash

SERVICE_NAME="beeai"

if [ $# -eq 0 ]; then
  echo "Usage: $0 {start|stop|restart|info|kill}"
  exit 1
fi

case "$1" in
  start)
    brew services start "$SERVICE_NAME"
    ;;
  stop)
    brew services stop "$SERVICE_NAME"
    ;;
  restart)
    brew services restart "$SERVICE_NAME"
    ;;
  info)
    brew services info "$SERVICE_NAME"
    ;;
  kill)
    brew services kill "$SERVICE_NAME"
    ;;
  *)
    echo "Invalid argument: $1"
    echo "Usage: $0 {start|stop|restart|info|kill}"
    exit 1
    ;;
esac

exit 0
Enter fullscreen mode Exit fullscreen mode

Architecture of the tool

BeeAI enables a local-first experience, running all agents on your laptop for full data control and seamless integration with local inference engines like ollama.

The platform is made up of several core concepts as shown in the following diagram.

Image description

The UI, Tests and more…

I have tested my local framework with the by default examples, it’s great.

Image description

  • First test: agent test with out of the box example provided.

Image description

#Aider v0.77.1
# Model: openai/llama3.1:8b with whole edit format
# Git repo: none
# Repo-map: disabled

# To create a program that asks for a number and prints its factorial, I will:

# 1. Create a new Python script called `factorial.py`.
# 2. In this script, I will define a function to calculate the factorial of a given number.
#3. The function will use a loop to multiply all numbers from 1 up to the input number.


# Here is the updated file:

# factorial.py

def factorial(n):
    result = 1
    for i in range(1, n + 1):
        result *= i
    return result

number = int(input("Enter a number: "))
print(f"The factorial of {number} is: {factorial(number)}")

# Tokens: 609 sent, 142 received.

# factorial.py
# Applied edit to factorial.py
Enter fullscreen mode Exit fullscreen mode
  • 2nd test: documentation creation for code (out of the box).
# I don't see any source code provided. The assistant requires the source code to generate proper documentation. Please provide the code, and I'll be happy to help you with generating structured documentation.

# However, if you'd like, we can start from scratch. Here's a hypothetical example of Python code that calculates the factorial of a number:

# python
def calculate_factorial(num):
    """
    Calculates the factorial of a given number.

    Args:
        num (int): The input number for which the factorial is calculated.

    Returns:
        int: The factorial value of the input number.
    """
    if not isinstance(num, int):
        raise TypeError("Input must be an integer.")
    elif num < 0:
        raise ValueError("Factorial is not defined for negative numbers.")

    result = 1
    for i in range(1, num + 1):
        result *= i

    return result

def main():
    # Get user input
    while True:
        try:
            num = int(input("Enter a number: "))
            break
        except ValueError:
            print("Invalid input. Please enter an integer.")

    # Calculate and print the factorial
    factorial_value = calculate_factorial(num)
    print(f"The factorial of {num} is: {factorial_value}")

if __name__ == "__main__":
    main()


# Now, let's generate some documentation for this hypothetical program.

## Short Description
The agent calculates and prints the factorial of a user-provided number. It validates input to ensure it's a non-negative integer before calculating the factorial.

## Full Description
### Intro paragraph
This Python script is designed to calculate and print the factorial of a given number provided by the user. It includes input validation to handle cases where the input may not be a valid integer or negative, in which case it raises an error with a meaningful message.

### How It Works
The program consists of two main functions: `calculate_factorial` and `main`. The `calculate_factorial` function takes an integer as input and returns its factorial. It handles edge cases where the input is not a positive integer by raising errors. In the `main` function, it first prompts the user to enter a number. After validating the input to ensure it's an integer, it calls `calculate_factorial` with the provided number and prints the result.

# Input Parameters
- **num** (int) – The non-negative integer for which the factorial is calculated.

# Output Structure
The program prints the factorial value of the input number as a string.

# Key Features
- **Input Validation** – Ensures that the user-provided input is a positive integer.
- **Factorial Calculation** – Calculates the factorial of the given number using an efficient iterative approach.
- **Error Handling** – Catches invalid input and raises meaningful errors for edge cases (negative numbers or non-integers).

# Use Cases
# - **Educational Tool** – Helps students understand and visualize the concept of factorials in mathematics.
# - **Utility Function** – Can be used as a standalone function to calculate factorial values within larger programs.

# Please note that this is hypothetical documentation generated based on an assumed implementation. If you'd like me to document your actual code, please provide it, and I'll be happy to assist!
Enter fullscreen mode Exit fullscreen mode

Quite impressive I’d say 🤩.

Conclusion

The BeeAI agentic open platform, presents a framework for developing autonomous agents. It emphasizes modularity and flexibility, allowing developers to construct agents with diverse capabilities by composing various tools and functions. This approach aims to streamline the creation of AI systems that can independently perceive, reason, and act within dynamic environments. The platform’s open-source nature fosters community collaboration and contributions, potentially accelerating the advancement of agentic AI research and applications.

Last but not least, this project is donated to the Linux Foundation!

Image description

Useful links

Top comments (0)