How to Develop Agents
Last updated
Last updated
To develop new agents to run on AIOS, it provides the 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.
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.
First, let's look at how to organize your agent's files. Every agent needs three mandatory components:
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:
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.
A minimal example of an agent is shown as below
[Important]: Rules to be strictly followed in the entry.py
The agent class must have a run
method as the main function to be executed
All the interactions with AIOS kernel must be through the send_request
API, otherwise the services provided by the AIOS will not support for the agents.
Your agent needs a config.json file that describes its functionality. Here's what it should include:
When setting up your agent, you'll need to specify which tools it will use.
View tools available in the AIOS Tool Hub:
View tools available locally:
To load a tool from ToolHub in your code:
To load a local tool in your code:
The agent class must inherit the BaseAgent from
To use these tools in your agent, use the provided by the AIOS SDK to load these tools within your agent logic.
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 .