Skip to content

i-am-bee/beeai-framework

BeeAI Framework

Python library Typescript library License Bluesky Discord GitHub Repo stars

Build production-ready multi-agent systems in Python or TypeScript.

Latest updates πŸš€

Date Language Update Description
2025-02-19 Python Launched Python library alpha. See getting started guide.
2025-02-07 TypeScript Introduced Backend module to simplify working with AI services (chat, embedding). See migration guide.
2025-01-28 TypeScript Added support for DeepSeek R1, check out the Competitive Analysis Workflow example.
2025-01-09 TypeScript Introduced Workflows, a way of building multi-agent systems. Added support for Model Context Protocol.
2024-12-09 TypeScript Added support for LLaMa 3.3. See multi-agent workflow example using watsonx or explore other available providers.
2024-11-21 TypeScript Added an experimental Streamlit agent.

For a full changelog, see our releases page.


Why BeeAI?

πŸ† Build for your use case. Implement simple to complex multi-agent patterns using Workflows, start with a ReActAgent, or easily build your own agent architecture. There is no one-size-fits-all agent architecture, you need full flexibility in orchestrating agents and defining their roles and behaviors.

πŸ”Œ Seamlessly integrate with your models and tools. Get started with any model from Ollama, Groq, OpenAI, watsonx.ai, and more. Leverage tools from LangChain, connect to any server using the Model Context Protocol, or build your own custom tools. BeeAI is designed to integrate with the systems and capabilities you need.

πŸš€ Scale with production-grade controls. Optimize token usage through configurable memory strategies, persist and restore agent state via (de)serialization, generate structured outputs, and execute generated code in a sandboxed environment (coming soon). When things go wrong, the emitter system tracks the full agent workflow, generating detailed events for monitoring and analysis. Telemetry and logging capabilities capture key diagnostic data. When issues arise, BeeAI handles errors gracefully with clear, well-defined exceptions.


Installation

To install the Python library:

pip install beeai-framework

To install the TypeScript library:

npm install beeai-framework

For more guidance and starter examples in your desired language, head to the docs pages for Python and TypeScript.


Quick example

This example demonstrates how to build a multi-agent workflow using BeeAI framework in Python.

import asyncio
import sys
import traceback

from beeai_framework.agents.types import AgentExecutionConfig
from beeai_framework.backend.chat import ChatModel
from beeai_framework.backend.message import UserMessage
from beeai_framework.errors import FrameworkError
from beeai_framework.memory import UnconstrainedMemory
from beeai_framework.tools.search.duckduckgo import DuckDuckGoSearchTool
from beeai_framework.tools.weather.openmeteo import OpenMeteoTool
from beeai_framework.workflows.agent import AgentWorkflow


async def main() -> None:
    llm = ChatModel.from_name("ollama:granite3.1-dense:8b")

    workflow = AgentWorkflow(name="Smart assistant")
    workflow.add_agent(
        name="WeatherForecaster",
        instructions="You are a weather assistant.",
        tools=[OpenMeteoTool()],
        llm=llm,
        execution=AgentExecutionConfig(max_iterations=3, total_max_retries=10, max_retries_per_step=3),
    )
    workflow.add_agent(
        name="Researcher",
        instructions="You are a researcher assistant.",
        tools=[DuckDuckGoSearchTool()],
        llm=llm,
    )
    workflow.add_agent(
        name="Solver",
        instructions="""Your task is to provide the most useful final answer based on the assistants'
responses which all are relevant. Ignore those where assistant do not know.""",
        llm=llm,
    )

    prompt = "What is the weather in New York?"
    memory = UnconstrainedMemory()
    await memory.add(UserMessage(content=prompt))
    response = await workflow.run(messages=memory.messages)
    print(f"result: {response.state.final_answer}")


if __name__ == "__main__":
    try:
        asyncio.run(main())
    except FrameworkError as e:
        traceback.print_exc()
        sys.exit(e.explain())

Source: python/examples/workflows/multi_agents.py

TypeScript version of this example can be found here.

Running the example

Note

To run this example, be sure that you have installed ollama with the granite3.1-dense:8b model downloaded.

To run projects, use:

python [project_name].py

Explore more in our examples for Python and TypeScript.


Roadmap

  • Python parity with TypeScript
  • Standalone docs site
  • Integration with watsonx.ai for deployment
  • More multi-agent reference architecture implementations using workflows
  • More OTTB agent implementations
  • Native tool calling with supported LLM providers

To stay up-to-date on our public roadmap.


Contribution guidelines

BeeAI framework is open-source and we ❀️ contributions.

To help build BeeAI, take a look at our:

Bugs

We use GitHub Issues to manage bugs. Before filing a new issue, please check to make sure it hasn't already been logged. πŸ™

Code of conduct

This project and everyone participating in it are governed by the Code of Conduct. By participating, you are expected to uphold this code. Please read the full text so that you know which actions may or may not be tolerated.

Legal notice

All content in these repositories including code has been provided by IBM under the associated open source software license and IBM is under no obligation to provide enhancements, updates, or support. IBM developers produced this code as an open source project (not as an IBM product), and IBM makes no assertions as to the level of quality nor security, and will not be maintaining this code going forward.

Contributors

Special thanks to our contributors for helping us improve BeeAI framework.

Contributors list