Skip to main content

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 agent_orchestrators;
27pub mod agent_tool;
28pub mod catalog;
29pub mod error;
30pub mod helpers;
31pub mod memory;
32pub mod models;
33pub mod query;
34pub mod tools;
35pub mod types;
36pub mod utcp;
37
38// Re-export commonly used types
39pub use agent::Agent;
40pub use catalog::{StaticSubAgentDirectory, StaticToolCatalog};
41pub use error::{AgentError, Result};
42pub use memory::{mmr_rerank, InMemoryStore, MemoryRecord, MemoryStore, SessionMemory};
43pub use models::LLM;
44pub use rs_utcp::plugins::codemode::{CodeModeArgs, CodeModeUtcp, CodemodeOrchestrator};
45pub use tools::{Tool, ToolCatalog};
46pub use types::{
47    AgentOptions, AgentState, File, GenerationResponse, Message, Role, SubAgent,
48    SubAgentDirectory, ToolRequest, ToolResponse, ToolSpec,
49};
50
51// Re-export memory backends
52#[cfg(feature = "postgres")]
53pub use memory::PostgresStore;
54
55#[cfg(feature = "qdrant")]
56pub use memory::QdrantStore;
57
58#[cfg(feature = "mongodb")]
59pub use memory::MongoStore;
60
61// Re-export LLM providers
62#[cfg(feature = "gemini")]
63pub use models::GeminiLLM;
64
65#[cfg(feature = "ollama")]
66pub use models::OllamaLLM;
67
68#[cfg(feature = "anthropic")]
69pub use models::AnthropicLLM;
70
71#[cfg(feature = "openai")]
72pub use models::OpenAILLM;
73
74#[cfg(test)]
75mod tests {
76    use super::*;
77
78    #[test]
79    fn default_agent_options() {
80        let opts = AgentOptions::default();
81        assert_eq!(opts.context_limit, Some(8192));
82        assert!(opts.system_prompt.is_none());
83    }
84}