Skip to main content

SAGO-Agent

Production-grade multi-agent orchestration system — 339 specialist agents, 56+ production tools, multi-LLM support, streaming, parallel execution, feedback loops, workflows, containerized card TUI with dashboard, and built-in security.

Python 3.11+ License: GPL-3.0


What is Sago?

Sago is a production-grade multi-agent orchestration system built for real-world software engineering tasks. It goes beyond simple code generation — it autonomously delegates work to 339 specialist agents, uses 56+ production tools, streams responses token-by-token, runs agents in parallel, manages sessions, enforces permissions, and runs workflows.

Key Capabilities

Feature Description
339 Specialist Agents Agents across 22 domains (engineering, security, data, cloud, compliance, etc.) with domain-specific tool suites
56+ Production Tools File ops, AST symbol graphs, database query/schema/migration, shell, networking, SSH, Docker, and more
Parallel Agent Execution Run multiple agents simultaneously on the same task
Feedback Loops Agents can request clarification from previous agents in a chain
Recursion Protection Depth tracking, cycle detection, and visited-agent guards
Structured Handoffs Typed context passing between agents with history tracking
AI-Powered Routing sago smart asks the LLM to pick the best agent for any task
Token-by-Token Streaming Real-time streaming with usage tracking via OpenAI streaming API
Permission System Risk-based tool permissions (safe/low/medium/high/critical) with approval workflow
Session Persistence SQLite database + JSON file save/load with full state preservation
Workflow Engine Stateful multi-step workflows with dependencies, retries, and pausing
Hybrid BM25 & Dense Code Search Probabilistic BM25 + zero-dependency 128-d dense vector semantic search across 1,000+ files (sago search)
Continuous Background Linting Automatic non-blocking verification passes upon file modification with instant diagnostics
OpenTelemetry & Prometheus Export Standard OTel JSON trace payload and Prometheus text exposition telemetry export (/dev export otel)
Hierarchical Memory Pyramids 3-tiered context compaction and zero-redundancy agent handoffs saving ~70% token overhead
Developer Mode (/dev) Real-time function execution tracing, LLM payload inspection, and microsecond latency diagnostics
Atomic Checkpoints & Rollback Point-in-time workspace snapshotting and 1-click restore for large-scale refactoring safety
Smart Project & Data Graph Architecture box diagrams, autonomous execution process maps, data model extraction, and Mermaid visualization
Detach Mode & Background Workers Detached execution for CLI tasks and TUI sessions allowing safe terminal closing with sago attach reconnection
Containerized Card TUI High-density terminal UI with 11 themes, collapsible turn cards, live agent dashboard, smart autocomplete, and fluid animations
Multi-LLM Support OpenRouter, OpenAI, Gemini, Claude, Ollama
Token Cost Tracking Per-model pricing with cache hit/miss analytics
Security Audit Path traversal protection, secret scanner, input validation, sensitive data filtering

Quick Start

# Clone the repository
git clone https://github.com/SAGO-AUTOMATES/SAGO-Agent.git
cd SAGO-Agent

# Install dependencies
pip install -e .

# Set your API key
export OPENROUTER_API_KEY="your-key-here"

# Launch the TUI
sago tui

# Or run tasks from CLI
sago smart "Fix the authentication bug"
sago run "Build a REST API" --agent python-engineer

Installation

From Source (Recommended)

git clone https://github.com/SAGO-AUTOMATES/SAGO-Agent.git
cd SAGO-Agent
pip install -e .

Using uv (Faster)

git clone https://github.com/SAGO-AUTOMATES/SAGO-Agent.git
cd SAGO-Agent
uv pip install -e .

Documentation & Technical Flows

Dependencies

  • Python 3.11+
  • openai (for LLM calls)
  • textual (for TUI)
  • pydantic (for data validation)

Optional:

  • crewai (for CrewAI orchestration path)
  • langgraph (for LangGraph workflow engine)
  • anthropic (for Claude provider)
  • google-generativeai (for Gemini provider)

