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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # 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.");
//! # #[cfg(feature = "tools")]
//! agent.tools.register(Box::new(agnt::builtins::ReadFile::new()));
//!
//! let reply = agent.step("Read /etc/hostname and tell me the hostname.").unwrap();
//! println!("{}", reply);
//! ```
//!
//! ## Architecture (v0.2 — multi-crate workspace)
//!
//! The flagship `agnt` crate is a thin re-export over four underlying crates:
//!
//! - [`agnt-core`](https://crates.io/crates/agnt-core) — traits, types, and
//! the sync agent loop. Zero I/O dependencies; compiles to WASM.
//! - [`agnt-net`](https://crates.io/crates/agnt-net) — HTTP backend
//! implementation (Ollama / OpenAI / Anthropic). Behind the `net` feature.
//! - [`agnt-store`](https://crates.io/crates/agnt-store) — SQLite message
//! store. Behind the `store` feature.
//! - [`agnt-tools`](https://crates.io/crates/agnt-tools) — built-in tools
//! (filesystem, search, fetch). Behind the `tools` feature. Shell is
//! opt-in via `tools-shell`.
//!
//! All three feature flags are on by default so `cargo add agnt` gives you
//! the full runtime. Opt out for minimal / embedded / WASM use.
//!
//! ## Design principles
//!
//! 1. **Sync-first.** No tokio required. Tool dispatch uses
//! [`std::thread::scope`] for parallelism without an async runtime.
//! 2. **Dense.** Every module is small, focused, and auditable.
//! 3. **Multi-backend from day one.** One internal `Message` type; providers
//! translate at the wire boundary.
//! 4. **Structurally sandboxed.** v0.2 adds filesystem root, SSRF guards, and
//! opt-in Shell so adversarial LLM output can't escape the probe.
//!
//! See the [README](https://github.com/hmbldv/agnt) for benchmarks, the
//! v0.2 threat model, and the roadmap.
// Core types and traits — always re-exported.
pub use ;
/// Alias the agent loop module for explicit access.
/// Alias the tool module for explicit access.
// Network backend — feature-gated.
pub use Backend;
// Persistence — feature-gated.
pub use Store;
// Built-in tools — feature-gated.