Skip to main content

Crate velixar

Crate velixar 

Source
Expand description

Governed, auditable memory for AI agents — the official Rust client.

use velixar::{Velixar, StoreOpts, SearchOpts};

let client = Velixar::new("vlx_your_key")?;

client
    .store("Alex is a vegetarian and is allergic to nuts.",
           StoreOpts::new().user("alex").tags(["diet", "allergy"]))
    .await?;

let hits = client
    .search("what can I cook for dinner?", SearchOpts::new().user("alex"))
    .await?;

for m in hits.memories {
    println!("{} ({:.2})", m.content, m.score.unwrap_or_default());
}

§One key, many users

A key belongs to your workspace; user scopes a memory to one of your end users. A search scoped to a user returns only that user’s memories — enforced server-side. This is the model all the Velixar SDKs are built around.

§Scopes

Keys carry scopes. memory:read and memory:write are granted by default; delete needs memory:delete, which is opt-in because it is irreversible. Calling it without that scope returns Error::Scope — not a silent no-op, and not a 404.

Structs§

ApiError
The API’s error envelope: {"error": {"code": "...", "message": "..."}}.
Builder
Builder for Velixar.
Memory
A stored memory.
SearchOpts
Options for search.
SearchResult
The result of a search.
StoreOpts
Options for store.
Velixar
The Velixar client. Cheap to clone; wraps a pooled HTTP client.

Enums§

Error
Everything that can go wrong.

Type Aliases§

Result