Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

129 stars

Watchers

0 watching

Forks

Repository files navigation

OpenSage ADK

OpenSage-ADK

Next generation agent development kit that enables AI to self-create agent topology, synthesize toolsets, and manage structured memory.

Stars Python 3.12+ License: Apache 2.0 Discord

English | 中文 • Web • Quick Start • Docs • Paper


💡 Highlights

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

🚀 Quick Start

Prerequisites

  • Python >= 3.12
  • uv (dependency manager)
  • Docker (for sandbox execution)

Setup

git clone https://github.com/opensage-agent/opensage-adk.git
cd opensage-adk
uv venv --python 3.12
uv sync

Note

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 an Agent

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.

Run the Agent

# launch the Web UI
uv run opensage web --agent /path/to/my_agent --port 8000

Open the web UI at http://localhost:8000, chat with the agent, and inspect tool calls and session state from there.

🔍 Example Agents

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

📄 Citation

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},
}

📝 License

Apache 2.0 - See LICENSE

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

129 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages