How to Develop Agents

To develop new agents to run on AIOS, it provides the native Agent-SDK and various adapters to adapt different agent frameworks into AIOS.

Below shows the agent frameworks that have been integrated and the current integration modules.

The table below shows the agent frameworks we have integrated and different modules that have been integrated, and the details can be found in later sections.

Agent Framework
Integrated Module

AutoGen

LLM

Open-Interpreter

LLM

MetaGPT

LLM

Before developing agents, it is required to follow the guidelines of how to organize the agent files in the following structure.

Agent Structure

First, let's look at how to organize your agent's files. Every agent needs three mandatory components:

author/
└── agent_name/
      │── entry.py        # Your agent's main logic
      │── config.json     # Configuration and metadata
      └── meta_requirements.txt  # Additional dependencies

For example, if your name is demo_author and you're building a demo_agent that searches and summarizes articles, your folder structure would look like this:

demo_author/
   └── demo_agent/
         │── entry.py
         │── config.json
         └── meta_requirements.txt

Note: If your agent needs any libraries beyond AIOS's built-in ones, make sure to list them in meta_requirements.txt. Apart from the above three files, you can have any other files in your folder.

Configure the agent

Your agent needs a config.json file that describes its functionality. Here's what it should include:

{
   "name": "demo_agent",
   "description": [
      "Demo agent that can help search AIOS-related papers"
   ],
   "tools": [
      "demo_author/arxiv"
   ],
   "meta": {
      "author": "demo_author",
      "version": "0.0.1",
      "license": "CC0"
   },
   "build": {
      "entry": "agent.py",
      "module": "DemoAgent"
   }
}

When setting up your agent, you'll need to specify which tools it will use. Below is a list of all currently available tools and how to reference them in your configuration:

Author
Name
How to Use

example

arxiv

example/arxiv

example

bing_search

example/bing_search

example

currency_converter

example/currency_converter

example

wolfram_alpha

example/wolfram_alpha

example

google_search

example/google_search

openai

speech_to_text

openai/speech_to_text

example

web_browser

example/web_browser

timbrooks

image_to_image

timbrooks/image_to_image

example

downloader

example/downloader

example

doc_question_answering

example/doc_question_answering

stability-ai

text_to_image

stability-ai/text_to_image

example

text_to_speech

example/text_to_speech

To use these tools in your agent, simply include their reference (from the "How to Use" column) in your agent's configuration file. For example, if you want your agent to be able to search academic papers and convert currencies, you would include both example/arxiv and example/currency_converter in the configuration of your agent.

If you would like to create your new tools, you can either integrate the tool within your agent code or you can follow the tool examples in the tool folder to develop your standalone tools. The detailed instructions are in How to develop new tools.

Last updated