Skip to main content

Crate axonio

Crate axonio 

Source
Expand description

§Axonio

Rust client for Axonio: persistent memory for AI agents. Formerly the clawdb-client crate.

use axonio::{Axonio, SearchOptions};

#[tokio::main]
async fn main() -> axonio::Result<()> {
    // Reads AXONIO_API_KEY; an API key alone means the Axonio cloud.
    let db = Axonio::from_env()?;

    let id = db.remember("The user prefers concise answers").await?;
    for hit in db.search("how should I phrase answers?", SearchOptions::default()).await? {
        println!("[{:.2}] {}", hit.score, hit.content);
    }
    db.delete_memory(&id).await?;
    db.close().await;
    Ok(())
}

For a self-hosted server use Axonio::builder().endpoint("https://db.example.com") or set AXONIO_URL.

Re-exports§

pub use builder::AxonioBuilder;
pub use client::Axonio;
pub use error::Error;
pub use error::Result;
pub use models::BranchInfo;
pub use models::DiffResult;
pub use models::HealthResponse;
pub use models::MemoryRecord;
pub use models::MergeResult;
pub use models::ReflectJob;
pub use models::RememberOptions;
pub use models::SearchHit;
pub use models::SearchOptions;
pub use models::SessionInfo;
pub use models::SyncActionResult;
pub use models::SyncResult;
pub use models::SyncStatusResult;
pub use models::TxInfo;

Modules§

builder
client
error
models

Constants§

CLOUD_ENDPOINT
The hosted Axonio cloud. Requests carry the API key and the gateway routes them to the workspace’s own instance.
VERSION
The crate version.

Functions§

stable_agent_id
The server needs a UUID agent id. Any other id maps to a stable UUID, byte-for-byte the same as the TypeScript, Python and Go SDKs, so one agent name means one agent across all of them.