BeeAI Framework

repository·main·Indexed 25 days ago

https://github.com/i-am-bee/beeai-framework

A comprehensive toolkit for building production-ready, autonomous multi-agent systems in Python and TypeScript. It provides modular components for reasoning, tool usage, RAG, and complex workflow orchestration, including support for ReAct agents, various memory management strategies (sliding window, token-based, summarization), and integration with LLM providers like Amazon Bedrock, Ollama, and watsonx. The framework also supports exposing agents and tools via the Agent Communication Protocol (ACP) and Model Context Protocol (MCP).

Tokens
122.3K
Snippets
246
Records
460
Agent score
85%

What's inside BeeAI Framework

  1. Overview of BeeAI Framework

    main
    BeeAI Framework is an open-source, Linux Foundation-hosted framework designed for building production-grade multi-agent systems. It focuses on reliable agent development through built-in constraint enforcement and rule-based governance to ensure predictable behavior without sacrificing reasoning abilities. The framework provides complete feature parity between Python and TypeScript implementations.
  2. Overview of the BeeAI Framework Backend

    main

    The Backend module provides a unified interface for interacting with various AI model types. It uses a provider-based architecture, which allows developers to switch between different AI service providers (e.g., OpenAI, Anthropic) without changing the core application logic.

    Currently supported model types include:

    • Chat Models (via the ChatModel class)
    • Embedding Models (via the EmbeddingModel class)

    Note: Audio and Image models are planned for future support. The backend is available in both Python and TypeScript.

  3. Overview of the Backend module

    main

    The Backend module provides a unified interface for interacting with various AI model types in the BeeAI framework. It uses a provider-based architecture, which allows you to switch between different AI service providers without changing your core application logic.

    Currently, the Backend module supports:

    • Chat Models via the ChatModel class
    • Embedding Models via the EmbeddingModel class

    Note: Audio and Image models are planned for future support.

    This module is available in both Python and TypeScript.

  4. Overview of BeeAI Framework Tools

    main

    Tools extend agent capabilities beyond text processing, allowing interaction with external systems, data sources, and execution of actions. They are supported in both Python and TypeScript.

    Built-in Tools

    ToolDescription
    MCPDiscover and use tools exposed by arbitrary MCP Server
    ThinkGives an agent a place to think
    HandoffDelegates a task to an expert agent
    OpenAPIConsume external APIs
    OpenMeteoRetrieve weather information for specific locations and dates
    DuckDuckGoSearch for data on DuckDuckGo
    WikipediaSearch for data on Wikipedia
    VectorStoreSearchSearch for documents in a vector database
    PythonRun arbitrary Python code in a sandboxed environment
    SandboxRun custom Python functions in a sandboxed environment
    ShellRun a command and capture its output (pluggable backend)
    FileReadRead a text file via a pluggable file backend
    FileEditOverwrite or search-and-replace a text file with a unified diff
    GlobList files matching a glob pattern
    GrepRecursively search files for a regex (uses ripgrep when available)
  5. Overview of BeeAI Framework features

    main

    BeeAI Framework is a toolkit for building autonomous agents and multi-agent systems. Key capabilities include:

    • Agents: Intelligent agents capable of reasoning, acting, and adapting.
    • Requirement Agent: Controlled behavior across different LLMs via rule-setting.
    • Backend: Unified interfaces to connect to any LLM provider.
    • Tools: Built-in (web search, weather, code execution) or custom tools to extend agent capabilities.
    • RAG: Retrieval-augmented generation using vector stores and document processing.
    • Workflows: Orchestration of multi-agent systems with complex execution flows.
    • Memory: Conversation history management with built-in strategies.
    • Templates: Dynamic prompt building with enhanced Mustache syntax.
    • Observability: Monitoring via events, logging, and error handling.
    • Serve: Hosting agents with support for protocols like A2A and MCP.
    • Cache: Performance optimization and cost reduction.
    • Serialization: Saving and loading agent state for persistence.
  6. Overview of BeeAI Memory implementations

    main

    Memory in BeeAI allows agents to store, recall, and utilize information from past interactions to maintain context. The framework provides four primary memory strategies:

    TypeDescription
    UnconstrainedMemoryUnlimited storage for all messages
    SlidingMemoryKeeps only the most recent $k$ entries
    TokenMemoryManages token usage to stay within model context limits
    SummarizeMemoryMaintains a single summarization of the conversation

    Supported in both Python and TypeScript.

  7. Overview of Memory implementations

    main

    BeeAI framework provides several memory strategies to allow agents to store, recall, and utilize information from past interactions. These implementations are supported in both Python and TypeScript.

    TypeDescription
    UnconstrainedMemoryUnlimited storage for all messages
    SlidingMemoryKeeps only the most recent $k$ entries
    TokenMemoryManages token usage to stay within model context limits
    SummarizeMemoryMaintains a single summarization of the conversation
  8. Overview of RAG Components

    main

    The BeeAI Framework provides several key components for building RAG pipelines, often acting as adapters for LangChain or Llama-Index:

    ComponentDescriptionCompatibility
    Document LoadersLoads content from formats like PDFs, web pages, and text files.LangChain (transitioning to BeeAI)
    Text SplittersSplits long documents into chunks (e.g., fixed length or context-preserving).LangChain (transitioning to BeeAI)
    DocumentThe basic data structure for text, metadata, and retrieval scores.BeeAI
    Vector StoreStores document embeddings and enables semantic similarity retrieval.LangChain (transitioning to BeeAI/Llama-Index)
    Document ProcessorsRefines documents during the lifecycle (e.g., reranking and filtering).Llama-Index
  9. Explore BeeAI Framework Python Examples

    main

    The python/examples directory contains various implementations demonstrating how to use the BeeAI Framework for building AI agents and applications. Key categories include:

    • Agents: Implementations of ReAct and simple agents.
    • Workflows: Sequential agentic workflows and multi-agent systems.
    • Backend & LLM Providers: Integration with providers like Ollama and Watsonx.
    • Memory: Various memory management strategies including sliding window, token-based, and summarization memory.
    • Templates: Working with system prompts, objects, arrays, and template forking.
    • Tools: Creating tools via decorators or using pre-built tools like DuckDuckGo search or Open-Meteo weather.
    • Observability: Event subscription and basic observability patterns.
    • Serve: Exposing agents via the Agent Communication Protocol (ACP) or tools via the Model Context Protocol (MCP).
  10. Explore BeeAI Framework example categories

    main

    The examples repository is organized into several functional areas to help you learn different parts of the framework:

    • Agents: Implementations of ReAct agents (basic, advanced, reusable), custom agents, and specialized agents (SQL, Granite).
    • Workflows: Techniques for nesting workflows, interconnecting agents with critique steps, and multi-step sequential workflows.
    • Cache: Various caching strategies including function caching, decorators, file-based caching, sliding windows, and tool caching.
    • LLMs (Language Models): Usage patterns for chat-based models, callbacks, and structured output, including integrations with providers like OpenAI, Anthropic, Groq, Ollama, and Watsonx.
    • Memory: Management strategies such as sliding window, summarization, token-based, and custom memory implementations.
    • Tools: Implementation of basic, advanced, and MCP tools, as well as custom tools (Python-based, dynamic, or API-integrated).
    • Serialization: Methods for serializing agents, context, and memory.
    • Templates: Using arrays, functions, objects, and primitives for templating.