Agent

Generate agents that belong to your company.

The Beacon Labs framework introduces an Agent system that optimizes tasks by creating a structured environment where agents operate with defined roles and responsibilities. By utilizing job title parameters, the system establishes decision-making frameworks and performance objectives for each agent, streamlining workflows and improving efficiency.

Agents and Task Execution

Agents provide a reusable architecture that enhances flexibility and system performance. For instance, when analyzing servers, a software engineer agent can be dynamically assigned to relevant tasks, promoting code reuse and efficient resource allocation.

Creating an Agent

The AgentConfiguration class is a fundamental component for ensuring optimal task execution. Developers should dedicate time to configuring and fine-tuning this class properly. Comprehensive testing across various configurations is essential to validate performance and behavior under different conditions.

from beaconlabs import Agent, Task

agent = Agent(
    "Product Manager",
    company_url="https://thebeaconlabs.com",
    company_objective="Developing an AI Agent Framework",
)

Specifying LLM

To define which LLM the agent will use, simply specify the model parameter. Check the LLM support section to view all available models.

agent = Agent(
    "Product Manager",
    model="openai/gpt-4o"
)

Agent Attributes

Agents are equipped with configurable attributes that enhance performance and adaptability throughout task execution. These features can be dynamically adjusted to optimize processing capacity in real-time.

Attribute

Parameters

Type

Description

Job Title

job_title

str

The role of the agent.

Company URL (Optional)

company_url

str

The company's website.

Company Objective (Optional)

company_objective

str

The mission or goal of the company.

Name (Optional)

name

str

The name of the individual the agent represents.

Contact (Optional)

contact

str

Contact information of the agent's human counterpart.

Memory (Optional)

memory

bool

Enables persistent memory using agent ID (Default: False).

Reflection (Optional)

reflection

bool

Enables self-monitoring and quality assurance (Default: False).

Compress Context (Optional)

compress_context

bool

Optimizes LLM context length by summarizing data (Default: True).

Model (Optional)

model

str

Defines the LLM model for the agent (Default: openai/gpt-4o).

Acting Like a Human

During task execution, LLM-based agents may leave specific fields incomplete due to inherent limitations, requiring human input. However, when provided with personal identifiers, such as names and contact details, the system can generate fully personalized content.

Without Human Acting

In this demonstration, we configure an agent as Beacon Labs' Marketing Manager and assign an email composition task.

# Generating Task and Agent
task = Task(description="Write an outreach mail", tools=[Search])

agent = Agent(
    "Marketing Manager",
    company_url="https://thebeaconlabs.com",
    company_objective="To build an AI Agent framework that helps people get things done",
)

# Run and see the result
agent.do(task)
result = task.response
print(result)

Example Output:

My name is [Your Name], and I’m a [Your Position] at [Your Company]. I wanted to introduce [Company Name], a trusted partner in delivering innovative, reliable, and customer-focused technology solutions.

Thank you for considering this opportunity. I look forward to the possibility of working together.

Best regards,
[Your Full Name]
[Your Job Title]
[Your Company Name]
[Your Contact Information]

With Human Acting

By adding personal identifiers, such as a name and contact details, the agent generates a fully automated output.

task = Task(description="Write an outreach mail", tools=[Search])

agent = Agent(
    "Marketing Manager",
    company_url="https://thebeaconlabs.com",
    company_objective="To build an AI Agent framework that helps people get things done",
    name="John Doe",
    contact="john@beaconlabs.ai"
)

# Run and see the result
agent.do(task)
result = task.response
print(result)

Example Output:

My name is John Doe, and I am the Marketing Manager at Beacon Labs. At Beacon Labs, we specialize in helping businesses leverage cutting-edge AI technology to streamline operations and drive growth.

Thank you for considering Beacon Labs. I look forward to hearing from you soon!

Best regards,
John Doe
Marketing Manager | Beacon Labs
john@beaconlabs.ai

Memory Management

To maintain contextual continuity, the framework provides a disk-based persistence mechanism associated with unique agent identifiers (IDs). Developers must explicitly define and maintain agent IDs to enable persistent memory.

agent_id = "product_manager_agent" # Defining an agent ID

agent = Agent(
    "Marketing Manager",
    agent_id=agent_id, # Assigning agent ID
    memory=True, # Enabling persistent memory
)

Reflection Mode

To ensure quality control, agents can be configured with reflection mode. This feature allows them to self-monitor and correct potential errors during execution.

agent = Agent(
    "Marketing Manager",
    reflection=True, # Enabling reflection mode
)

Compressing Context

To handle LLM context length limitations, the framework automatically compresses input data while preserving essential information.

agent = Agent(
    "Marketing Manager",
    compress_context=True, # Enabling context compression
)

By leveraging the Agent system within the Beacon Labs framework, users can enhance task automation, streamline workflows, and optimize decision-making processes efficiently.

Last updated