Skip to content

AgenticAI Framework — Agents Module Documentation

Overview

The agents module is the core of the AgenticAI Framework. It defines the base Agent class and provides the foundation for building intelligent, autonomous agents with configurable capabilities, roles, and behaviors.


Key Classes

Agent

Location: agenticaiframework/agents.py

The base class for all agents. It provides lifecycle methods and core functionality.

Constructor Parameters: - name (str) — Unique identifier for the agent. - role (str) — Describes the agent's purpose. - capabilities (list) — List of capabilities (e.g., ["text", "image"]). - config (dict) — Configuration parameters (e.g., temperature, max tokens).

Core Methods: - act(input_data) — Perform an action based on the input. - observe(data) — Observe and process incoming data. - plan() — Plan the next steps. - start() — Start the agent's execution loop. - stop() — Stop the agent.


Creating a Custom Agent

from agenticaiframework.agents import Agent

class MyAgent(Agent):
    def act(self, input_data):
        return f"Processed: {input_data}"

agent = MyAgent(name="Processor", role="data_processor", capabilities=["text"])
agent.start()

Agent Lifecycle

  1. Initialization — Configure the agent with name, role, capabilities, and settings.
  2. Observation — Receive and process input data.
  3. Action — Execute tasks based on observations.
  4. Planning — Determine next actions.
  5. Execution — Perform actions until stopped.

Best Practices

  • Keep agent responsibilities focused (Single Responsibility Principle).
  • Use guardrails to enforce safety and compliance.
  • Leverage the hub module to register and retrieve agents dynamically.