Sagewai is an open-source agent platform: describe the goal, the Autopilot designs the agent graph, workers run it in isolation, and the Training Loop fine-tunes local models so every run gets cheaper.
from sagewai import UniversalAgent, tool
@tool
async def get_weather(city: str) -> str:
"""Get current weather for a city."""
return f"Sunny, 22°C in {city}"
agent = UniversalAgent(
name="weather-bot",
model="gpt-4o",
tools=[get_weather],
)
response = await agent.chat("What's the weather in Berlin?")
print(response) # "It's sunny and 22°C in Berlin!"The platform is the SDK plus four capabilities — Autopilot, Fleet, Observatory, Training Loop — with Sealed security across all of them.
Python-native agent runtime — multi-model providers, tools via MCP gateway, typed memory with extraction strategies and per-mission branching and checkpoint save/restore, guardrails, and LLM proxy in one import. Three lines to your first agent, 100+ models out of the box.
State the goal in plain English. Autopilot designs the agent graph, extracts the slots, previews the plan, runs the mission, and heals on failure.
Distributed workers with capability-based dispatch, project isolation, enrollment keys, and isolated execution sandboxes (image families, Kubernetes backend, AgentCore-runtime backend, pooling). Run agents on your hardware, in your network.
OpenTelemetry tracing, VictoriaMetrics metrics, Grafana dashboards, cost tracking, audit trail. Your AI source of truth — answer "what did AI cost us this month?" in one click.
Curate production runs, export for Unsloth, fine-tune local models, promote the good ones. Agents that get cheaper with use — $0 per token at the limit.
Per-CLI workload identity, externalised secret backends with just-in-time credentials, redaction at the RPC boundary, per-CLI access control, JIT human-in-the-loop on high-privilege actions, and replay-safe audit. Sealed is the security layer wired into every part of the platform.
From simple single-agent tasks to complex multi-agent pipelines with safety guardrails and cost controls.
Compose agents into sequential, parallel, or loop patterns. Each agent can use a different model.
from sagewai import UniversalAgent, SequentialAgent, ParallelAgent
researcher = UniversalAgent(name="researcher", model="gpt-4o")
writer = UniversalAgent(name="writer", model="claude-3-5-sonnet-20241022")
reviewer = UniversalAgent(name="reviewer", model="gpt-4o-mini")
# Pipeline: research -> write -> review
pipeline = SequentialAgent(
name="article-pipeline",
agents=[researcher, writer, reviewer],
)
result = await pipeline.chat("Write about quantum computing")Protect inputs and outputs with PII detection, hallucination guards, content filters, and token budgets.
from sagewai import UniversalAgent
from sagewai.safety.pii import PIIGuard, PIIEntityType
from sagewai.safety.hallucination import HallucinationGuard
agent = UniversalAgent(
name="safe-agent",
model="gpt-4o",
guardrails=[
PIIGuard(action="redact", entity_types=[
PIIEntityType.EMAIL,
PIIEntityType.PHONE,
PIIEntityType.SSN,
]),
HallucinationGuard(threshold=0.3, action="warn"),
],
)
# PII is automatically redacted before reaching the LLM
# Hallucinations are flagged based on RAG context groundingWrite your agent once, then swap models with a single parameter. No code changes required.
Plus Azure OpenAI, AWS Bedrock, Vertex AI, Together AI, Groq, Fireworks, and many more.
Use what you need. Every module is independently importable and composable.
Install the SDK and create your first agent in under a minute.
pip install sagewai