Skip to main content

Crate klieo

Crate klieo 

Source
Expand description

klieo — open-source Rust agent framework.

This umbrella crate re-exports klieo_core unconditionally and exposes each implementation crate behind a Cargo feature flag so users can start with just the trait surfaces and opt into concrete implementations one at a time.

§Quickstart

Add to Cargo.toml:

[dependencies]
klieo = { version = "0.1", features = ["all-foundation"] }

Then build an agent:

use klieo::{RunOptions, Error};
let opts = RunOptions::default();
let _ = opts;

§Feature flags

§Foundation

FeatureCrate enabled
(none)klieo-core trait surfaces only
toolsklieo-toolsChainedInvoker, schema validation
macrosklieo-macros#[tool] proc-macro
llm-ollamaklieo-llm-ollama — Ollama HTTP client
memory-sqliteklieo-memory-sqlite — SQLite-backed memory
bus-memoryklieo-bus-memory — in-process bus
bus-natsklieo-bus-nats — NATS JetStream bus
mcpklieo-tools-mcp — MCP adapter (implies tools)
all-foundationAll foundation features above

§LLM providers

FeatureCrate enabled
llm-openaiklieo-llm-openai
llm-anthropicklieo-llm-anthropic
llm-genaiklieo-llm-genai (Google Gemini)
all-llmAll LLM providers (incl. Ollama)

§Memory backends

FeatureCrate enabled
memory-neo4jklieo-memory-neo4j
memory-qdrantklieo-memory-qdrant
embed-commonklieo-embed-common — shared Embedder trait
memory-fastembedmemory-sqlite + real CPU embeddings
memory-sqlite-vecmemory-sqlite + k-NN sqlite-vec index
all-memoryAll memory backends

§Composition + protocol

FeatureCrate enabled
flowsklieo-flows — Sequential/Parallel/Loop/Graph
a2aklieo-a2a — durable Agent-to-Agent v1.0
specklieo-spec — quality-loop runner

§Observability + provenance

FeatureCrate enabled
runlogklieo-runlog — RunLog projection + replay
runlog-sqliterunlog + SQLite store
runlog-compaction-llmrunlog + LLM-summarise compaction
provenanceklieo-provenance — Merkle hash chain
otelklieo-otel — OpenTelemetry OTLP exporter
all-observabilityrunlog + provenance + otel

§Aggregates

FeatureEnables
fullEvery impl crate — heavy build, for integration tests
test-utilsklieo-core/test-utils for downstream test deps

Modules§

agent
Re-exports every public item from klieo-core. Agent trait and AgentContext.
bus
Re-exports every public item from klieo-core. Inter-agent bus traits — Pubsub, RequestReply, KvStore, JobQueue.
error
Re-exports every public item from klieo-core. Error types used across klieo-core.
guardrail
Re-exports every public item from klieo-core. Pre/post-LLM validation hooks for refuse + handoff workflows.
ids
Re-exports every public item from klieo-core. Strongly-typed IDs used throughout the framework.
llm
Re-exports every public item from klieo-core. LLM client trait and request/response types.
memory
Re-exports every public item from klieo-core. Memory traits — short-term, long-term, episodic.
rate_limit
Re-exports every public item from klieo-core. Client-side token-bucket rate limiter for any LlmClient.
response
Re-exports every public item from klieo-core. Typed structured-output trait + parser.
runtime
Re-exports every public item from klieo-core. Runtime loop driving an crate::agent::Agent through LLM ↔ tool exchanges.
summarize
Re-exports every public item from klieo-core. Rolling LLM-summary checkpoint for bounding conversation context cost.
tool
Re-exports every public item from klieo-core. Tool trait, invoker, and tool context.

Structs§

