AIOS Docs
  • Welcome
  • Getting Started
    • Installation
    • Quickstart
      • Use Terminal
      • Use WebUI
    • Environment Variables Configuration
  • AIOS Kernel
    • Overview
    • LLM Core(s)
      • LiteLLM Compatible Backend
      • vLLM Backend
      • Hugging Face Backend
      • LLM Routing
    • Scheduler
      • FIFOScheduler
      • RRScheduler
    • Context
    • Memory
      • Base Layer
      • Agentic Memory Operations
    • Storage
      • sto_mount
      • sto_create_file
      • sto_create_directory
      • sto_write
      • sto_retrieve
      • sto_rollback
      • sto_share
    • Tools
    • Access
    • Syscalls
    • Terminal
  • AIOS Agent
    • How to Use Agent
    • How to Develop Agents
      • Develop with Native SDK
      • Develop with AutoGen
      • Develop with Open-Interpreter
      • Develop with MetaGPT
    • How to Publish Agents
  • AIOS-Agent SDK
    • Overview
    • LLM Core API
      • llm_chat
      • llm_chat_with_json_output
      • llm_chat_with_tool_call_output
      • llm_call_tool
      • llm_operate_file
    • Memory API
      • create_memory
      • get_memory
      • update_memory
      • delete_memory
      • search_memories
      • create_agentic_memory
    • Storage API
      • mount
      • create_file
      • create_dir
      • write_file
      • retrieve_file
      • rollback_file
      • share_file
    • Tool API
      • How to Develop Tools
    • Access API
    • Post API
    • Agent API
  • Community
    • How to Contribute
Powered by GitBook
On this page
  1. AIOS Agent
  2. How to Develop Agents

Develop with Native SDK

PreviousHow to Develop AgentsNextDevelop with AutoGen

Last updated 2 months ago

🚀 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 and . 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_result

Step 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

from cerebrum.llm.apis import llm_chat
from cerebrum.llm.apis import llm_chat_with_json_output
from cerebrum.llm.apis import llm_chat_with_tool_call_output
from cerebrum.llm.apis import llm_call_tool
from cerebrum.llm.apis import llm_operate_file

Memory API

Here are the Memory apis that can be imported from cerebrum/memory/apis.py

from cerebrum.memory.apis import create_memory
from cerebrum.memory.apis import get_memory
from cerebrum.memory.apis import update_memory
from cerebrum.memory.apis import delete_memory
from cerebrum.memory.apis import search_memories
from cerebrum.memory.apis import create_agentic_memory

Storage API

Here are the Storage apis that can be imported from cerebrum/storage/apis.py

from cerebrum.storage.apis import mount
from cerebrum.storage.apis import create_file
from cerebrum.storage.apis import create_dir
from cerebrum.storage.apis import retrieve_file
from cerebrum.storage.apis import rollback_file
from cerebrum.storage.apis import share_file

Tool API

from cerebrum.tool.apis import call_tool

Step 3: Run and test your agents

Run the agent you have just built

run-agent \
  --mode local \
  --agent_path cerebrum/example/agents/test_agent \
  --task "What is the capital of United States?"

Refer to for detailed use

Refer to for detailed use

Refer to for detailed use

Refer to for detailed use

How to Use Agent
How to Develop Agents
LLM-Core API
Memory API
Storage API
Tool API