Skip to main content

Overview

An AI Agent is a system built on language models (LLMs or SLMs) that can solve complex tasks through structured reasoning and autonomous or human-assisted actions. The BeeAI Framework serves as the orchestration layer that enables agents to do this and more:
  • Coordinate with LLMs: Manages communication between your agent and language models
  • Tool Management: Provides agents with access to external tools and handles their execution
  • Response Processing: Processes and validates tool outputs and model responses
  • Memory Management: Maintains conversation context and state across interactions
  • Error Handling: Manages retries, timeouts, and graceful failure recovery
  • Event Orchestration: Emits detailed events for monitoring and debugging agent behavior
Unlike basic chatbots, agents built with this framework can perform multi-step reasoning, use tools to interact with external systems, maintain context across interactions, and adapt based on feedback. These capabilities make them ideal for planning, research, analysis, and complex execution tasks.
Dive deeper into the concepts behind AI agents in this research article from IBM.
Supported in Python and TypeScript.

Customizing Agent Behavior

You can customize your agent’s behavior in several key ways:

1. Configuring the Language Model Backend

The backend system manages your connection to different language model providers. The BeeAI Framework supports multiple LLM providers through a unified interface. Learn more about available backends and how to set their parameters in our backend documentation.
Backend Features:
  • Unified Interface: Work with different providers using the same API
  • Model Parameters: Configure temperature, max tokens, and other model settings
  • Provider Support: OpenAI, Anthropic, Ollama, Groq, and more
  • Local & Cloud: Support for both local and cloud-hosted models

2. Setting the System Prompt

The system prompt defines your agent’s behavior, personality, and capabilities. You can configure this through several parameters when initializing an agent:
Prompt Parameters:
  • role: Defines the agent’s persona and primary function
  • instructions: List of specific behavioral guidelines
  • notes: Additional context or special considerations
  • name and description: Help identify the agent’s purpose and are helpful when using the HandoffTool, Serve module, and when you need to access agent metadata via agent.meta
Setting instructions, notes, role will be integrated into the framework provided system prompt template. If you want to completely override the framework provided system prompt template, you can provide a custom prompt template.

3. Configuring Agent Run Options

When executing an agent, you can provide additional options to guide its behavior and execution settings:

Setting Execution Settings and Guiding Agent Run Behavior

Available Options:
  • expected_output: Guides the agent toward a specific unstructured or structured output format. output_structured is defined only when expected_output is a Pydantic model or a JSON schema. However, the text representation is always available via response.output.
  • backstory: Provides additional context to help the agent understand the user’s situation
  • total_max_retries: Controls the total number of retry attempts across the entire agent execution
  • max_retries_per_step: Limits retries for individual steps (like tool calls or model responses)
  • max_iterations: Sets the maximum number of reasoning cycles the agent can perform
The are defaults set for max_iterations, total_max_retries, and max_retries_per_step, but you can override them by setting your own preferences.

4. Adding Tools

Enhance your agent’s capabilities by providing it with tools to interact with external systems. Learn more about beeai provided tools and creating custom tools in our tools documentation.

5. Configuring Memory

Memory allows your agent to maintain context across multiple interactions. Different memory types serve different use cases. Learn more about our built in options in the memory documentation.

Additional Agent Options

Agent Types

BeeAI Framework provides several agent implementations:
Upcoming change:
The Requirement agent will become the primary supported agent. The ReAct and tool-calling agents will not be actively supported.

Requirement Agent

This is the recommended agent. Currently only supported in Python.
This agent provides the reliability needed for production scenarios through a rule system that defines execution constraints while keeping problem-solving flexibility intact. Unlike traditional approaches that require complex orchestration code, RequirementAgent uses a declarative interface where you define requirements and let the framework enforce them automatically. Learn more about RequirementAgent in its dedicated page or in the blog post.
Python

Lite Agent

Currently only supported in Python.
An agent that leverages a language model and a suite of tools to solve problems. The agent does not have any system prompt. This design is ideal for:
  • Exploring the raw capabilities of a language model without bias from a framework’s built‑in prompt
  • Developers who want to understand how to build an agent from scratch
Python

ReAct Agent

The ReAct Agent is available in both Python and TypeScript, but no longer actively supported.
The ReActAgent implements the ReAct (Reasoning and Acting) pattern, which structures agent behavior into a cyclical process of reasoning, action, and observation. This pattern allows agents to reason about a task, take actions using tools, observe results, and continue reasoning until reaching a conclusion. Let’s see how a ReActAgent approaches a simple question: Input prompt: “What is the current weather in Las Vegas?” First iteration:
Second iteration:
During execution, the agent emits partial updates as it generates each line, followed by complete updates. Updates follow a strict order: first all partial updates for “thought,” then a complete “thought” update, then moving to the next component.

Tool Calling Agent

The Tool Calling Agent is deprecated. Use RequirementAgent instead.
The ToolCallingAgent is optimized for scenarios where tool usage is the primary focus. It handles tool calls more efficiently and can execute multiple tools in parallel.

Custom Agent

For advanced use cases, you can create your own agent implementation by extending the BaseAgent class.

Multi-Agent Hand-offs

Create a team of specialized agents that can collaborate:

Workflows

Upcoming change:
Workflows are under construction to support more dynamic multi-agent patterns. If you’d like to participate in shaping the vision, contribute to the discussion in this V2 Workflow Proposal.
For complex applications, you can create multi-agent workflows where specialized agents collaborate.

Examples

Python

Explore reference agent implementations in Python

TypeScript

Explore reference agent implementations in TypeScript