CLI Commands

See docs/COMMANDS.md for full CLI and TUI command reference.

Core Execution

Command Description
sago smart "task" AI-powered execution — LLM selects best agent, streams response
sago run "task" Execute task with auto-orchestration
sago run "task" --agent X Use specific agent
sago run "task" --chain X,Y,Z Sequential agent chain
sago run "task" --effort high Control execution depth (low/medium/high/max)
sago map [--dir .] Symbol Repo Map — Compact AST symbol map across 1,000+ files
sago project-graph --view llm AI Architecture Analysis — Generate an LLM-backed report from the project topology
sago verify [--dir .] Self-Healing Verification — Automated linters, type checks & tests
sago skills [--filter X] List workspace & built-in skills and capabilities
sago plugins List loaded third-party plugins and lifecycle hooks

Interactive TUI

Command Shortcut Description
sago tui — Launch interactive terminal UI
/help — Show all commands
/graph [view] [path] — Show project topology, diagrams, or AI architectural analysis
/copy [code|all] — Copy the last response, code block, or chat history to the clipboard
/clip [code|all] — Alias for /copy
/agents [category] — List/search agents by category or name
/agent <name> — Set current agent
/skills [filter] — List workspace & custom skills
/plugins — List third-party plugins
/delegate <agent> <task> — Delegate to specialist
/chain <a1,a2> <task> — Chain agents sequentially
/parallel <a1,a2> <task> — Run agents in parallel on same task
/orchestrate <task> — Auto-delegate to specialists
/dashboard Ctrl+D Toggle agent dashboard sidebar
/tasks Ctrl+T Show background tasks
/cancel <id|all> Ctrl+C Cancel running task(s)
/handoff — Show handoff targets for current agent
/effort <level> — Set effort: low/medium/high/max
/cost — Token usage and costs
/summary — Toggle task summary display
/save [name] — Save session to file
/load <name> — Load session from file
/compact — Summarize context
/permissions — Show tool permissions
/allow <tool> — Allow a tool
/block <tool> — Block a tool
/git — Git status
/diff [file] — Show diff
/commit <msg> — Commit changes

Workflows

Command Description
sago workflows List all workflows
sago workflow-create "name" Create new workflow
sago workflow-add-step <id> Add step to workflow
sago workflow-run <id> Execute workflow

System

Command Description
sago status System status
sago agents [category] List all categories or drill down into a category
sago info <agent> Agent details
sago init Initialize project
sago daemon start Start background server
sago daemon stop Stop server

339 Agents Across 22 Categories

Category Count Examples
Specialized Engineering 71 security-engineer, devsecops-engineer, blockchain-engineer
Engineering Dev 52 full-stack-engineer, backend-engineer, mobile-engineer
Language Specific 35 python-engineer, rust-engineer, go-engineer
Data Intelligence 34 data-engineer, ml-engineer, ai-engineer
Infrastructure Ops 23 devops, kubernetes-engineer, terraform-engineer
Database Specialists 16 postgresql-engineer, mongodb-engineer, redis-engineer
Compliance Legal Finance 16 gdpr-engineer, soc2-engineer, hipaa-engineer
Planning Oversight 13 technical-debt-manager, risk-manager, capacity-planner
Design Architecture 12 solutions-architect, enterprise-architect, security-architect
Testing Quality 11 qa-engineer, penetration-tester, performance-engineer
Orchestration 10 engineering-manager, scrum-master, technical-program-manager
Content Communication 10 technical-writer, documentation-updater, tech-translator
Cloud Infra Architecture 9 aws-engineer, gcp-engineer, azure-engineer
System Extensibility 6 agent-builder, prompt-engineer, skill-creator
Frontend Frameworks 5 react-engineer, vue-engineer, angular-engineer
Business Revenue 5 developer-advocate, sales-engineer, marketing-engineer
People Culture 3 technical-recruiter, training-specialist
Executive 3 cto, vp-engineering, ceo
Cloud Providers 2 cloudflare-engineer, oracle-cloud-engineer
Business Analysis 2 business-analyst, data-analyst
IT Support 1 it-support-engineer
Game Development 1 game-engineer

