Crate ceylon_runtime

Crate ceylon_runtime 

Source
Expand description

§Ceylon Runtime

A Rust-based agent mesh framework for building local and distributed AI agent systems.

§Features

  • Agent Framework: Build autonomous AI agents with a simple trait-based API
  • Local Mesh: Connect multiple agents for inter-agent communication
  • LLM Integration: Built-in support for OpenAI, Anthropic, Ollama, Google, and more
  • Memory Backends: Pluggable memory systems (in-memory, SQLite, Redis)
  • Async-first: Built on Tokio for high-performance async operations
  • Observability: Structured logging and metrics collection

§Quick Start

use ceylon_runtime::{Agent, AgentContext, LocalMesh, Message};
use ceylon_runtime::core::error::Result;
use ceylon_runtime::core::mesh::Mesh;
use async_trait::async_trait;

struct MyAgent {
    name: String,
}

#[async_trait]
impl Agent for MyAgent {
    fn name(&self) -> String {
        self.name.clone()
    }

    async fn on_message(&mut self, msg: Message, _ctx: &mut AgentContext) -> Result<()> {
        println!("Received: {:?}", msg.topic);
        Ok(())
    }
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let agent = MyAgent { name: "my-agent".to_string() };
    let mesh = LocalMesh::new("my-mesh");
    mesh.add_agent(Box::new(agent)).await?;
    mesh.start().await?;
    Ok(())
}

§Modules

  • core - Core abstractions: Agent, Memory, Mesh, Message
  • llm - LLM integration with multi-provider support
  • local - Local mesh implementation
  • memory - Memory backend implementations
  • logging - Structured logging configuration
  • metrics - Metrics collection and reporting

§Feature Flags

  • sqlite - Enable SQLite memory backend
  • redis - Enable Redis memory backend
  • full - Enable all optional backends

Re-exports§

pub use core::agent::Agent;
pub use core::agent::AgentContext;
pub use core::memory::Memory;
pub use core::memory::MemoryEntry;
pub use core::memory::MemoryQuery;
pub use core::memory::VectorMemory;
pub use core::mesh::Mesh;
pub use core::message::Message;
pub use llm::LLMConfig;
pub use llm::LlmAgent;
pub use llm::UniversalLLMClient;
pub use local::LocalMesh;
pub use memory::InMemoryBackend;

Modules§

core
Core abstractions for the Ceylon agent framework.
llm
LLM (Large Language Model) integration layer.
local
logging
memory
Memory backends for agent state persistence.
metrics