Skip to main content

Crate dakera_client

Crate dakera_client 

Source
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§

ActualStats
Actual execution statistics (when execute=true)
AggregationGroup
Single group in aggregation results
AggregationRequest
Request for aggregation query (Turbopuffer-inspired)
AggregationResponse
Response for aggregation query
BatchQueryItem
A single query within a batch request
BatchQueryRequest
Batch query request - execute multiple queries in parallel
BatchQueryResponse
Batch query response
BatchQueryResult
Results for a single query within a batch
BatchQueryTextRequest
Request to execute multiple text queries with automatic embedding in a single call.
BatchQueryTextResponse
Response from a batch text query operation.
ColumnUpsertRequest
Column-based upsert request (Turbopuffer-inspired)
CompactionRequest
Compaction request
CompactionResponse
Compaction response
ComponentHealth
Component health status
ConfigureNamespaceRequest
Request body for PUT /v1/namespaces/:namespace — upsert semantics (v0.6.0).
ConfigureNamespaceResponse
Response from PUT /v1/namespaces/:namespace.
CostEstimate
Cost estimation
CreateNamespaceRequest
Request to create a new namespace.
DakeraClient
Dakeraclient for interacting with the vector database
DakeraClientBuilder
Builder for DakeraClient
DeleteRequest
Delete vectors request
DeleteResponse
Delete response
Document
A document for full-text indexing
ExecutionStage
A stage in query execution
ExportRequest
Request to export vectors from a namespace with pagination
ExportResponse
Response from export operation
ExportedVector
A single exported vector record
FetchRequest
Request to fetch vectors by their IDs.
FetchResponse
Response from a fetch-by-ID operation.
FullTextMatch
Full-text search result
FullTextSearchRequest
Full-text search request
FullTextSearchResponse
Full-text search response
FullTextStats
Full-text index statistics
HealthResponse
Health check response
HealthStatus
Health status for a component
HybridSearchRequest
Hybrid search request combining vector and full-text search
HybridSearchResponse
Hybrid search response
IndexAlternative
Alternative index that was considered
IndexDocumentsRequest
Index documents request
IndexDocumentsResponse
Index documents response
IndexSelection
Index selection details
IndexStatistics
Index statistics
JobInfo
Background job information
ListNamespacesResponse
List namespaces response
Match
A match result from a query
MultiVectorSearchRequest
Request for multi-vector search with positive and negative vectors
MultiVectorSearchResponse
Response from multi-vector search
MultiVectorSearchResult
Single result from multi-vector search
NamespaceInfo
Namespace information
QueryExplainRequest
Query explain request
QueryExplainResponse
Query explain response - detailed execution plan
QueryParams
Query parameters for reference
QueryRequest
Query request for vector similarity search
QueryResponse
Query response
QueryTextRequest
Request to query using natural language text with automatic embedding.
ReadinessResponse
Readiness check response
Recommendation
Performance recommendation
ResourceUsage
Resource usage metrics
StalenessConfig
Configuration for bounded staleness reads
SystemDiagnostics
System diagnostics
SystemInfo
System information
TextDocument
A text document to upsert with automatic embedding generation.
TextQueryResponse
Response from a text query operation.
TextSearchResult
A single text search result.
TextUpsertResponse
Response from a text upsert operation.
UnifiedQueryRequest
Unified query request with flexible ranking options (Turbopuffer-inspired)
UnifiedQueryResponse
Unified query response
UnifiedSearchResult
Single result from unified query
UpsertRequest
Upsert vectors request
UpsertResponse
Upsert response
UpsertTextRequest
Request to upsert text documents with automatic embedding.
Vector
A vector with ID and optional metadata
WarmCacheRequest
Cache warming request with priority hints
WarmCacheResponse
Cache warming response

Enums§

AccessPatternHint
Access pattern hint for cache optimization
AggregateFunction
Aggregate function for computing values across documents
ClientError
Errors that can occur when using the Dakera client
DistanceMetric
Distance metric for similarity search
EmbeddingModel
Supported embedding models for text-based operations.
ExplainQueryType
Query type for explain
RankBy
Ranking function for unified query API Supports vector search (ANN/kNN), full-text BM25, and attribute ordering
ReadConsistency
Read consistency level for queries (Turbopuffer-inspired)
SortDirection
Sort direction for attribute ordering
VectorSearchMethod
Vector search method for unified query
WarmingPriority
Priority level for cache warming operations
WarmingTargetTier
Target cache tier for warming

Type Aliases§

Result
Result type alias for Dakera client operations