SAGE - Smart Agent Guidance Engine
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
SAGE is a local-first command wrapper for AI coding agents. It keeps full terminal output on your machine, sends agents a clean compressed summary, and tracks proof metrics without uploading your raw logs.
Use it with Claude Code, Codex, Cursor, Windsurf, OpenCode, Cline, custom agents, CI scripts, and normal terminal workflows.
Start Here: Install SAGE, Use once sage run -- python -m pytest, Then Use Any AI Agent
Package installation is passive for package-registry safety. After installing, run sage install once to activate SAGE for supported local AI agents.
PyPI / pip
npm / npx
After install, restart any open AI-agent sessions. New sessions should read the SAGE instructions automatically and route terminal commands through SAGE.
Example prompt after restarting your AI agent:
Natural shortcuts also work:
These are treated as:
What SAGE Does
| Step | Result |
|---|---|
| sage install | Activates the machine locally, repairs global/project agent instructions, and verifies activation |
| sage run -- | Runs the command, stores raw output locally, and returns a compact useful summary |
| Agent memory/hooks | Tell supported AI agents to use SAGE for noisy terminal work |
| Local database | Keeps command history, compression proof, and retry context on the user's machine |
| Local proof | Keeps command and compression metrics on the user's machine |
SAGE does not auto-enable MCP. MCP is optional and manual for users who want it.
Recorded Local Metrics
Latest pulled stats as of 2026-08-01:
| Metric | Value |
|---|---:|
| SAGE telemetry command events | 27,892 |
| Tokens processed | 799.5M |
| Tokens saved | 783.7M |
| Compression rate | 98.02% |
| Estimated savings | $16,261.90 |
| Command success rate | 88.3% |
| PyPI downloads, last 7 days | 632 |
| npm downloads, last 7 days | 362 |
| GitHub clones, last 14 days | 574 |
Why It Helps
AI coding agents burn context on repeated logs, failed test output, install noise, stack traces, and build spam. SAGE sits between the command and the agent.
| Without SAGE | With SAGE |
|---|---|
| Agent sees full noisy terminal output | Agent sees the useful summary |
| Context disappears fast | Context lasts longer |
| Repeated failures waste tokens | Errors are grouped and explained |
| Raw logs may enter prompts | Raw logs stay local |
| Hard to prove savings | SAGE records proof metrics |
Distribution
| Channel | Package | Status |
|---|---|---|
| PyPI | psycgod-sage | Canonical Python package |
| npm / npx | psycgod-sage | Node launcher for the Python core |
| MCP Registry | io.github.PsYcGoD/sage | Optional/manual MCP entry |
| Glama | PsYcGoD/sage | Optional/manual hosted MCP listing |
The npm package delegates to the Python implementation so both install paths use the same local database, telemetry rules, compression, and command behavior.
Common Commands
Privacy Modes
| Mode | Requires login? | Sends data? | What leaves the machine? |