ceylon_runtime/
lib.rs

1//! # Ceylon Runtime
2//!
3//! A Rust-based agent mesh framework for building local and distributed AI agent systems.
4//!
5//! ## Features
6//!
7//! - **Agent Framework**: Build autonomous AI agents with a simple trait-based API
8//! - **Local Mesh**: Connect multiple agents for inter-agent communication
9//! - **LLM Integration**: Built-in support for OpenAI, Anthropic, Ollama, Google, and more
10//! - **Memory Backends**: Pluggable memory systems (in-memory, SQLite, Redis)
11//! - **Async-first**: Built on Tokio for high-performance async operations
12//! - **Observability**: Structured logging and metrics collection
13//!
14//! ## Quick Start
15//!
16//! ```rust,no_run
17//! use ceylon_runtime::{Agent, AgentContext, LocalMesh, Message};
18//! use ceylon_runtime::core::error::Result;
19//! use ceylon_runtime::core::mesh::Mesh;
20//! use async_trait::async_trait;
21//!
22//! struct MyAgent {
23//!     name: String,
24//! }
25//!
26//! #[async_trait]
27//! impl Agent for MyAgent {
28//!     fn name(&self) -> String {
29//!         self.name.clone()
30//!     }
31//!
32//!     async fn on_message(&mut self, msg: Message, _ctx: &mut AgentContext) -> Result<()> {
33//!         println!("Received: {:?}", msg.topic);
34//!         Ok(())
35//!     }
36//! }
37//!
38//! #[tokio::main]
39//! async fn main() -> anyhow::Result<()> {
40//!     let agent = MyAgent { name: "my-agent".to_string() };
41//!     let mesh = LocalMesh::new("my-mesh");
42//!     mesh.add_agent(Box::new(agent)).await?;
43//!     mesh.start().await?;
44//!     Ok(())
45//! }
46//! ```
47//!
48//! ## Modules
49//!
50//! - [`core`] - Core abstractions: Agent, Memory, Mesh, Message
51//! - [`llm`] - LLM integration with multi-provider support
52//! - [`local`] - Local mesh implementation
53//! - [`memory`] - Memory backend implementations
54//! - [`logging`] - Structured logging configuration
55//! - [`metrics`] - Metrics collection and reporting
56//!
57//! ## Feature Flags
58//!
59//! - `sqlite` - Enable SQLite memory backend
60//! - `redis` - Enable Redis memory backend
61//! - `full` - Enable all optional backends
62
63pub mod core;
64pub mod llm;
65pub mod local;
66pub mod logging;
67pub mod memory;
68pub mod metrics;
69
70pub use core::agent::{Agent, AgentContext};
71pub use core::memory::{Memory, MemoryEntry, MemoryQuery, VectorMemory};
72pub use core::mesh::Mesh;
73pub use core::message::Message;
74pub use llm::{LLMConfig, LlmAgent, UniversalLLMClient};
75pub use local::LocalMesh;
76pub use memory::InMemoryBackend;
77
78#[cfg(feature = "sqlite")]
79pub use memory::SqliteBackend;