Choose the Mind you need.
Configure an instance URL, access token, and namespace to connect your application to the right data.
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
Await the query. Keep success and failure visible in your code.
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 }Select an outcome in the example. Decide how your application uses returned knowledge and how it reports a failed request.
Example Result handling for graph.cypher, with sample rows and errors. Your application decides how to recover.
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.
Configure an instance URL, access token, and namespace to connect your application to the right data.
Use dedicated clients for memory, graph relationships, analytics, learning, and model operations.
Consume model output as a Rust stream, so your application can display a response while generation continues.
The client uses Tokio for async work and returns typed errors through Result, keeping recovery in your application’s control.
Enable the optional router client to send tasks through a configured Knowledge Router using gRPC.
Use an HTTP endpoint or resolve an akasha:// address into a client with the URI connection helper.
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.
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(())
}Start with a dedicated Mind and bring useful context into your application’s next request.