AckHandle
Re-exports every public item from klieo-core. Acknowledgement handle attached to a delivered Msg.
AgentContext
Re-exports every public item from klieo-core. Borrow-free agent execution context. Holds Arc<dyn …> so it can be cloned freely across tokio::spawn boundaries ('static requirement).
Capabilities
Re-exports every public item from klieo-core. Provider capability declaration.
CapabilitiesBuilder
Re-exports every public item from klieo-core. Fluent builder for Capabilities. Build via Capabilities::builder.
ChatChunk
Re-exports every public item from klieo-core. One chunk of a streaming response.
ChatRequest
Re-exports every public item from klieo-core. Chat completion request.
ChatResponse
Re-exports every public item from klieo-core. Chat completion response.
ClaimHandle
Re-exports every public item from klieo-core. Handle the impl uses to resolve a claim.
ClaimedJob
Re-exports every public item from klieo-core. Job claimed by a worker.
DurableName
Re-exports every public item from klieo-core. Durable consumer name for a JetStream-style subscription.
Fact
Re-exports every public item from klieo-core. One stored fact in long-term memory.
FactId
Re-exports every public item from klieo-core. Identifier for a stored fact in LongTermMemory.
Job
Re-exports every public item from klieo-core. Job enqueued for durable processing.
JobId
Re-exports every public item from klieo-core. Identifier for an enqueued job in JobQueue.
KvEntry
Re-exports every public item from klieo-core. One KV entry.
Lease
Re-exports every public item from klieo-core. Lease handle. Heartbeat to extend; drop to release.
MaxResponseLengthGuardrail
Re-exports every public item from klieo-core. Refuses if the assistant response content is longer than max_chars characters.
Message
Re-exports every public item from klieo-core. One message in a chat conversation.
Msg
Re-exports every public item from klieo-core. One message delivered to a subscriber.
RefusalKeywordGuardrail
Re-exports every public item from klieo-core. Refuses if any deny-keyword (case-insensitive) appears in the outgoing user message or the assistant response content.
RunFilter
Re-exports every public item from klieo-core. Filter passed to EpisodicMemory::list_runs.
RunId
Re-exports every public item from klieo-core. Unique identifier for a single agent run.
RunOptions
Re-exports every public item from klieo-core. Tunables for super::run_steps and super::run_steps_streaming.
RunSummary
Re-exports every public item from klieo-core. Index-row summary returned by list_runs.
SummarizeOptions
Re-exports every public item from klieo-core. Tunables for summarize_history.
ThreadId
Re-exports every public item from klieo-core. Identifies a conversation thread for short-term memory scoping.
ToolCall
Re-exports every public item from klieo-core. One tool call requested by the assistant.
ToolCtx
Re-exports every public item from klieo-core. Narrowed slice of AgentContext (see agent.rs) passed to tools.
ToolDef
Re-exports every public item from klieo-core. Tool catalogue entry shown to the LLM.
Usage
Re-exports every public item from klieo-core. Token usage report.

Enums§

BusError
Re-exports every public item from klieo-core. Inter-agent bus errors.
ConfigError
Re-exports every public item from klieo-core. Configuration validation errors.
Episode
Re-exports every public item from klieo-core. One event in the episodic event stream of a single agent run.
Error
Re-exports every public item from klieo-core. Top-level error returned by klieo-core runtime calls.
FinishReason
Re-exports every public item from klieo-core. Reason the provider stopped generating.
GuardrailOutcome
Re-exports every public item from klieo-core. Validator outcome returned by Guardrail::pre_llm and Guardrail::post_llm.
LlmError
Re-exports every public item from klieo-core. LLM provider errors.
MemoryError
Re-exports every public item from klieo-core. Memory persistence errors.
ResponseFormat
Re-exports every public item from klieo-core. Output format hint passed to the provider.
Role
Re-exports every public item from klieo-core. Speaker role.
Scope
Re-exports every public item from klieo-core. Namespacing for long-term memory facts.
ToolError
Re-exports every public item from klieo-core. Tool invocation errors.
ToolResult
Re-exports every public item from klieo-core. Outcome of a tool invocation as recorded in the episodic event stream.

Traits§

AckHandleImpl
Re-exports every public item from klieo-core. Implementor side of an ack handle. Exposed so impls can supply backend behaviour without callers reaching into private types.
Agent
Re-exports every public item from klieo-core. One agent — a typed function from Input to Output plus prompt configuration.
ClaimHandleImpl
Re-exports every public item from klieo-core. Implementor side of a claim handle.
EpisodicMemory
Re-exports every public item from klieo-core. Append-only event log of agent runs.
Guardrail
Re-exports every public item from klieo-core. Pre/post-LLM validator. Implementors decide whether to allow, refuse, or hand off based on the outgoing request and incoming response.
JobQueue
Re-exports every public item from klieo-core. Durable competing-consumer job queue. No ordering guarantee — workloads requiring order must use Pubsub on a partitioned subject with one consumer per partition instead.
KlieoResponse
Re-exports every public item from klieo-core. Trait implemented by types that can be parsed from a structured LLM response.
KvStore
Re-exports every public item from klieo-core. Bucket-keyed durable KV store with CAS.
LeaseImpl
Re-exports every public item from klieo-core. Implementor side of a lease.
LlmClient
Re-exports every public item from klieo-core. LLM provider trait.
LongTermMemory
Re-exports every public item from klieo-core. Long-term semantic memory.
Pubsub
Re-exports every public item from klieo-core. Pub/sub interface (subject-based, durable consumers).
RequestReply
Re-exports every public item from klieo-core. Synchronous request/response over the bus.
ShortTermMemory
Re-exports every public item from klieo-core. Conversation buffer scoped to a single thread.
Tool
Re-exports every public item from klieo-core. One executable tool.
ToolInvoker
Re-exports every public item from klieo-core. Dispatches tool calls by name.

Functions§

parse_structured
Re-exports every public item from klieo-core. Parse an LLM reply (raw text content) into a typed T.
run_steps
Re-exports every public item from klieo-core. Drive the agent’s LLM/tool loop until completion. Caller is responsible for appending the user message before invoking — this function only consumes / extends short-term memory.
run_steps_streaming
Re-exports every public item from klieo-core. Drive the agent’s LLM/tool loop the same way super::run_steps does, but expose the underlying provider chunks as they arrive.
summarize_history
Re-exports every public item from klieo-core. Run a rolling summarization checkpoint against the thread’s short-term history.

Type Aliases§

ChunkStream
Re-exports every public item from klieo-core. Streaming response handle.
Embedding
Re-exports every public item from klieo-core. Vector embedding for one input text.
Headers
Re-exports every public item from klieo-core. Opaque headers accompanying a bus message.
MsgStream
Re-exports every public item from klieo-core. Stream of messages delivered to a subscriber.
Revision
Re-exports every public item from klieo-core. CAS revision returned by KV writes.