1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! # agnt
//!
//! A dense, sync-first Rust agent engine. Multi-backend LLM inference with streaming,
//! parallel tool dispatch, SQLite session persistence, and microsecond-level tool
//! profiling — in under 1,500 lines of code with no async runtime required.
//!
//! ## Quick start
//!
//! ```no_run
//! use agnt::{Agent, Backend};
//!
//! let backend = Backend::ollama("gemma4:e4b");
//! let mut agent = Agent::new(backend, "You are a helpful assistant.");
//! agent.tools.register(Box::new(agnt::builtins::ReadFile));
//!
//! let reply = agent.step("Read /etc/hostname and tell me the hostname.").unwrap();
//! println!("{}", reply);
//! ```
//!
//! ## Architecture
//!
//! - [`Backend`] — multi-provider LLM client (Ollama, OpenAI, Anthropic) with streaming and retry
//! - [`Agent`] — the core loop: message → inference → parallel tool dispatch → loop
//! - [`Tool`] — trait for extending the agent with capabilities
//! - [`Registry`] — collection of tools with name-based dispatch
//! - [`Store`] — SQLite session persistence with µs tool-call profiling
//! - [`builtins`] — eight ready-to-use tools for files, search, HTTP, and shell
//!
//! ## Design principles
//!
//! 1. **Sync-first.** No tokio. The agent loop is synchronous. Tool dispatch uses
//! [`std::thread::scope`] for parallel execution without an async runtime.
//! 2. **Dense.** Every module is small, focused, and auditable. No framework ceremony.
//! 3. **Multi-backend from day one.** The `Message` and `ToolCall` types are
//! OpenAI-flavored internally; Anthropic content blocks are translated at the
//! wire boundary. Switching backends is one line.
//! 4. **Persistence is free.** SQLite ships with the crate (`rusqlite/bundled`)
//! so you don't need system libsqlite. Every tool call is timed in microseconds
//! and written to the session log.
//!
//! See the [README](https://github.com/hmbldv/agnt) for benchmarks, feature comparison
//! against other Rust agent libraries, and roadmap.
pub use Agent;
pub use ;
pub use Store;
pub use ;