An RSI Agent Harness for running, evaluating, and evolving agents—with tools, skills, MCP, stateful execution, and multi-agent workflows.
# Add to your Claude Code skills
git clone https://github.com/ZHangZHengEric/SageSage is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ZHangZHengEric. An RSI Agent Harness for running, evaluating, and evolving agents—with tools, skills, MCP, stateful execution, and multi-agent workflows. It has 1,227 GitHub stars.
Sage's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/ZHangZHengEric/Sage" and add it to your Claude Code skills directory (see the Installation section above).
Sage is primarily written in Python. It is open-source under ZHangZHengEric on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Sage against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.

Sage is an RSI Agent Harness for improving agents through task feedback. RSI (Recursive Self-Improvement) starts from a goal or curated usage history, retains each version and its evidence, and leaves adoption in your hands.
Try RSI · Download Desktop · Python SDK · Docs

Workflow guide · Evaluation and selection rules · Editable diagram (SVG)
Sage, Desktop, Server, and SAgents refer to the current v2 implementation by default. For the legacy version, use the separate Sage v1 guide.
| Choose your path | Start here |
|---|---|
| 🧬 First RSI run — Inspect a scripted loop without an API key | Offline walkthrough |
| 💻 Desktop — Configure agents, run RSI, and choose versions | Desktop guide |
| 🎙️ Sage Voice — Talk with an agent, interrupt replies, and configure spoken tool updates. Run from source on Apple Silicon (macOS 15+). | Sage Voice setup (中文) |
| 🌐 Server — Multi-user web access and Agent Studio | Server guide |
| 🧠 SAgents — Build and optimize agents through Python | Runtime quick start |
| 📦 Desktop installers — Available release builds | Downloads & release instructions |
Requires Python 3.12+ and Flutter with Dart ^3.12.2 and desktop support. The Desktop OpenUI streaming parser also needs Node.js 22+ when running Desktop from source. On macOS:
git clone https://github.com/ZHangZHengEric/Sage.git
cd Sage
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[desktop]'
cd app/v2/desktop
flutter pub get
flutter run -d macos
Add a model → Configure an Agent → Start a conversation or open a project.
The app starts its local backend automatically. Settings and session data live in ~/sage/runtime; the default workspace is ~/sage/agent_workspace.
For Windows and Linux setup, see the Desktop guide. Sage 2.2 packages and the release boundary are documented in v2.2.0 release notes. GitHub Actions builds Flutter v2 installers with an embedded Python runtime; the legacy Tauri installers belong to v1.
Requires Python 3.12+, Node.js 22.12+, and one supported database (MySQL or PostgreSQL). From the checkout root, with the Python environment active:
python -m pip install -e '.[server]'
cp .env.example app/v2/server/.env
Configure one database URL in .env (the template starts with a MySQL example; for PostgreSQL, install the postgres extra alongside server with python -m pip install -e '.[server,postgres]', disable the MySQL URL, and set SAGE_SERVER_POSTGRES_URL instead), along with the JWT secret and initial administrator credentials. Do not configure both database URLs. Then run:
cd app/v2/server/web
npm install
npm run build
cd ../../../..
python -m app.v2.server
Open localhost:8090. Add a model and an Agent to start chatting, or open /studio to manage Agent packages.
See the Server guide for configuration. Server currently supports one worker; database persistence does not enable horizontal scaling.
One Python file; no sage.yaml required. After the Python setup above, save as quickstart.py and replace your-model with an available model:
"""Set MODEL_API_KEY and replace your-model below; no sage.yaml file is needed."""
from typing import cast
from sagents.v2.composition.loaded_agents import ApplicationEntrypoint
import asyncio
from uuid import uuid4
from sagents.v2 import ActorRef, RequestContext, SAgentBuilder, StartRun
from sagents.v2.contracts.commands import InputItem
from sagents.v2.contracts.items import TextBlock
from sagents.v2.contracts.principals import PrincipalType
from sagents.v2.package.manifest import SageManifestLoader
AGENT_YAML = """
schema_version: sage/v2
kind: application
metadata: {id: example.assistant, version: 1.0.0, name: Assistant}
agents:
main:
name: Assistant
instructions: {inline: "Be helpful and concise."}
models: {primary: primary}
entrypoint: {agent: main}
"""
MODELS_YAML = """
credentials:
api-key: {source: env, key: MODEL_API_KEY}
models:
primary:
provider: openai-responses
base_url: https://api.openai.com/v1
credential: api-key
model: your-model
"""
async def main(*, runtime=None, registrations=()):
from sagents.v2.composition.defaults import default_runtime
manifest = SageManifestLoader().loads(AGENT_YAML)
builder = SAgentBuilder()
for registration in registrations:
builder.register(registration)
app = await builder.build(runtime=runtime or default_runtime("runtime"), models_config_text=MODELS_YAML)
try:
agent = await app.load_agent(manifest)
context = RequestContext(actor=ActorRef(
principal_id="user-1", principal_type=PrincipalType.USER,
))
stream = await cast(ApplicationEntrypoint, app.entrypoint()).run_stream(StartRun(
agent_id=agent.id,
input=(InputItem(role="user", content=(TextBlock(text="Say hello!"),)),),
resolved_spec_hash=agent.composition_hash,
idempotency_key=str(uuid4()),
), context, agent=agent)
async for event in stream.events:
print(event.model_dump_json())
print((await stream.wait()).state)
finally:
await app.close()
if __name__ == "__main__":
asyncio.run(main())
export MODEL_API_KEY="your-api-key"
python quickstart.py
loads() parses YAML text; build() accepts the manifest object directly. This prints events and the final state, without file or shell tools. More configuration options →
| Capability | What you can do |
|---|---|
| 📦 Packages and versions | Define instructions, Skills, tools, and resources in sage.yaml; retain candidates, diffs, and evaluation records. |
| 🧠 Models and context | Connect model providers and configure routes, memory, and context budgets. |
| 🔌 Tools, Skills, and MCP | Compose native tools, reusable Skills, and MCP services with host-managed authorization. |
| 💾 Stateful execution | Persist Sessions, stream output, and pause/resume for human input and approvals. |
| 🛡️ Sandbox and resources | Bind execution resources, sandbox providers, tool policies, and runtime budgets through the host. |
| 🤝 Multi-agent workflows and extensions | Orchestrate workflows and member mess |