Expand description
Dakera Rust Client SDK
A high-level Rust client for interacting with Dakera AI Agent Memory Platform.
§Quick Start (HTTP)
use dakera_client::{DakeraClient, UpsertRequest, QueryRequest};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a client
let client = DakeraClient::new("http://localhost:3000")?;
// Check health
let health = client.health().await?;
println!("Server healthy: {}", health.healthy);
// Upsert vectors
let request = UpsertRequest {
vectors: vec![
dakera_client::Vector {
id: "vec1".to_string(),
values: vec![0.1, 0.2, 0.3, 0.4],
metadata: None,
},
],
};
client.upsert("my-namespace", request).await?;
// Query for similar vectors
let query = QueryRequest {
vector: vec![0.1, 0.2, 0.3, 0.4],
top_k: 10,
filter: None,
include_metadata: true,
include_vectors: false,
distance_metric: Default::default(),
consistency: Default::default(),
staleness_config: None,
};
let results = client.query("my-namespace", query).await?;
for match_ in results.matches {
println!("ID: {}, Score: {}", match_.id, match_.score);
}
Ok(())
}§gRPC Client with Connection Pooling
Enable the grpc feature for high-performance gRPC communication:
ⓘ
use dakera_client::grpc::{GrpcClient, GrpcClientConfig, GrpcConnectionPool};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Single client with HTTP/2 multiplexing
let config = GrpcClientConfig::default()
.with_endpoint("http://localhost:50051")
.with_concurrency_limit(100);
let client = GrpcClient::connect(config).await?;
// Or use a connection pool for even higher throughput
let pool = GrpcConnectionPool::new(GrpcClientConfig::default(), 4).await?;
let client = pool.get();
Ok(())
}Re-exports§
pub use events::DakeraEvent;pub use events::MemoryEvent;pub use events::OpStatus;pub use events::VectorMutationOp;pub use admin::BackupInfo;pub use admin::BackupListResponse;pub use admin::CacheStats;pub use admin::ClusterStatus;pub use admin::CreateBackupRequest;pub use admin::CreateBackupResponse;pub use admin::IndexStats;pub use admin::IndexStatsResponse;pub use admin::NodeInfo;pub use admin::NodeListResponse;pub use admin::QuotaConfig;pub use admin::QuotaListResponse;pub use admin::QuotaStatus;pub use admin::RestoreBackupRequest;pub use admin::RestoreBackupResponse;pub use admin::RuntimeConfig;pub use admin::SlowQueryListResponse;pub use agents::AgentStats;pub use agents::AgentSummary;pub use analytics::AnalyticsOverview;pub use analytics::LatencyAnalytics;pub use analytics::StorageAnalytics;pub use analytics::ThroughputAnalytics;pub use keys::ApiKeyUsageResponse;pub use keys::CreateKeyRequest;pub use keys::CreateKeyResponse;pub use keys::KeyInfo;pub use keys::ListKeysResponse;pub use keys::RotateKeyResponse;pub use knowledge::AgentNetworkEdge;pub use knowledge::AgentNetworkInfo;pub use knowledge::AgentNetworkNode;pub use knowledge::AgentNetworkStats;pub use knowledge::CrossAgentNetworkRequest;pub use knowledge::CrossAgentNetworkResponse;pub use knowledge::DeduplicateRequest;pub use knowledge::DeduplicateResponse;pub use knowledge::FullKnowledgeGraphRequest;pub use knowledge::KnowledgeEdge;pub use knowledge::KnowledgeGraphRequest;pub use knowledge::KnowledgeGraphResponse;pub use knowledge::KnowledgeNode;pub use knowledge::SummarizeRequest;pub use knowledge::SummarizeResponse;pub use reqwest;
Modules§
- admin
- Admin operations for the Dakera client.
- agents
- Agent management for the Dakera client.
- analytics
- Analytics operations for the Dakera client.
- events
- SSE streaming event types and client support (CE-1).
- keys
- API Key management for the Dakera client.
- knowledge
- Knowledge graph operations for the Dakera client.
- memory
- Memory-oriented client methods for Dakera AI Agent Memory Platform
Structs§
- Actual
Stats - Actual execution statistics (when execute=true)
- Aggregation
Group - Single group in aggregation results
- Aggregation
Request - Request for aggregation query (Turbopuffer-inspired)
- Aggregation
Response - Response for aggregation query
- Batch
Query Item - A single query within a batch request
- Batch
Query Request - Batch query request - execute multiple queries in parallel
- Batch
Query Response - Batch query response
- Batch
Query Result - Results for a single query within a batch
- Batch
Query Text Request - Request to execute multiple text queries with automatic embedding in a single call.
- Batch
Query Text Response - Response from a batch text query operation.
- Column
Upsert Request - Column-based upsert request (Turbopuffer-inspired)
- Compaction
Request - Compaction request
- Compaction
Response - Compaction response
- Component
Health - Component health status
- Configure
Namespace Request - Request body for
PUT /v1/namespaces/:namespace— upsert semantics (v0.6.0). - Configure
Namespace Response - Response from
PUT /v1/namespaces/:namespace. - Cost
Estimate - Cost estimation
- Create
Namespace Request - Request to create a new namespace.
- Dakera
Client - Dakeraclient for interacting with the vector database
- Dakera
Client Builder - Builder for DakeraClient
- Delete
Request - Delete vectors request
- Delete
Response - Delete response
- Document
- A document for full-text indexing
- Execution
Stage - A stage in query execution
- Export
Request - Request to export vectors from a namespace with pagination
- Export
Response - Response from export operation
- Exported
Vector - A single exported vector record
- Fetch
Request - Request to fetch vectors by their IDs.
- Fetch
Response - Response from a fetch-by-ID operation.
- Full
Text Match - Full-text search result
- Full
Text Search Request - Full-text search request
- Full
Text Search Response - Full-text search response
- Full
Text Stats - Full-text index statistics
- Health
Response - Health check response
- Health
Status - Health status for a component
- Hybrid
Search Request - Hybrid search request combining vector and full-text search
- Hybrid
Search Response - Hybrid search response
- Index
Alternative - Alternative index that was considered
- Index
Documents Request - Index documents request
- Index
Documents Response - Index documents response
- Index
Selection - Index selection details
- Index
Statistics - Index statistics
- JobInfo
- Background job information
- List
Namespaces Response - List namespaces response
- Match
- A match result from a query
- Multi
Vector Search Request - Request for multi-vector search with positive and negative vectors
- Multi
Vector Search Response - Response from multi-vector search
- Multi
Vector Search Result - Single result from multi-vector search
- Namespace
Info - Namespace information
- Query
Explain Request - Query explain request
- Query
Explain Response - Query explain response - detailed execution plan
- Query
Params - Query parameters for reference
- Query
Request - Query request for vector similarity search
- Query
Response - Query response
- Query
Text Request - Request to query using natural language text with automatic embedding.
- Readiness
Response - Readiness check response
- Recommendation
- Performance recommendation
- Resource
Usage - Resource usage metrics
- Staleness
Config - Configuration for bounded staleness reads
- System
Diagnostics - System diagnostics
- System
Info - System information
- Text
Document - A text document to upsert with automatic embedding generation.
- Text
Query Response - Response from a text query operation.
- Text
Search Result - A single text search result.
- Text
Upsert Response - Response from a text upsert operation.
- Unified
Query Request - Unified query request with flexible ranking options (Turbopuffer-inspired)
- Unified
Query Response - Unified query response
- Unified
Search Result - Single result from unified query
- Upsert
Request - Upsert vectors request
- Upsert
Response - Upsert response
- Upsert
Text Request - Request to upsert text documents with automatic embedding.
- Vector
- A vector with ID and optional metadata
- Warm
Cache Request - Cache warming request with priority hints
- Warm
Cache Response - Cache warming response
Enums§
- Access
Pattern Hint - Access pattern hint for cache optimization
- Aggregate
Function - Aggregate function for computing values across documents
- Client
Error - Errors that can occur when using the Dakera client
- Distance
Metric - Distance metric for similarity search
- Embedding
Model - Supported embedding models for text-based operations.
- Explain
Query Type - Query type for explain
- RankBy
- Ranking function for unified query API Supports vector search (ANN/kNN), full-text BM25, and attribute ordering
- Read
Consistency - Read consistency level for queries (Turbopuffer-inspired)
- Sort
Direction - Sort direction for attribute ordering
- Vector
Search Method - Vector search method for unified query
- Warming
Priority - Priority level for cache warming operations
- Warming
Target Tier - Target cache tier for warming
Type Aliases§
- Result
- Result type alias for Dakera client operations