Azad Package¶
The azad package is the root package of the Azad autonomous AI development agent framework. It contains the core components for running the agent, managing tasks, and interacting with the environment.
Core Components¶
Agent¶
The AzadAgent class is the central component that manages the execution of tasks. It:
- Handles incoming requests from clients
- Manages task state and execution
- Coordinates tool calls and responses
- Communicates with the AI network
Environment¶
The Environment class provides an interface for the agent to interact with the outside world. It:
- Executes tools
- Requests approval for tool usage
- Manages resources
Task Lifecycle¶
The Task Lifecycle system manages the lifecycle of tasks, including entry, execution, and exit. It provides:
- Parameter type definitions for task lifecycle operations
- Utilities for extracting parameters from tool results
- Functions for getting parameter key names
Mind Map¶
The Mind Map module defines the data structures for representing tasks, messages, and various message parts. It includes:
- Task class for representing a specific task
- Message classes for different message roles (system, user, assistant, tool)
- Part classes for different content types (text, image, tool call, tool result)
Loop Stepper¶
The Loop Stepper module handles the execution of individual steps in the agent loop. It:
- Processes streaming responses from the language model
- Executes tool calls
- Manages the task state
Main¶
The Main module provides the entry point for the Azad command-line interface. It:
- Parses command-line arguments
- Starts and stops the agent daemon
- Manages the PID file
Config¶
The Config module handles configuration loading and management. It:
- Loads configuration from files
- Applies command-line arguments
- Provides default values
Type Definitions¶
The Type Definitions module defines common types used throughout the codebase. It includes:
- Task configuration types
- Parameter types for task lifecycle operations
- Tool metadata types
Logging¶
The Log Levels and Logging Formatter modules provide utilities for configuring and formatting logs.
Introspection¶
The Introspect and Introspect Environment modules provide utilities for generating client libraries based on the agent's interface.
Subpackages¶
The azad package contains several subpackages for specific functionality:
- ainetwork: Components for communicating with language model providers
- compression: Context window management and compression strategies
- network: Network interfaces and protocols
- predefined_tools: Built-in tools for common operations
- prompts: Prompt formatting and parsing for different dialects
- server_tools: Server-executed tools requiring specific environments
- slipstream: Network communication and protocol handling