sagent
A coding-agent CLI and strongly-typed Python library that supports async tool calls, hot-swapping the model or provider mid-session, and bidirectional recursive agent spawning and messaging.
sagent is a coding-agent CLI and a strongly-typed Python library built around one Agent class that powers both. It lets an agent retune its own provider, model or thinking effort mid-session in plain English with no restart, and supports recursive agent spawning where any spawned agent can message any peer, making coordination a tree rather than a single flat lead-and-workers structure.
It provides an async REPL for chatting with agents about jobs while those jobs keep running, unified cost tracking that rolls sub-agent spend up to a root total with an overall budget cap, and support for many providers, including Anthropic, OpenAI, Google, Moonshot, DashScope, MiniMax, OpenAI-compatible endpoints, self-hosted Hugging Face models and a managed llama.cpp server, behind one binary. Built-in tools include citation-graph paper search and fetch, multi-backend web search, and markdown-extracting web fetch.
It installs with uv, is Unix-aligned with JSON output and standard exit codes for scripting, and the same Agent class is also usable as a library in an application.