Expand description
Agent Air
A Rust Framework for building TUI Agents powered by large language models.
Homepage: https://agent-air.ai
This is a meta-crate that re-exports from:
agent-air-runtime- Core runtime (always included)agent-air-tui- TUI frontend (optional, enabled by default)
§Features
tui(default) - Include the TUI frontend
§Quick Start (with TUI)
ⓘ
use agent_air::agent::{AgentConfig, AgentAir};
use agent_air::tui::AgentAirExt;
struct MyConfig;
impl AgentConfig for MyConfig {
fn config_path(&self) -> &str { ".myagent/config.yaml" }
fn default_system_prompt(&self) -> &str { "You are helpful." }
fn log_prefix(&self) -> &str { "myagent" }
fn name(&self) -> &str { "MyAgent" }
}
fn main() -> std::io::Result<()> {
let agent = AgentAir::new(&MyConfig)?;
agent.into_tui().run()
}§Headless Usage (without TUI)
ⓘ
use agent_air::agent::{AgentConfig, AgentAir};
struct MyConfig;
impl AgentConfig for MyConfig {
fn config_path(&self) -> &str { ".myagent/config.yaml" }
fn default_system_prompt(&self) -> &str { "You are helpful." }
fn log_prefix(&self) -> &str { "myagent" }
fn name(&self) -> &str { "MyAgent" }
}
fn main() -> std::io::Result<()> {
let mut core = AgentAir::new(&MyConfig)?;
core.start_background_tasks();
// Get channels for custom frontend integration
let tx = core.to_controller_tx();
let rx = core.take_from_controller_rx();
// Create a session and interact programmatically
let (session_id, model, _) = core.create_initial_session()?;
// ... implement your own event loop
core.shutdown();
Ok(())
}Modules§
- agent
- Agent infrastructure and configuration. Agent Infrastructure
- client
- LLM client interface and provider implementations. LLM client with provider-agnostic interface.
- controller
- LLM session controller and tool execution. LLM session controller and tool execution framework.
- permissions
- Permission system for controlling agent access to resources. Permission system for controlling agent access to resources.
- skills
- Agent Skills support for extended capabilities. Agent Skills support for extended agent capabilities.
- tui
- TUI frontend for agent-air.