Expand description
§daimon-core
Core traits and types for the Daimon AI agent
framework. This crate is the plugin interface — implement Model to
add a new LLM provider.
Provider crates depend on daimon-core for the shared types and trait.
The main daimon crate re-exports everything from here, so end users
typically never need to depend on daimon-core directly.
§Implementing a Provider
ⓘ
use daimon_core::{Model, ChatRequest, ChatResponse, Result, ResponseStream};
pub struct MyProvider { /* ... */ }
impl Model for MyProvider {
async fn generate(&self, request: &ChatRequest) -> Result<ChatResponse> {
// call your LLM API
todo!()
}
async fn generate_stream(&self, request: &ChatRequest) -> Result<ResponseStream> {
todo!()
}
}Re-exports§
pub use distributed::AgentTask;pub use distributed::ErasedTaskBroker;pub use distributed::TaskBroker;pub use distributed::TaskResult;pub use distributed::TaskStatus;pub use vector_store::ErasedVectorStore;pub use vector_store::VectorStore;
Modules§
- distributed
- Core types and trait for distributed agent execution.
- stream_
util - Shared, dependency-light helpers for chunked HTTP streaming and retry backoff, used by every reqwest-based provider.
- vector_
store - Trait-based plugin system for vector stores.
Structs§
- Archival
Record - A fact stored in archival memory, returned from a search.
- Chat
Request - A request to send to a model.
- Chat
Response - A complete response from a model.
- Core
Memory Block - A single named, optionally size-limited block of core memory.
- Document
- A retrieved document fragment with optional metadata and relevance score.
- Episodic
Event - A single recorded event.
- Episodic
Query - Filter for
EpisodicMemory::query. All fields are optional; an all-Nonequery returns every event (subject tolimit). - Message
- A single message in a conversation.
- Scored
Document - A document paired with a similarity score from a vector query.
- Tool
Call - A tool invocation requested by a model, containing the tool name and arguments.
- Tool
Output - The result of executing a tool.
- Tool
Retry Policy - Policy controlling when and how tool execution is retried on failure.
- Tool
Spec - Describes a tool that can be passed to a model.
- Usage
- Token usage statistics for a single model request.
Enums§
- Backoff
Strategy - Strategy for computing delay between retries.
- Daimon
Error - The central error type for all Daimon operations.
- Role
- The role of a participant in a conversation.
- Stop
Reason - Why the model stopped generating.
- Stream
Event - An event emitted during a streaming model response.
- Tool
Choice - Controls which tools the model is allowed to use.
Traits§
- Archival
Memory - Trait for long-term archival fact storage, decoupled from the turn-by-turn conversation log.
- Core
Memory - Trait for always-in-context core memory backends.
- Embedding
Model - Trait for models that produce vector embeddings from text.
- Episodic
Memory - Trait for structured, timestamped event log backends.
- Erased
Archival Memory - Object-safe wrapper for the
ArchivalMemorytrait, enabling dynamic dispatch viaArc<dyn ErasedArchivalMemory>. - Erased
Core Memory - Object-safe wrapper for the
CoreMemorytrait, enabling dynamic dispatch viaArc<dyn ErasedCoreMemory>. - Erased
Embedding Model - Object-safe wrapper for
EmbeddingModel. - Erased
Episodic Memory - Object-safe wrapper for the
EpisodicMemorytrait, enabling dynamic dispatch viaArc<dyn ErasedEpisodicMemory>. - Erased
Memory - Object-safe wrapper for the
Memorytrait, enabling dynamic dispatch viaArc<dyn ErasedMemory>. - Erased
Model - Object-safe wrapper for
Model, enabling dynamic dispatch viaArc<dyn ErasedModel>. - Erased
Tool - Object-safe wrapper for the
Tooltrait, enabling dynamic dispatch viaArc<dyn ErasedTool>. - Memory
- Trait for conversation memory backends. Stores and retrieves messages for agent context.
- Model
- Trait for LLM providers. Supports both synchronous and streaming generation.
- Tool
- Trait for tools the agent can invoke. Tools must have unique names and declare a JSON Schema for parameters.
Functions§
- render_
blocks - Shared rendering logic used by
CoreMemory::render’s default implementation and available to custom implementations that want the same format.
Type Aliases§
- Response
Stream - A boxed, pinned stream of
StreamEventresults. - Result
- A type alias for
Result<T, DaimonError>. - Shared
Archival Memory - Shared ownership of archival memory via
Arc<dyn ErasedArchivalMemory>. - Shared
Core Memory - Shared ownership of core memory via
Arc<dyn ErasedCoreMemory>. - Shared
Embedding Model - Shared ownership of an embedding model.
- Shared
Episodic Memory - Shared ownership of episodic memory via
Arc<dyn ErasedEpisodicMemory>. - Shared
Memory - Shared ownership of memory via
Arc<dyn ErasedMemory>. Used by the agent. - Shared
Model - Shared ownership of a model via
Arc<dyn ErasedModel>. - Shared
Tool - Shared ownership of a tool via
Arc<dyn ErasedTool>. Used by registry and agent.