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