Expand description
Aither Agent Framework
An ergonomic, minimal-core agent framework for building autonomous AI agents. The agent handles the tool-use loop internally with a simple API.
§Quick Start
ⓘ
use aither_agent::Agent;
// Simple one-shot query
let agent = Agent::new(llm);
let response = agent.query("What is 2+2?").await?;
// With tools and hooks
let agent = Agent::builder(llm)
.tool(FileSystemTool::read_only("."))
.hook(LoggingHook)
.build();
let response = agent.query("List all Rust files").await?;§Features
- Ergonomic API: Simple
query()for one-shot tasks,run()for streaming - Internal Loop: Tool execution handled automatically
- Trait-based Hooks: Intercept operations at compile time
- Smart Compression: Intelligent context management preserving critical info
- Generic over LLM: Works with any
LanguageModelimplementation
Re-exports§
pub use aither_sandbox as sandbox;
Modules§
- ask_
user - Ask-user tool for UI-mediated choice prompts.
- specialized
- Specialized subagent implementations.
- tool_
request - Generic request/response channel helpers for UI-mediated tools.
- transcript
- Readable transcript for LLM context recovery.
- working_
docs - Working document utilities for long-task execution.
- workspace_
request - Workspace request tool.
Structs§
- Agent
- An autonomous agent that processes tasks using tiered language models.
- Agent
Builder - Builder for constructing agents with custom configuration.
- Agent
Checkpoint - Checkpoint payload exported by the agent runtime.
- Agent
Config - Configuration for agent behavior.
- Agent
Stream - Stream of agent events during execution.
- Agent
Tools - Tools registry used by the agent.
- Browser
Backend Error - Error returned by browser backend operations.
- Budgeted
Model - A model with budget tracking.
- Cache
Entry - A cache entry for an uploaded file.
- Cache
Stats - Aggregate prompt-caching statistics collected across one agent session.
- Checkpoint
Context - Structured checkpoint payload emitted from the runtime.
- Compact
Result - Result of a compaction operation.
- Context
- The entire context window state. Fully serializable for persistence.
- Context
Assembler Config - Prompt-level context assembly settings.
- Context
Checkpoint - A snapshot of non-persistent context state that can be restored.
- Context
Window Metrics - Metrics describing the currently assembled context window.
- Context
Window Snapshot - Fully assembled LLM request window plus lifecycle metadata.
- File
Cache - File cache for tracking uploaded files across providers.
- HCons
- Heterogeneous list cons cell for composing hooks at compile time.
- Handoff
Document - Structured handoff document used to recover work after compaction.
- Model
Group - A group of models with the same tier, ordered by preference.
- Prepared
TerminalAgentBuilderstate once its terminal holds prepared tool environments, either fromTerminalAgentBuilder::initialize_toolsor adopted withTerminalAgentBuilder::prepared_shell_sessions.- Preserve
Config - Configuration for what content to preserve during compression.
- Preserved
Content - Content extracted and preserved during compression.
- Reassembly
Report - Outcome of a
Context::reassemblepass. - Smart
Compression Config - Configuration for smart context compression.
- Static
CdpBrowser - Fixed CDP backend backed by a static endpoint string.
- Stop
Context - Context provided to hooks when the agent is about to stop.
- Subagent
Definition - A subagent definition loaded from a file.
- Terminal
Agent Builder - Builder for creating terminal-first agents.
- Tiered
Models - Collection of model groups organized by tier.
- Tool
Result Context - Context provided to hooks after a tool is executed.
- Tool
UseContext - Context provided to hooks before a tool is called.
- Turn
Boundary Context - Context provided to hooks at a safe iteration boundary.
- Unprepared
TerminalAgentBuilderstate while its shell backends are still being configured: the terminal’s tool environments are not prepared yet.
Enums§
- Agent
Error - Errors that can occur during agent execution.
- Agent
Event - Events emitted during agent execution.
- Agent
Kind - Agent specialization mode.
- Budget
- Budget limit for a model.
- Checkpoint
Reason - Reason why a checkpoint is being emitted.
- Compression
Level - Compression aggressiveness level.
- Context
Strategy - Strategy for managing conversation context.
- Context
Window Phase - High-level lifecycle phase of the assembled context window.
- Model
Group Error - Error type for model group operations.
- Model
Tier - Model tier classification for organizing models.
- Post
Tool Action - Action to take after a tool is executed.
- PreTool
Action - Action to take before a tool is executed.
- Stop
Reason - Reason why the agent stopped.
- Turn
Boundary Action - Action to take at a safe turn boundary.
Constants§
- TERMINAL_
SYSTEM_ PROMPT - Default system prompt for terminal-first agents.
Traits§
- Browser
Backend - Backend abstraction for browser automation runtimes.
- Hook
- Trait for intercepting agent operations.
- Tool
- Tools that can be called by language models.
Functions§
- builtin_
subagents - Default subagent definitions embedded in the binary.