rs_agent/
lib.rs

1//! # rs-agent
2//!
3//! Lattice AI Agent Framework for Rust
4//!
5//! `rs-agent` provides clean abstractions for building production AI agents with:
6//! - Pluggable LLM providers (Gemini, Ollama, Anthropic)
7//! - Tool calling with async support
8//! - Memory systems with RAG capabilities
9//! - UTCP integration for universal tool calling
10//! - Multi-agent coordination
11//!
12//! ## Quick Start
13//!
14//! ```no_run
15//! use rs_agent::{Agent, AgentOptions};
16//! use rs_agent::memory::{InMemoryStore, SessionMemory};
17//! use std::sync::Arc;
18//!
19//! #[tokio::main]
20//! async fn main() {
21//!     // Setup will go here
22//! }
23//! ```
24
25pub mod agent;
26pub mod error;
27pub mod memory;
28pub mod models;
29pub mod tools;
30pub mod types;
31pub mod utcp;
32
33// Re-export commonly used types
34pub use agent::Agent;
35pub use error::{AgentError, Result};
36pub use memory::{mmr_rerank, InMemoryStore, MemoryRecord, MemoryStore, SessionMemory};
37pub use models::LLM;
38pub use rs_utcp::plugins::codemode::{CodeModeArgs, CodeModeUtcp, CodemodeOrchestrator};
39pub use tools::{Tool, ToolCatalog};
40pub use types::{
41    AgentOptions, File, GenerationResponse, Message, Role, ToolRequest, ToolResponse, ToolSpec,
42};
43
44// Re-export memory backends
45#[cfg(feature = "postgres")]
46pub use memory::PostgresStore;
47
48#[cfg(feature = "qdrant")]
49pub use memory::QdrantStore;
50
51#[cfg(feature = "mongodb")]
52pub use memory::MongoStore;
53
54// Re-export LLM providers
55#[cfg(feature = "gemini")]
56pub use models::GeminiLLM;
57
58#[cfg(feature = "ollama")]
59pub use models::OllamaLLM;
60
61#[cfg(feature = "anthropic")]
62pub use models::AnthropicLLM;
63
64#[cfg(feature = "openai")]
65pub use models::OpenAILLM;
66
67#[cfg(test)]
68mod tests {
69    use super::*;
70
71    #[test]
72    fn default_agent_options() {
73        let opts = AgentOptions::default();
74        assert_eq!(opts.context_limit, Some(8192));
75        assert!(opts.system_prompt.is_none());
76    }
77}