Open Source · The Autonomous Agent Platform

Build agents that run in production.

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.

quickstart.py
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!"

What you get

The platform is the SDK plus four capabilities — Autopilot, Fleet, Observatory, Training Loop — with Sealed security across all of them.

SDK

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.

Autopilot

State the goal in plain English. Autopilot designs the agent graph, extracts the slots, previews the plan, and runs the mission (linear plans today; branched plans in progress).

Fleet

Distributed workers with capability-based dispatch, project isolation, enrollment keys, and isolated execution sandboxes (Docker and Kubernetes backends, image families, pooling). Run agents on your hardware, in your network.

Observatory

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.

Training Loop

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.

Sealed — the security layer

Per-workload identity, external secret backends (HashiCorp Vault), and admin profile and secret controls ship today. Runtime enforcement — live secret injection, redaction, per-key ACLs, and mid-run revocation — is experimental and maturing. See the v1.0 status for what to rely on.

Built for Real Workloads

From simple single-agent tasks to complex multi-agent pipelines with safety guardrails and cost controls.

Multi-Agent Workflows

Compose agents into sequential, parallel, or loop patterns. Each agent can use a different model.

workflow.py
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")

Safety Guardrails

Protect inputs and outputs with PII detection, hallucination guards, content filters, and token budgets.

guardrails.py
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 grounding

100+ Supported Models

Write your agent once, then swap models with a single parameter. No code changes required.

GPT-4oOpenAI
GPT-4o-miniOpenAI
Claude 3.5 SonnetAnthropic
Claude Opus 4Anthropic
Gemini 2.0 FlashGoogle
Gemini 2.5 ProGoogle
Mistral LargeMistral
Command R+Cohere
DeepSeek V3DeepSeek
Llama 3.1 405BMeta

Plus Azure OpenAI, AWS Bedrock, Vertex AI, Together AI, Groq, Fireworks, and many more.

Modular Architecture

Use what you need. Every module is independently importable and composable.

SDK

  • BaseAgent
  • Strategies
  • Workflows
  • Memory & RAG
  • Guardrails

Autopilot

  • Goal Router
  • Mission Driver
  • Slot Extraction
  • Plan Preview
  • Healing (roadmap)

Fleet

  • Workers
  • Sandbox Backends
  • Capability Dispatch
  • Project Isolation
  • Image Families

Observatory

  • Cost Tracking
  • Audit Logs
  • Prometheus Metrics
  • OpenTelemetry

Training Loop

  • Curator
  • Unsloth Integration
  • Promoter
  • Local LLM Discovery
  • Fine-Tuning Pipeline

Ready to build?

Install the SDK and create your first agent in under a minute.

pip install sagewai