Core Concepts
Agent-based applications are structured around modular entities called Agents, designed to execute workflows and interact with external services. This approach promotes scalability, flexibility, and ease of integration for building complex, automation-driven solutions.Agent
An Agent is the primary entity in an agent-based application. It encapsulates the logic required to execute workflows by handling interactions, inputs, and behaviors that define its operations. Agents are role-specific, addressing particular tasks such as:- Integrating with APIs
- Generating documentation
- Managing version control
name, description, and inputs, along with a collection of Behaviours. This structured design enables Agents to operate efficiently in diverse workflows, handling tasks like data processing or user notifications with precision.
Behaviours
Behaviours are the fundamental actions an Agent can perform. Each Behaviour represents an individual step or task within a workflow and includes attributes such as:- Name: Identifies the Behaviour
- Provider Type: Specifies the external service or system it interacts with
- Inputs: Defines the data required for execution
load_template: Load a specific template file.load_documentation: Retrieve documentation from a URL.create_branch: Create a new branch in a version control system like Bitbucket.
Run
The Run process manages the execution of an Agent. During this cycle, the Agent processes user inputs, selects relevant Behaviours, and orchestrates them to achieve desired outcomes. In the example code, this is achieved using therun method of the AgenticWorkflow class. The method:
- Instantiates an Agent.
- Configures it with defined Behaviours.
- Executes the workflow based on user-provided inputs.
Providers
Providers are the services or APIs that an Agent interacts with to perform tasks. Providers are responsible for executing the underlying logic, such as making network requests, processing data, or communicating with external systems. Examples of Providers in the code include:local_file_loader: Load and process local files.scraper: Extract and process data from web sources.open-ai: Utilize AI capabilities like text summarization or file generation.bitbucket: Interact with Bitbucket for version control operations.
create_branch Behaviour integrates with Bitbucket via provider parameters to create branches programmatically.
Inputs
Inputs define the data required for Agents to perform their tasks. They guide Behaviours in executing their logic by specifying:- Name: A unique identifier for the input.
- Title: A user-friendly label for the input.
- Type: The data type (e.g., string, URL).
documentation_url: A URL pointing to documentation resources.template_path: A file path for loading templates.slack_id: An identifier for sending Slack notifications.
Nested Behaviours
Nested Behaviours enable Agents to manage complex workflows by grouping multiple Behaviours into hierarchical structures. This allows tasks to be:- Sequential: Behaviours execute one after another.
- Parallel: Behaviours execute simultaneously.