50 Production Tools

See docs/TOOLS.md for complete tool documentation with usage examples.

File Operations

  • read_file — Read file contents
  • write_file — Write files with auto-directory creation
  • glob_files — Pattern-based file search
  • grep_content — Regex content search
  • file_operations — Move, copy, delete, rename, mkdir, list
  • archive — Create/extract zip, tar, tar.gz, tar.bz2
  • hash_checksum — MD5, SHA1, SHA256, SHA512
  • diff_tool — Compare files/text
  • regex_tester — Test/debug regular expressions
  • pdf_reader — Extract text from PDFs
  • data_processor — JSON/YAML parse, validate, format, query, merge

Shell & System

  • execute_shell — Run shell commands
  • background_process — Run commands in background
  • process_manager — List/kill processes
  • env_info — System, disk, memory, network info
  • env_manager — Environment variable management
  • os_detector — Detect operating system
  • cron_schedule — Manage scheduled tasks
  • screenshot — Capture screenshots

Network

  • http_client — API requests (GET, POST, PUT, DELETE)
  • web_crawler — Crawl websites, extract content
  • dns_lookup — DNS resolution
  • port_scan — Scan ports
  • network_config — Network configuration info

SSH

  • ssh_connect — SSH connections
  • ssh_command — Execute remote commands
  • ssh_transfer — File transfer via SCP/SFTP

Coding

  • code_analyzer — Code structure, complexity, issues
  • linter — Code linting
  • formatter — Code formatting
  • test_runner — Run tests
  • debugger — Debug with breakpoints, AST analysis
  • log_analyzer — Analyze log files
  • text_summarizer — Summarize text

DevOps

  • docker_ops — Docker ps, build, run, compose
  • git_ops — Git status, log, diff, commit, push

Session & Other

  • session_manager — Session management
  • clipboard — Clipboard operations
  • prompt_generator — Generate prompts
  • permission_manager — Manage permissions
  • spawn_agent — Delegate to specialist agents

Permission System

Sago includes a risk-based permission system that controls which tools can be executed.

Risk Levels

Level Tools Default
Safe read_file, glob_files, env_info, os_detector Auto-approved
Low write_file, edit_file, file_operations Auto-approved
Medium execute_shell, background_process, docker_ops Requires approval
High ssh_connect, ssh_command, sudo_executor Requires approval
Critical spawn_agent Requires approval

Managing Permissions

# View all tool permissions
/permissions

# View blocked tools only
/permissions blocked

# Allow a tool
/allow execute_shell

# Block a tool
/block sudo_executor

Configuration

Permissions are stored in ~/.sago/permissions.json:

{
  "auto_approve_safe": true,
  "auto_approve_low": true,
  "require_approval_medium": true,
  "require_approval_high": true,
  "require_approval_critical": true,
  "blocked_tools": ["dangerous_tool"]
}

Session Persistence

Sessions are automatically saved to SQLite (~/.sago/data/sago.db) and can be exported to JSON.

# Save current session
/save my-session

# List saved sessions
/sessions

# Load a session
/load my-session

# Export to markdown
/export

# Compact context (summarize old messages)
/compact

Token Usage & Cost Tracking

# In TUI
/cost

# From CLI
sago usage

Output includes:

  • Total input/output tokens
  • Cache hit/miss counts and savings percentage
  • Per-model cost breakdown (9 models supported)
  • Session-level and cumulative tracking

Workflow Engine

Create stateful, multi-step automations:

# Create a workflow
sago workflow-create "Deploy Pipeline"

# Add steps with dependencies
sago workflow-add-step <id> --name "Test" --type agent_call --config '{"task": "Run tests"}'
sago workflow-add-step <id> --name "Build" --type tool_call --config '{"tool": "execute_shell", "args": {"command": "make build"}}' --depends-on test-step
sago workflow-add-step <id> --name "Deploy" --type agent_call --config '{"task": "Deploy to production"}' --depends-on build-step

