SDK · Rust

Give your Rust application a memory.

Keep records, experiences, and connected knowledge available to your application. The Minds Rust SDK connects an asynchronous Rust service to a dedicated Mind for memory, graph queries, and model operations.

Rust · choose the next branch

A result worth handling properly.

Await the query. Keep success and failure visible in your code.

query.rsasync / graph
01let result: Result<Vec<serde_json::Value>, _> =02    client.graph03        .cypher("MATCH (n) RETURN n LIMIT 5")04        .await;05match result {06    Ok(rows) => {07        println!("{rows:?}");08    }09    Err(err) => {10        eprintln!("{err}");11    }12 }

Inspect both paths.

Select an outcome in the example. Decide how your application uses returned knowledge and how it reports a failed request.

Choose a chapter to explore

Example Result handling for graph.cypher, with sample rows and errors. Your application decides how to recover.

Capabilities

Work with memory in your async flow.

Query a Mind without blocking your application’s async workflow. Use typed results to handle failures and streams to show generated text as it arrives.

01

Choose the Mind you need.

Configure an instance URL, access token, and namespace to connect your application to the right data.

02

Build beyond a single record.

Use dedicated clients for memory, graph relationships, analytics, learning, and model operations.

03

Receive generated text in chunks.

Consume model output as a Rust stream, so your application can display a response while generation continues.

04

Handle failures explicitly.

The client uses Tokio for async work and returns typed errors through Result, keeping recovery in your application’s control.

05

Route tasks when you need to.

Enable the optional router client to send tasks through a configured Knowledge Router using gRPC.

06

Connect by address.

Use an HTTP endpoint or resolve an akasha:// address into a client with the URI connection helper.

API

Bring stored context into your Rust service.

This HTTP example uses reqwest with its JSON feature, serde_json, and Tokio. Set AKASHA_URL to your MCP-enabled Mind, AKASHA_TOKEN to your access token, and AKASHA_CAPABILITY to a signed credential with memory-read permission.

Memory request · Rust HTTPrust
use serde_json::{json, Value};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let endpoint = format!(
        "{}/v1/mcp/tools/call",
        std::env::var("AKASHA_URL")?.trim_end_matches('/')
    );
    let output: Value = reqwest::Client::new()
        .post(endpoint)
        .bearer_auth(std::env::var("AKASHA_TOKEN")?)
        .header("X-Akasha-Capability", std::env::var("AKASHA_CAPABILITY")?)
        .json(&json!({
            "name": "recall",
            "arguments": {
                "query": "What release schedule did we choose?",
                "limit": 5
            }
        }))
        .send().await?
        .error_for_status()?
        .json().await?;

    if output["is_error"] == true {
        return Err("Memory tool failed".into());
    }
    println!("{}", output["result"]["memories"]);
    Ok(())
}
Specs

What ships in the package.

At a glance
Crate
akasha-sdk
Constructor
AkashaClient::new(url, token, namespace)
Async
tokio
Connection
HTTP · optional router gRPC
Errors
akasha_sdk::error::SdkError

Connect your Rust service to lasting knowledge.

Start with a dedicated Mind and bring useful context into your application’s next request.