Develop with Native SDK
🚀 Develop and customize new agents
Before starting developing your agents, make sure you have already read the instructions of the agent structures and rules for developing agents in How to Use Agent and How to Develop Agents. This guide will walk you through creating and running your own agents for AIOS with the native SDK.
Step 1: Set up the Agent Class
First, in the entry.py in your agent folder, create your agent class and implement the run method.
class TestAgent:
def __init__(self, agent_name):
self.agent_name = agent_name
self.messages = []
def run(self, task_input):
self.messages.append({"role": "user", "content": task_input})
llm_response = llm_chat(
agent_name=self.agent_name,
messages=self.messages,
base_url="http://localhost:8000"
)
final_result = llm_response["response"]["response_message"]
return final_resultStep 2: Use APIs provided by AIOS SDK to build your agents
LLM Core API
Here are the LLM apis that can be imported from cerebrum/llm/apis.py
Refer to LLM-Core API for detailed use
Memory API
Here are the Memory apis that can be imported from cerebrum/memory/apis.py
Refer to Memory API for detailed use
Storage API
Here are the Storage apis that can be imported from cerebrum/storage/apis.py
Refer to Storage API for detailed use
Tool API
Refer to Tool API for detailed use
Step 3: Run and test your agents
Run the agent you have just built
Last updated