# Execute
sago workflow-run <id>

# Stream execution
sago workflow-run <id> --stream

Architecture

See docs/PROJECT.md for detailed project structure. MCP server documented in docs/MCP.md.

sago/
├── agents/              # 339 agent profiles
│   ├── profiles/        # One .py per agent with metadata
│   ├── registry.py      # Agent loading and lookup
│   ├── spawner.py       # Agent execution with feedback loops
│   └── handoff.py       # HandoffContext, RecursionGuard, FeedbackRequest
├── tools/               # 50 production tools
│   ├── base.py          # BaseTool with permission checks
│   ├── file/            # File operations (12 tools)
│   ├── shell/           # Shell execution
│   ├── network/         # HTTP, DNS, crawling
│   ├── coding/          # Code analysis, debugging
│   ├── ssh/             # SSH operations
│   ├── system/          # Git, Docker, env
│   └── admin/           # Sudo, permissions
├── engine/              # Execution engines
│   ├── simple_executor.py   # Smart executor with auto-discovery
│   └── unified.py           # Unified executor (simple/crewai/langgraph)
├── permissions.py       # Risk-based permission system
├── workflow/            # Workflow engine
│   ├── engine.py        # Stateful workflows with dependencies
│   └── langgraph_engine.py  # LangGraph integration
├── server/              # TCP daemon server
│   └── daemon.py        # Background daemon with client
├── mcp/                 # Model Context Protocol
│   └── server.py        # MCP server with 50 tools
├── tui/                 # Terminal UI
│   ├── app.py           # Textual TUI with dashboard
│   ├── widgets/         # AgentDashboard, AgentSpinner, HandoffFlow
│   ├── helpers.py       # Agent-tagged message rendering
│   └── smart_input.py   # Input processor
├── llm/                 # LLM providers
│   ├── openai_provider.py
│   ├── openrouter.py
│   ├── gemini.py
│   └── claude.py
├── memory/              # Memory and context
│   ├── rag.py           # RAG memory with search
│   ├── compaction.py    # Session compaction
│   └── profiles.py      # User profiles
├── cache/               # Intelligent caching
│   └── intelligent.py   # Content-hash cache with TTL/LRU
├── tracking/            # Usage tracking
│   └── token_tracker.py # Token counting and cost
├── sessions/            # Session management
│   └── manager.py       # Multi-session with parallel execution
├── errors/              # Error handling
│   └── handler.py       # Recovery with fallback tools
├── database.py          # SQLite persistence
├── paths.py             # Cross-platform paths
├── config/              # Configuration
│   ├── loader.py
│   ├── project_config.py
│   └── sago.yaml
└── main.py              # CLI entry point

Quality

Sago includes comprehensive coverage across unit, integration, and security categories.

433 tests — all passing. See docs/ERRORS.md for error handling and docs/FLOWS.md for system flowcharts.

Quality Areas

Category Coverage
Unit - Tools All 57+ tools with proper arguments
Unit - Dynamic Topology Graph & Cache Dynamic project title, execution lifecycle maps, and cross-session disk cache
Unit - Semantic Intent Classifier Micro-LLM intent detection, LRU cache & conversational classification
Unit - Hybrid Indexer & BM25 BM25 probabilistic ranking & dense semantic vector similarity
Unit - Continuous Verifier Background non-blocking verification queue & diagnostic extraction
Unit - OpenTelemetry & Prometheus OTel Trace JSON specification & Prometheus exposition format
Unit - Memory Pyramids & Deltas 3-tiered memory hierarchy & zero-redundancy handoff state deltas
Unit - Permissions Risk levels, blocking, approval workflow
Unit - Agents Registry, profiles, lookup
Integration - Executor Tool discovery, task detection, extraction
Integration - Server Daemon, client, protocol
Integration - Workflow Engine, steps, dependencies
Integration - MCP Server, tools, creation
Security Path traversal, injection, bypass, validation

