Skip to main content

Crate aither_agent

Crate aither_agent 

Source
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 LanguageModel implementation

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.
AgentBuilder
Builder for constructing agents with custom configuration.
AgentCheckpoint
Checkpoint payload exported by the agent runtime.
AgentConfig
Configuration for agent behavior.
AgentStream
Stream of agent events during execution.
AgentTools
Tools registry used by the agent.
BrowserBackendError
Error returned by browser backend operations.
BudgetedModel
A model with budget tracking.
CacheEntry
A cache entry for an uploaded file.
CacheStats
Aggregate prompt-caching statistics collected across one agent session.
CheckpointContext
Structured checkpoint payload emitted from the runtime.
CompactResult
Result of a compaction operation.
Context
The entire context window state. Fully serializable for persistence.
ContextAssemblerConfig
Prompt-level context assembly settings.
ContextCheckpoint
A snapshot of non-persistent context state that can be restored.
ContextWindowMetrics
Metrics describing the currently assembled context window.
ContextWindowSnapshot
Fully assembled LLM request window plus lifecycle metadata.
FileCache
File cache for tracking uploaded files across providers.
HCons
Heterogeneous list cons cell for composing hooks at compile time.
HandoffDocument
Structured handoff document used to recover work after compaction.
ModelGroup
A group of models with the same tier, ordered by preference.
Prepared
TerminalAgentBuilder state once its terminal holds prepared tool environments, either from TerminalAgentBuilder::initialize_tools or adopted with TerminalAgentBuilder::prepared_shell_sessions.
PreserveConfig
Configuration for what content to preserve during compression.
PreservedContent
Content extracted and preserved during compression.
ReassemblyReport
Outcome of a Context::reassemble pass.
SmartCompressionConfig
Configuration for smart context compression.
StaticCdpBrowser
Fixed CDP backend backed by a static endpoint string.
StopContext
Context provided to hooks when the agent is about to stop.
SubagentDefinition
A subagent definition loaded from a file.
TerminalAgentBuilder
Builder for creating terminal-first agents.
TieredModels
Collection of model groups organized by tier.
ToolResultContext
Context provided to hooks after a tool is executed.
ToolUseContext
Context provided to hooks before a tool is called.
TurnBoundaryContext
Context provided to hooks at a safe iteration boundary.
Unprepared
TerminalAgentBuilder state while its shell backends are still being configured: the terminal’s tool environments are not prepared yet.

Enums§

AgentError
Errors that can occur during agent execution.
AgentEvent
Events emitted during agent execution.
AgentKind
Agent specialization mode.
Budget
Budget limit for a model.
CheckpointReason
Reason why a checkpoint is being emitted.
CompressionLevel
Compression aggressiveness level.
ContextStrategy
Strategy for managing conversation context.
ContextWindowPhase
High-level lifecycle phase of the assembled context window.
ModelGroupError
Error type for model group operations.
ModelTier
Model tier classification for organizing models.
PostToolAction
Action to take after a tool is executed.
PreToolAction
Action to take before a tool is executed.
StopReason
Reason why the agent stopped.
TurnBoundaryAction
Action to take at a safe turn boundary.

Constants§

TERMINAL_SYSTEM_PROMPT
Default system prompt for terminal-first agents.

Traits§

BrowserBackend
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.