Skip to main content

Crate daimon

Crate daimon 

Source
Expand description

§Daimon

A Rust-native AI agent framework for building LLM-powered agents with tool use, memory, and streaming. Daimon implements the ReAct (Reason-Act-Observe) pattern: the agent calls a model, optionally invokes tools, observes results, and repeats until it produces a final response.

§Quick Start

use daimon::prelude::*;

#[tokio::main]
async fn main() -> daimon::Result<()> {
    let agent = Agent::builder()
        .model(daimon::model::openai::OpenAi::new("gpt-4o"))
        .system_prompt("You are a helpful assistant.")
        .build()?;

    let response = agent.prompt("What is Rust?").await?;
    println!("{}", response.text());
    Ok(())
}

§Feature Flags

FeatureDescription
openaiOpenAI API provider (default)
anthropicAnthropic Claude API provider (default)
geminiGoogle Gemini / Vertex AI provider
azureAzure OpenAI Service provider
bedrockAWS Bedrock provider
fullAll model providers

The core framework compiles with no features; enable providers as needed.

§Module Overview

  • agent - Agent builder and ReAct loop execution
  • model - LLM provider trait and implementations
  • tool - Tool trait, registry, and execution
  • memory - Conversation memory implementations
  • stream - Streaming response types
  • hooks - Lifecycle hooks for observability and control

Re-exports§

pub use error::DaimonError;
pub use error::Result;

Modules§

agent
Agent construction and ReAct loop execution.
error
Error types for the Daimon agent framework.
hooks
Lifecycle hooks for observing and controlling agent execution.
memory
Conversation memory for persisting message history across agent turns.
model
LLM provider abstraction and implementations.
prelude
Convenience re-exports for common Daimon types.
stream
Streaming response types for token-by-token or event-by-event model output.
tool
Tool abstraction and registry.