agentsmith/lib.rs
1//! # AgentSmith
2//!
3//! AI Agent forging utilities - giving agents persistent, searchable memory.
4//!
5//! Inspired by Atuin for shell history, `agentsmith` provides a permanent, fuzzy-searchable,
6//! metadata-rich memory layer for Rig agents that survives process restarts.
7//!
8//! ## Example
9//!
10//! ```rust,no_run
11//! use agentsmith::{AgentHistory, SmartAgent};
12//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
13//! // Create persistent history
14//! let history = AgentHistory::new("my_agent.db", Some("session-123")).await?;
15//!
16//! // Wrap your Rig agent
17//! // let agent = ...; // your rig agent
18//! // let mut smart_agent = SmartAgent::new(agent, history);
19//!
20//! // Chat with automatic recall of relevant past interactions
21//! // let reply = smart_agent.chat("How did we fix the JSON parsing bug?").await?;
22//! # Ok(())
23//! # }
24//! ```
25
26mod error;
27mod history;
28mod smart_agent;
29mod trace;
30
31pub use error::{Error, Result};
32pub use history::AgentHistory;
33pub use smart_agent::SmartAgent;
34pub use trace::Trace;