Security

Path Traversal Protection

  • Tools validate file paths before execution
  • Blocked paths configurable per project

Command Injection Protection

  • Shell commands validated before execution
  • Permission system blocks dangerous operations

Permission Bypass Prevention

  • High/critical risk tools require explicit approval
  • Session-isolated approval state
  • Blocked tools cannot be executed even with valid credentials

Input Validation

  • Empty/None inputs handled gracefully
  • Special characters sanitized
  • Error messages don't expose internals

Sensitive Data Filtering

  • API keys never exposed in tool output
  • Passwords filtered from system info

LLM Providers

Provider Models API Key Streaming
OpenRouter Multiple models OPENROUTER_API_KEY Yes
OpenAI gpt-4o, gpt-4o-mini OPENAI_API_KEY Yes
Gemini gemini-2.0-flash, gemini-1.5-pro GEMINI_API_KEY Yes
Claude claude-3-5-sonnet, claude-3-haiku ANTHROPIC_API_KEY Yes
Ollama Local models None required Yes

Effort Levels

Level Max Tokens Max Iterations Use Case
Low 8,192 3 Quick fixes, typos
Medium 16,384 5 Standard tasks
High 32,768 8 Complex architecture
Max 65,536 12 Critical systems

Configuration

Project Config

After sago init, edit config.sago.json:

{
  "agents": {
    "python-engineer": {
      "enabled": true,
      "system_prompt_override": "Custom prompt...",
      "tools_add": ["web_crawler"],
      "temperature": 0.8
    }
  },
  "permissions": {
    "allow_shell_execute": true,
    "allow_ssh": false,
    "blocked_paths": ["/etc", "/sys"]
  }
}

Global Config

Stored in ~/.sago/:

~/.sago/
├── data/sago.db          # SQLite database
├── permissions.json      # Tool permissions
├── sessions/             # Saved sessions (JSON)
└── config.yaml           # Global configuration

CI/CD

GitHub Actions pipeline runs on every push:

  1. Lint — Ruff code quality
  2. Type Check — MyPy static analysis
  3. Unit Tests — Tool, permission, agent tests
  4. Integration Tests — Executor, server, workflow tests
  5. Security Tests — Vulnerability checks
  6. Build — Package build verification

See .github/workflows/ci.yml for details.


Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Make your changes
  4. Ensure code quality with linting
  5. Submit a pull request

Development Setup

git clone https://github.com/SAGO-AUTOMATES/SAGO-Agent.git
cd SAGO-Agent
pip install -e ".[dev]"

Documentation

Document Description
docs/BUILD.md Build and installation instructions
docs/COMMANDS.md CLI and TUI command reference
docs/TOOLS.md All 50 tools with examples
docs/ERRORS.md Error handling and recovery
docs/MCP.md MCP server integration
docs/PROJECT.md Project structure and architecture

License

GPL-3.0 - see LICENSE for details.


Sago — Because every task deserves the perfect agent.

Release files for sago-agent 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sago-agent 0.1.4
File Size Uploaded
sago_agent-0.1.4.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sago-agent 0.1.4
File Interpreter ABI Platform
sago_agent-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 2.5 MB

Release files / sago_agent-0.1.4.tar.gz

Download URL sago_agent-0.1.4.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
f47c7299ee31d5a4f5496907a78533134db7bafe9c4b32bea145289013fe03f9
BLAKE2b-256 checksum
How to use checksums
fe20c7c4ec5f1c886481238a301eb31e6bc46a09b22742ca55b2600863c661f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / sago_agent-0.1.4-py3-none-any.whl

Download URL sago_agent-0.1.4-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
25196fd1d2ab37232907e9f23781f5c7556d472989a167d9c1999d664282957f
BLAKE2b-256 checksum
How to use checksums
b05b2ebdfb42b49306d6c653111309947089621745af9210cb432681de667616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page