Introduction to the Agency Project
The Agency project is centered around a Python library designed to facilitate the integration of agents into systems in a seamless and scalable manner. At its core, it employs the Actor model, which enables developers to create agent-based applications, providing a simplified yet powerful framework to experiment with and expand upon. Perfect for those plotting unique agent systems, Agency offers an environment for creative innovation.
Key Features
User-Friendly API
At the heart of Agency is an intuitive API that simplifies the process of defining agents and their actions using class and method structures. Comprehensive and up-to-date documentation, along with practical examples, are provided to aid developers in their journey with Agency.
Performance and Scalability
Agency supports concurrency, accommodating both multiprocessing and multithreading, crucial for developing systems that need to handle numerous tasks simultaneously. Moreover, the library includes AMQP support, allowing for the construction of networked agent systems that can communicate effectively over various protocols.
Observability and Control
Agency provides robust monitoring and control features with action and lifecycle callbacks. Developers can also specify access policies and permissions, ensuring a balanced and secure operation of actions. Detailed logging capabilities are integrated, facilitating thorough tracking and debugging.
Demo Application
An example suite is packaged with Agency, available at examples/demo
. It offers multiple demos, including agent examples utilizing OpenAI and HuggingFace transformers, and exhibits how agents can interact with operating systems. The demo also includes a Gradio UI for a visual interface and a Docker configuration to streamline the development and testing process.
API Overview
Within Agency, every entity is considered an instance of the Agent
class, representing AI agents, software interfaces, or human users. These agents can advertise "actions" which other agents can discover and invoke. A simple agent like CalculatorAgent
might offer an add
action, enabling other agents to send a message to execute it. Access policies can be designated to dictate when and how actions may be used, providing flexibility and security as needed.
Agents are linked together in a Space
, a virtual environment that allows them to communicate. Agency provides two types of Spaces
:
LocalSpace
: Connects agents within a single application.AMQPSpace
: Facilitates connections across a network using an AMQP server, such as RabbitMQ.
By setting up a Space
, multiple agents can interact, unlocking the potential of integrated system operations.
Installation
For those ready to dive into the Agency project, the installation is straightforward with either pip:
pip install agency
or using poetry:
poetry add agency
Demo Application
The demo application serves as a cutting-edge development environment and a showcase highlighting the library's features. It demonstrates inter-agent communication and supports utilizing a "slash" syntax for action invocation by agents. Comprehensive instructions for operating the demo are available in examples/demo
.
A snapshot of the demo's Gradio UI depicts an OpenAIFunctionAgent
engaging with a Host
agent, illustrating the fluid interaction within the system’s framework.
Joining the Development
The Agency project is open to contributions. Prospective contributors are encouraged to review the contributing guide and get involved in enhancing this dynamic project.
Future aspirations and planned work are detailed on the issues page, with the community invited to share insights, suggestions, or commence a discussion to propel the project forward.