Next generation agent development kit that enables AI to self-create agent topology, synthesize toolsets, and manage structured memory.
English | 中文 • Web • Quick Start • Docs • Paper
Instead of requiring developers to hand-craft agent topology, tool lists, and memory, OpenSage-ADK provides a minimal scaffold that lets the model create and orchestrate these components at runtime.
| Category | Feature | Description |
|---|---|---|
| 🌐 Topology | AI-created topology | Dynamically create, execute, and terminate sub-agents during task execution |
| Agent management | Support vertical topology by decomposing complex tasks into sequential sub-tasks | |
| Agent ensemble | Support horizontal topology where multiple parallel agents execute and merge results | |
| 🛠️ Tool | AI-written tools | Dynamically create custom tools and skills during execution |
| Tool management | Sandboxing system enabling tool-isolated execution and state management | |
| 🧠 Memory | AI-created memory | File-based memory for both long-term (cross-task) and short-term (per-task) storage |
| Graph-based structure | Hierarchical memory structure for organizing agent context | |
| AI-driven management | Built-in dedicated memory agent that can be enabled with a single line of code |
- Python >= 3.12
- uv (dependency manager)
- Docker (for sandbox execution)
git clone https://github.com/opensage-agent/opensage-adk.git
cd opensage-adk
uv venv --python 3.12
uv syncNote
Use uv run <command> to run commands with project dependencies. Use uv add / uv remove instead of pip for dependency management. See uv docs for details.
Create a directory for your agent and add an agent.py file with a mk_agent() factory function.
my_agent/
├── agent.py # Required: defines mk_agent()
├── config.toml # Optional: sandbox, model, and plugin configuration
└── __init__.py
Here's a minimal agent example:
import os
from typing import Optional
from google.adk.models.lite_llm import LiteLlm
import opensage
from opensage.agents import OpenSageAgent
def mk_agent(session_id: str, model=None):
session = opensage.get_opensage_session(session_id)
if model is None:
model = LiteLlm(
model="YOUR_MODEL_NAME",
api_key=os.environ.get("YOUR_API_KEY"),
)
return OpenSageAgent(
name="my_agent",
description="My custom OpenSage agent.",
model=model,
instruction="You are a helpful assistant.",
enabled_skills="all",
tools=[],
subagents=[],
)Important
You should ensure that an API key for the model you want to use is set in your environment variables or passed directly when initializing the model. For more details, see the Docs.
# launch the Web UI
uv run opensage web --agent /path/to/my_agent --port 8000Open the web UI at http://localhost:8000, chat with the agent, and inspect tool calls and session state from there.
The repo includes agent library examples from basic agents to dynamic sub-agents, MCP integrations, tool combos, web search, and agent ensembles.
| Directory | Description |
|---|---|
agent_library/agents_101/ |
Minimal agent patterns and starter examples |
agent_library/agents_with_features/ |
Feature-focused demos such as dynamic sub-agents, tool combos, and web search |
agent_library/agents/ |
More complete agent examples with various tools and skills |
If you use OpenSage in your research, please cite our paper.
@article{li2026opensage,
title={OpenSage: Self-programming Agent Generation Engine},
author={Hongwei Li and Zhun Wang and Qinrun Dai and Yuzhou Nie and Jinjun Peng and Ruitong Liu and Jingyang Zhang and Kaijie Zhu and Jingxuan He and Lun Wang and Yangruibo Ding and Yueqi Chen and Wenbo Guo and Dawn Song},
year={2026},
eprint={2602.16891},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2602.16891},
}Apache 2.0 - See LICENSE