The Agentic AI Runtime
An Open Source SDK and Runtime for building Agents
More Agent. Less Code.
What is agent-air?
A Rust SDK and Runtime for building AI Agents.
One Runtime for Terminal, Desktop or Server.
High Performance
Built in Rust for maximum performance with zero-cost abstractions and efficient resource usage.
TUI Included
Optional TUI provides beautiful terminal interfaces with syntax highlighting, markdown rendering, and interactive components.
Headless Runtime
Flexible and powerful event-driven API for server-side agents that power any frontend.
Multi-Platform
Multi-platform support via FFI bindings for Python, TypeScript, Go, Swift, and more.
Any Provider, Any Model
Works with 75+ LLM Providers and 500+ Models
Use any LLM provider through a unified interface. Switch providers or models dynamically - no vendor lock-in.
Less Code, More Agent
Get started in just a few lines of code.
use agent_air::agent::AgentAir;
use agent_air::tui::AgentAirExt;
const SYSTEM_PROMPT: &str = "You are a helpful AI assistant.";
fn main() -> std::io::Result<()> {
AgentAir::with_config("my-agent", "~/.config/my-agent", SYSTEM_PROMPT)?
.into_tui()
.run()
} Batteries Included
Everything You Need to Build AI Agents
Start building immediately with a complete toolkit. No need to piece together dozens of libraries.
High Performance Rust Core
Built in Rust for maximum performance with zero-cost abstractions. Features an async-first architecture powered by Tokio, message-passing via typed bounded channels, non-blocking I/O throughout, and a backpressure-driven event loop that ensures graceful degradation under load.
Multi Model Architecture
75+ providers and 500+ models. Switch models at runtime or per-session.
Modular Architecture
Supports Terminal UI, Desktop or Web-based frontends with event-driven API.
Advanced Session Management
Fully isolated concurrent sessions, each with independent conversation history, tool registrations, permission grants, and compaction settings. Supports runtime model switching per session, parallel request processing, and comprehensive lifecycle control (clear, interrupt, compact, destroy). Session state persists across switches for seamless multi-context workflows.
Advanced Context Management
Smart context management with threshold-based, on-demand, or LLM-driven compaction strategies. Real-time token tracking per session and model with prompt cache support.
Flexible Tool Management
Register custom tools with JSON schema; parallel batch execution with per-tool error handling. Built-in tools: ReadFile, WriteFile, EditFile, MultiEdit, Grep, Glob, Bash, Ls, AskUserQuestions, WebSearch.
MCP Protocol
Model Context Protocol support for external tool integrations and ecosystem compatibility. Connect to MCP servers to extend your agent with additional capabilities.
Streaming Responses & Powerful Markdown Rendering
Real-time SSE parsing delivers tokens incrementally as they arrive from the LLM. Full CommonMark-compliant markdown rendering with theme-aware styling, syntax-highlighted code blocks, tables with column alignment, nested lists, and blockquotes. Virtualized rendering with caching ensures smooth performance even with long content.
Widget System
Pre-built widgets: StatusBar, ChatView, TextInput, QuestionPanel, PermissionPanel, SessionPicker.
Powerful Permissions Framework
Target + Level model with batch requests and recursive path grants.
Advanced Command Framework with Slash Commands
Built-in commands for common operations plus a powerful custom command system. Register your own commands via the CommandRegistry with sync or async execution. Commands receive full context and can share state via the extension context mechanism. Interactive popup with real-time filtering as you type.
Agent Skills Support
Modular skill system for extending agent capabilities with reusable, composable behaviors that can be shared across agents.
Error Recovery
Graceful degradation with retries and actionable error messages.
Custom Keybindings
Standard keybindings included with Emacs support. Implement the KeyHandler trait for complete control over key interpretation - create modal editors, chorded shortcuts, or context-sensitive bindings. ComposedKeyHandler combines multiple handlers with priority ordering.