Sage - Simplified AI agent definition and deployment via configuration
Project description
Sage
Yes, I shamelessly named it after me ;)
Inspired by the recent sprawl of OpenClaw, PicoBot, ZeroClaw, and whatever else popped up last Tuesday — I decided to write my own. Written from the ground up in Python.
Sage doesn't aspire to be the next Claude Code. Instead, it's intentionally designed to be a clean slate out of the box, so that you can make it more intelligent. No opinions. No bloat. Just a solid foundation you can build on top of.
Key Features
🤖 Agents
The core unit. Define an agent in a Markdown file with YAML frontmatter — name, model, system prompt — and you're running. No boilerplate classes, no framework ceremony. Just config and go.
---
name: assistant
model: gpt-4o
---
You are a helpful AI assistant.
🧠 Subagents & Delegation
Agents can have subagents. When they do, they automatically get a delegate tool — the LLM decides when and how to hand off work. It's orchestration without the orchestration code.
🔧 Tools via @tool Decorator
Write a Python function. Decorate it with @tool. Sage auto-generates the JSON schema from your type hints. That's it. No manual schema wrangling.
@tool
def word_count(text: str) -> str:
"""Count the number of words in the given text."""
return str(len(text.split()))
Built-in tools included: shell, file_read, file_write, http_request, memory_store, memory_recall — or load them all at once with sage.tools.builtins.
📚 Skills
Reusable capabilities defined as Markdown files. Drop them in a directory, and agents can load them. Flat files or directory-per-skill — both work. Skills are just knowledge and instructions, cleanly separated from tools.
⚡ Orchestration
Three flavors:
- Pipeline (
>>) — chain agents sequentially. Output of one feeds the next. - Parallel — run multiple agents concurrently via
Orchestrator.run_parallel(). - Autonomous delegation — an orchestrator agent with subagents decides who does what, on its own.
🔌 100+ LLM Providers
Powered by litellm. OpenAI, Azure, Anthropic, Ollama, and basically everything else. One model string, any provider.
| Provider | Model String |
|---|---|
| OpenAI | gpt-4o, gpt-4o-mini |
| Azure | azure/gpt-4o |
| Anthropic | anthropic/claude-sonnet-4-20250514 |
| Ollama | ollama/llama3 |
🧩 MCP Support
Connect to MCP servers (stdio or SSE) or expose your tools as an MCP server. Both directions work.
💾 Semantic Memory
SQLite-backed with litellm embeddings. Zero-config persistent recall across sessions. Compaction built in so context doesn't bloat forever.
🖥️ TUI
A full interactive terminal UI built with Textual. Split-screen layout — chat on the left, live tool-call feed on the right, status bar at the bottom. It's actually nice to use.
🏗️ Protocol-Based Architecture
ProviderProtocol, MemoryProtocol, EmbeddingProtocol — swap out any layer. Don't like the SQLite memory backend? Write your own. Don't want litellm? Implement the protocol. Everything is async-first.
Quick Start
pip install sage
export OPENAI_API_KEY=sk-...
sage agent run AGENTS.md --input "What is the capital of France?"
Code API
import asyncio
from sage import Agent
agent = Agent(
name="assistant",
model="gpt-4o",
body="You are a helpful assistant.",
)
result = asyncio.run(agent.run("What is 2 + 2?"))
print(result)
Or load from config:
agent = Agent.from_config("AGENTS.md")
result = asyncio.run(agent.run("Hello"))
Pipelines
pipeline = researcher >> summarizer
result = asyncio.run(pipeline.run("Explain quantum computing"))
Parallel Execution
from sage import Orchestrator
results = asyncio.run(Orchestrator.run_parallel(agents, "Analyze this topic"))
Autonomous Orchestration
---
name: orchestrator
model: gpt-4o
subagents:
- research_agent
- summarize_agent
---
You are an orchestrator. Use the delegate tool to assign tasks to your subagents.
sage agent run orchestrator/AGENTS.md --input "Research and summarize quantum computing"
CLI
sage agent run AGENTS.md --input "Hello" [--stream] # Run an agent
sage agent validate AGENTS.md # Validate config
sage agent list [directory] # List agent configs
sage tool list AGENTS.md # List available tools
sage init [--name my-agent] [--model gpt-4o] # Scaffold a new project
Configuration Reference
---
name: my-agent
model: gpt-4o
description: "A helpful assistant" # Display only, NOT sent to model
max_turns: 10
tools:
- shell
- file_read
- file_write
- http_request
- memory_store
- memory_recall
- sage.tools.builtins # All built-in tools at once
- myapp.tools:search # Your own tools (module:name)
memory:
backend: sqlite
path: memory.db
embedding: text-embedding-3-large
compaction_threshold: 50
subagents:
- research_agent # Directory containing AGENTS.md
- config: helper.md # Reference another .md file
- name: inline-helper # Or define inline
model: gpt-4o-mini
mcp_servers:
- transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
- transport: sse
url: http://localhost:8080/sse
model_params:
temperature: 0.7
max_tokens: 2048
---
You are a helpful AI assistant.
Architecture
sage/
agent.py # Core Agent class (run loop, delegation)
config.py # Markdown frontmatter loading (Pydantic)
models.py # Message, ToolCall, ToolSchema, etc.
providers/ # ProviderProtocol + LiteLLMProvider
tools/ # @tool decorator, ToolRegistry, builtins
skills/ # Skill loader (markdown-based reusable capabilities)
orchestrator/ # Orchestrator (parallel) + Pipeline (>>)
memory/ # MemoryProtocol, SQLiteMemory, embeddings, compaction
mcp/ # MCPClient + MCPServer
cli/ # Click CLI + Textual TUI
Examples
examples/simple_agent/— Minimal agent with markdown configexamples/custom_tools/— Agent with@tool-decorated functionsexamples/parallel_agents/— Orchestrator with subagentsexamples/mcp_agent/— Agent with MCP filesystem server
Requirements
- Python 3.11+
- See
pyproject.tomlfor full dependency list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sage_agent-1.0.0rc4.tar.gz.
File metadata
- Download URL: sage_agent-1.0.0rc4.tar.gz
- Upload date:
- Size: 49.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4833b8e6c3710a290b10943a4fcf36b6525f561d75b658eb20b423b81b348f7
|
|
| MD5 |
f024dfb362b6672d8733f4706133087c
|
|
| BLAKE2b-256 |
8aa5a0b1f5f1dee14da962a17aaf17b9460239e163eb6c1c64e4d0d44a4169f9
|
Provenance
The following attestation bundles were made for sage_agent-1.0.0rc4.tar.gz:
Publisher:
release.yml on sagebynature/sage-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sage_agent-1.0.0rc4.tar.gz -
Subject digest:
c4833b8e6c3710a290b10943a4fcf36b6525f561d75b658eb20b423b81b348f7 - Sigstore transparency entry: 992321466
- Sigstore integration time:
-
Permalink:
sagebynature/sage-agent@b58bfa3f6a60add6c8ba420a837d357c5bf461c4 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/sagebynature
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b58bfa3f6a60add6c8ba420a837d357c5bf461c4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sage_agent-1.0.0rc4-py3-none-any.whl.
File metadata
- Download URL: sage_agent-1.0.0rc4-py3-none-any.whl
- Upload date:
- Size: 66.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39fc38ea4530ae791ad520a444629671becd957ea8be4fe16619d4557bc28c37
|
|
| MD5 |
4d66b8c33e7cbbd0f9a7d664847de2b6
|
|
| BLAKE2b-256 |
83a5172cb2a984afeeb50ff93fa3f5973a1baf2329b5fc8ddce62753f5b382e8
|
Provenance
The following attestation bundles were made for sage_agent-1.0.0rc4-py3-none-any.whl:
Publisher:
release.yml on sagebynature/sage-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sage_agent-1.0.0rc4-py3-none-any.whl -
Subject digest:
39fc38ea4530ae791ad520a444629671becd957ea8be4fe16619d4557bc28c37 - Sigstore transparency entry: 992321470
- Sigstore integration time:
-
Permalink:
sagebynature/sage-agent@b58bfa3f6a60add6c8ba420a837d357c5bf461c4 -
Branch / Tag:
refs/heads/dev - Owner: https://github.com/sagebynature
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b58bfa3f6a60add6c8ba420a837d357c5bf461c4 -
Trigger Event:
push
-
Statement type: