Skip to main content

Crate kernex_runtime

Crate kernex_runtime 

Source
Expand description

kernex-runtime: The facade crate that composes all Kernex components.

Provides Runtime for configuring and running an AI agent runtime with sandboxed execution, multi-provider support, persistent memory, skills, and multi-agent pipeline orchestration.

§Quick Start

use kernex_runtime::RuntimeBuilder;
use kernex_core::traits::Provider;
use kernex_core::message::Request;
use kernex_providers::ollama::OllamaProvider;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let runtime = RuntimeBuilder::new()
        .data_dir("~/.my-agent")
        .build()
        .await?;

    let provider = OllamaProvider::from_config(
        "http://localhost:11434".into(),
        "llama3.2".into(),
        None,
    )?;

    let request = Request::text("user-1", "Hello!");
    let response = runtime.complete(&provider, &request).await?;
    println!("{}", response.text);

    Ok(())
}

Re-exports§

pub use kernex_core as core;
pub use kernex_memory as memory;
pub use kernex_pipelines as pipelines;
pub use kernex_providers as providers;
pub use kernex_sandbox as sandbox;
pub use kernex_skills as skills;

Structs§

AdapterRegistry
Registry of adapter handles, keyed by AdapterId.
Runtime
A configured Kernex runtime with all subsystems initialized.
RuntimeBuilder
Builder for constructing a Runtime with the desired configuration.

Enums§

AdapterError
Adapter error type. #[non_exhaustive] so future variants are non-breaking.
AdapterId
Stable identifier for a supported agent.
Capability
Capability surface an adapter exposes. Sync default methods so adapter authors can override without dragging async machinery into capability reporting.

Traits§

Adapter
Adapter trait. Object-safe; pin async to I/O methods only.