How iofficeai/aionrs works
aionrs is a Rust command-line LLM tool-use agent. A user submits a task through the CLI or interactive TUI; the CLI configures an agent engine, which streams model responses, dispatches approved tool calls, and returns output through the selected sink. The workflow includes model interaction, tool execution, and iterative results. README-described branches include MCP, skills, plan mode, sub-agents, persistent memory, session persistence, hooks, and context/output compression. Several subsystem links reflect documented architecture because their implementation was not sampled.
Main entry points: engine.rs Agent engine · orchestration.rs Tool orchestration · run.rs CLI run flow · main.rs CLI entry
Components 21
User interfaces
- CLI entry
crates/aion-cli/src/main.rs - CLI run flow
crates/aion-cli/src/run.rs - Interactive TUI
crates/aion-tui/src/app.rs - JSON stream
crates/aion-cli/src/json_stream/session.rs
Agent runtime
- Agent engine
crates/aion-agent/src/engine.rs - Tool orchestration
crates/aion-agent/src/orchestration.rs - Tool lifecycle hooks
crates/aion-config/src/hooks.rs - Output sinks
crates/aion-agent/src/output/sink.rs
Models and tools
- Provider adapters
crates/aion-providers/src/provider.rs - Local tool suite
crates/aion-tools/src/lib.rs - Process runner
crates/aion-process/src/runner.rs - MCP client
crates/aion-mcp/src/manager.rs
Context features
- Skills system
crates/aion-skills/src/lib.rs - Plan mode
crates/aion-agent/src/plan/mod.rs - Persistent memory
crates/aion-memory/src/store.rs - Context compression
crates/aion-agent/src/compact/mod.rs
Persistence and config
- Configuration
crates/aion-config/src/config.rs - Session persistence
crates/aion-agent/src/session.rs
Other components
- User or host
- LLM services
- MCP servers
Connections 23
- User or host → CLI entry: submits task
- User or host → Interactive TUI: interacts
- User or host → JSON stream: sends commands
- CLI entry → CLI run flow: dispatches run
- CLI run flow → Configuration: loads settings
- CLI run flow → Agent engine: builds runtime
- Interactive TUI → Agent engine: runs turns
- JSON stream → Agent engine: runs messages
- Agent engine → Provider adapters: streams requests
- Provider adapters → LLM services: calls model
- Agent engine → Tool orchestration: dispatches calls
- Tool orchestration → Local tool suite: executes tools
- Local tool suite → Process runner: runs commands
- Tool orchestration → MCP client: executes remote tools
- MCP client → MCP servers: sends MCP requests
- Agent engine → Skills system: loads skill context
- Tool orchestration → Plan mode: applies plan tools
- Agent engine → Persistent memory: uses project memory
- Agent engine → Context compression: compresses context
- Agent engine → Session persistence: saves or resumes
- Tool orchestration → Tool lifecycle hooks: runs lifecycle hooks
- Agent engine → Output sinks: emits agent output
- Output sinks → User or host: presents results