pub struct DakeraClient { /* private fields */ }Expand description
Dakeraclient for interacting with the vector database
Implementations§
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn cluster_status(&self) -> Result<ClusterStatus>
pub async fn cluster_status(&self) -> Result<ClusterStatus>
Get cluster status overview
Sourcepub async fn cluster_nodes(&self) -> Result<NodeListResponse>
pub async fn cluster_nodes(&self) -> Result<NodeListResponse>
List cluster nodes
Sourcepub async fn list_namespaces_admin(&self) -> Result<NamespaceListResponse>
pub async fn list_namespaces_admin(&self) -> Result<NamespaceListResponse>
List all namespaces with detailed admin statistics
Sourcepub async fn delete_namespace_admin(&self, namespace: &str) -> Result<Value>
pub async fn delete_namespace_admin(&self, namespace: &str) -> Result<Value>
Delete an entire namespace and all its data
Sourcepub async fn optimize_namespace(
&self,
namespace: &str,
request: OptimizeRequest,
) -> Result<OptimizeResponse>
pub async fn optimize_namespace( &self, namespace: &str, request: OptimizeRequest, ) -> Result<OptimizeResponse>
Optimize a namespace
Sourcepub async fn index_stats(&self) -> Result<IndexStatsResponse>
pub async fn index_stats(&self) -> Result<IndexStatsResponse>
Get index statistics for all namespaces
Sourcepub async fn rebuild_indexes(
&self,
request: RebuildIndexRequest,
) -> Result<RebuildIndexResponse>
pub async fn rebuild_indexes( &self, request: RebuildIndexRequest, ) -> Result<RebuildIndexResponse>
Rebuild indexes
Sourcepub async fn cache_stats(&self) -> Result<CacheStats>
pub async fn cache_stats(&self) -> Result<CacheStats>
Get cache statistics
Sourcepub async fn cache_clear(
&self,
namespace: Option<&str>,
) -> Result<ClearCacheResponse>
pub async fn cache_clear( &self, namespace: Option<&str>, ) -> Result<ClearCacheResponse>
Clear cache, optionally for a specific namespace
Sourcepub async fn get_config(&self) -> Result<RuntimeConfig>
pub async fn get_config(&self) -> Result<RuntimeConfig>
Get runtime configuration
Sourcepub async fn update_config(
&self,
updates: HashMap<String, Value>,
) -> Result<UpdateConfigResponse>
pub async fn update_config( &self, updates: HashMap<String, Value>, ) -> Result<UpdateConfigResponse>
Update runtime configuration
Sourcepub async fn get_quotas(&self) -> Result<QuotaListResponse>
pub async fn get_quotas(&self) -> Result<QuotaListResponse>
List all namespace quotas
Sourcepub async fn get_quota(&self, namespace: &str) -> Result<QuotaStatus>
pub async fn get_quota(&self, namespace: &str) -> Result<QuotaStatus>
Get quota for a specific namespace
Sourcepub async fn set_quota(
&self,
namespace: &str,
config: QuotaConfig,
) -> Result<Value>
pub async fn set_quota( &self, namespace: &str, config: QuotaConfig, ) -> Result<Value>
Set quota for a specific namespace
Sourcepub async fn delete_quota(&self, namespace: &str) -> Result<Value>
pub async fn delete_quota(&self, namespace: &str) -> Result<Value>
Delete quota for a specific namespace
Sourcepub async fn update_quotas(&self, config: Option<QuotaConfig>) -> Result<Value>
pub async fn update_quotas(&self, config: Option<QuotaConfig>) -> Result<Value>
Update quotas (alias for set_quota on default)
Sourcepub async fn slow_queries(
&self,
limit: Option<usize>,
namespace: Option<&str>,
query_type: Option<&str>,
) -> Result<SlowQueryListResponse>
pub async fn slow_queries( &self, limit: Option<usize>, namespace: Option<&str>, query_type: Option<&str>, ) -> Result<SlowQueryListResponse>
List recent slow queries
Sourcepub async fn slow_query_summary(&self) -> Result<Value>
pub async fn slow_query_summary(&self) -> Result<Value>
Get slow query summary and patterns
Sourcepub async fn clear_slow_queries(&self) -> Result<Value>
pub async fn clear_slow_queries(&self) -> Result<Value>
Clear slow query log
Sourcepub async fn create_backup(
&self,
request: CreateBackupRequest,
) -> Result<CreateBackupResponse>
pub async fn create_backup( &self, request: CreateBackupRequest, ) -> Result<CreateBackupResponse>
Create a new backup
Sourcepub async fn list_backups(&self) -> Result<BackupListResponse>
pub async fn list_backups(&self) -> Result<BackupListResponse>
List all backups
Sourcepub async fn get_backup(&self, backup_id: &str) -> Result<BackupInfo>
pub async fn get_backup(&self, backup_id: &str) -> Result<BackupInfo>
Get backup details by ID
Sourcepub async fn restore_backup(
&self,
request: RestoreBackupRequest,
) -> Result<RestoreBackupResponse>
pub async fn restore_backup( &self, request: RestoreBackupRequest, ) -> Result<RestoreBackupResponse>
Restore from a backup
Sourcepub async fn delete_backup(&self, backup_id: &str) -> Result<Value>
pub async fn delete_backup(&self, backup_id: &str) -> Result<Value>
Delete a backup
Sourcepub async fn ttl_cleanup(
&self,
namespace: Option<&str>,
) -> Result<TtlCleanupResponse>
pub async fn ttl_cleanup( &self, namespace: Option<&str>, ) -> Result<TtlCleanupResponse>
Run TTL cleanup on expired vectors
Sourcepub async fn ttl_stats(&self) -> Result<TtlStatsResponse>
pub async fn ttl_stats(&self) -> Result<TtlStatsResponse>
Get TTL statistics
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn list_agents(&self) -> Result<Vec<AgentSummary>>
pub async fn list_agents(&self) -> Result<Vec<AgentSummary>>
List all agents
Sourcepub async fn agent_memories(
&self,
agent_id: &str,
memory_type: Option<&str>,
limit: Option<u32>,
) -> Result<Vec<RecalledMemory>>
pub async fn agent_memories( &self, agent_id: &str, memory_type: Option<&str>, limit: Option<u32>, ) -> Result<Vec<RecalledMemory>>
Get memories for an agent
Sourcepub async fn agent_stats(&self, agent_id: &str) -> Result<AgentStats>
pub async fn agent_stats(&self, agent_id: &str) -> Result<AgentStats>
Get stats for an agent
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn analytics_overview(
&self,
period: Option<&str>,
namespace: Option<&str>,
) -> Result<AnalyticsOverview>
pub async fn analytics_overview( &self, period: Option<&str>, namespace: Option<&str>, ) -> Result<AnalyticsOverview>
Get analytics overview
Sourcepub async fn analytics_latency(
&self,
period: Option<&str>,
namespace: Option<&str>,
) -> Result<LatencyAnalytics>
pub async fn analytics_latency( &self, period: Option<&str>, namespace: Option<&str>, ) -> Result<LatencyAnalytics>
Get latency analytics
Sourcepub async fn analytics_throughput(
&self,
period: Option<&str>,
namespace: Option<&str>,
) -> Result<ThroughputAnalytics>
pub async fn analytics_throughput( &self, period: Option<&str>, namespace: Option<&str>, ) -> Result<ThroughputAnalytics>
Get throughput analytics
Sourcepub async fn analytics_storage(
&self,
namespace: Option<&str>,
) -> Result<StorageAnalytics>
pub async fn analytics_storage( &self, namespace: Option<&str>, ) -> Result<StorageAnalytics>
Get storage analytics
Source§impl DakeraClient
impl DakeraClient
Sourcepub fn new(base_url: impl Into<String>) -> Result<Self>
pub fn new(base_url: impl Into<String>) -> Result<Self>
Create a new client with the given base URL
§Example
use dakera_client::DakeraClient;
let client = DakeraClient::new("http://localhost:3000").unwrap();Sourcepub fn builder(base_url: impl Into<String>) -> DakeraClientBuilder
pub fn builder(base_url: impl Into<String>) -> DakeraClientBuilder
Create a new client builder for more configuration options
Sourcepub async fn health(&self) -> Result<HealthResponse>
pub async fn health(&self) -> Result<HealthResponse>
Check server health
Sourcepub async fn ready(&self) -> Result<ReadinessResponse>
pub async fn ready(&self) -> Result<ReadinessResponse>
Check if server is ready
Sourcepub async fn list_namespaces(&self) -> Result<Vec<String>>
pub async fn list_namespaces(&self) -> Result<Vec<String>>
List all namespaces
Sourcepub async fn get_namespace(&self, namespace: &str) -> Result<NamespaceInfo>
pub async fn get_namespace(&self, namespace: &str) -> Result<NamespaceInfo>
Get namespace information
Sourcepub async fn create_namespace(
&self,
namespace: &str,
request: CreateNamespaceRequest,
) -> Result<NamespaceInfo>
pub async fn create_namespace( &self, namespace: &str, request: CreateNamespaceRequest, ) -> Result<NamespaceInfo>
Create a new namespace
Sourcepub async fn configure_namespace(
&self,
namespace: &str,
request: ConfigureNamespaceRequest,
) -> Result<ConfigureNamespaceResponse>
pub async fn configure_namespace( &self, namespace: &str, request: ConfigureNamespaceRequest, ) -> Result<ConfigureNamespaceResponse>
Create or update a namespace configuration (upsert semantics — v0.6.0).
Creates the namespace if it does not exist, or updates its distance-metric
configuration if it already exists. Dimension changes are rejected to
prevent silent data corruption. Requires Scope::Write.
Sourcepub async fn upsert(
&self,
namespace: &str,
request: UpsertRequest,
) -> Result<UpsertResponse>
pub async fn upsert( &self, namespace: &str, request: UpsertRequest, ) -> Result<UpsertResponse>
Upsert vectors into a namespace
Sourcepub async fn upsert_one(
&self,
namespace: &str,
vector: Vector,
) -> Result<UpsertResponse>
pub async fn upsert_one( &self, namespace: &str, vector: Vector, ) -> Result<UpsertResponse>
Upsert a single vector (convenience method)
Sourcepub async fn upsert_columns(
&self,
namespace: &str,
request: ColumnUpsertRequest,
) -> Result<UpsertResponse>
pub async fn upsert_columns( &self, namespace: &str, request: ColumnUpsertRequest, ) -> Result<UpsertResponse>
Upsert vectors in column format (Turbopuffer-inspired)
This format is more efficient for bulk upserts as it avoids repeating field names for each vector. All arrays must have equal length.
§Example
use dakera_client::{DakeraClient, ColumnUpsertRequest};
let client = DakeraClient::new("http://localhost:3000")?;
let request = ColumnUpsertRequest::new(
vec!["id1".to_string(), "id2".to_string(), "id3".to_string()],
vec![
vec![0.1, 0.2, 0.3],
vec![0.4, 0.5, 0.6],
vec![0.7, 0.8, 0.9],
],
)
.with_attribute("category", vec![
serde_json::json!("A"),
serde_json::json!("B"),
serde_json::json!("A"),
]);
let response = client.upsert_columns("my-namespace", request).await?;
println!("Upserted {} vectors", response.upserted_count);Sourcepub async fn query(
&self,
namespace: &str,
request: QueryRequest,
) -> Result<QueryResponse>
pub async fn query( &self, namespace: &str, request: QueryRequest, ) -> Result<QueryResponse>
Query for similar vectors
Sourcepub async fn query_simple(
&self,
namespace: &str,
vector: Vec<f32>,
top_k: u32,
) -> Result<QueryResponse>
pub async fn query_simple( &self, namespace: &str, vector: Vec<f32>, top_k: u32, ) -> Result<QueryResponse>
Simple query with just a vector and top_k (convenience method)
Sourcepub async fn batch_query(
&self,
namespace: &str,
request: BatchQueryRequest,
) -> Result<BatchQueryResponse>
pub async fn batch_query( &self, namespace: &str, request: BatchQueryRequest, ) -> Result<BatchQueryResponse>
Execute multiple queries in a single request
This allows executing multiple vector similarity queries in parallel, which is more efficient than making separate requests.
§Example
use dakera_client::{DakeraClient, BatchQueryRequest, BatchQueryItem};
let client = DakeraClient::new("http://localhost:3000")?;
let request = BatchQueryRequest::new(vec![
BatchQueryItem::new(vec![0.1, 0.2, 0.3], 5).with_id("query1"),
BatchQueryItem::new(vec![0.4, 0.5, 0.6], 10).with_id("query2"),
]);
let response = client.batch_query("my-namespace", request).await?;
println!("Executed {} queries in {}ms", response.query_count, response.total_latency_ms);Sourcepub async fn delete(
&self,
namespace: &str,
request: DeleteRequest,
) -> Result<DeleteResponse>
pub async fn delete( &self, namespace: &str, request: DeleteRequest, ) -> Result<DeleteResponse>
Delete vectors by ID
Sourcepub async fn delete_one(
&self,
namespace: &str,
id: &str,
) -> Result<DeleteResponse>
pub async fn delete_one( &self, namespace: &str, id: &str, ) -> Result<DeleteResponse>
Delete a single vector by ID (convenience method)
Sourcepub async fn index_documents(
&self,
namespace: &str,
request: IndexDocumentsRequest,
) -> Result<IndexDocumentsResponse>
pub async fn index_documents( &self, namespace: &str, request: IndexDocumentsRequest, ) -> Result<IndexDocumentsResponse>
Index documents for full-text search
Sourcepub async fn index_document(
&self,
namespace: &str,
document: Document,
) -> Result<IndexDocumentsResponse>
pub async fn index_document( &self, namespace: &str, document: Document, ) -> Result<IndexDocumentsResponse>
Index a single document (convenience method)
Sourcepub async fn fulltext_search(
&self,
namespace: &str,
request: FullTextSearchRequest,
) -> Result<FullTextSearchResponse>
pub async fn fulltext_search( &self, namespace: &str, request: FullTextSearchRequest, ) -> Result<FullTextSearchResponse>
Perform full-text search
Sourcepub async fn search_text(
&self,
namespace: &str,
query: &str,
top_k: u32,
) -> Result<FullTextSearchResponse>
pub async fn search_text( &self, namespace: &str, query: &str, top_k: u32, ) -> Result<FullTextSearchResponse>
Simple full-text search (convenience method)
Sourcepub async fn fulltext_stats(&self, namespace: &str) -> Result<FullTextStats>
pub async fn fulltext_stats(&self, namespace: &str) -> Result<FullTextStats>
Get full-text index statistics
Sourcepub async fn fulltext_delete(
&self,
namespace: &str,
request: DeleteRequest,
) -> Result<DeleteResponse>
pub async fn fulltext_delete( &self, namespace: &str, request: DeleteRequest, ) -> Result<DeleteResponse>
Delete documents from full-text index
Sourcepub async fn hybrid_search(
&self,
namespace: &str,
request: HybridSearchRequest,
) -> Result<HybridSearchResponse>
pub async fn hybrid_search( &self, namespace: &str, request: HybridSearchRequest, ) -> Result<HybridSearchResponse>
Perform hybrid search (vector + full-text)
Sourcepub async fn multi_vector_search(
&self,
namespace: &str,
request: MultiVectorSearchRequest,
) -> Result<MultiVectorSearchResponse>
pub async fn multi_vector_search( &self, namespace: &str, request: MultiVectorSearchRequest, ) -> Result<MultiVectorSearchResponse>
Multi-vector search with positive/negative vectors and MMR
This performs semantic search using multiple positive vectors (to search towards) and optional negative vectors (to search away from). Supports MMR (Maximal Marginal Relevance) for result diversity.
§Example
use dakera_client::{DakeraClient, MultiVectorSearchRequest};
let client = DakeraClient::new("http://localhost:3000")?;
// Search towards multiple concepts, away from others
let request = MultiVectorSearchRequest::new(vec![
vec![0.1, 0.2, 0.3], // positive vector 1
vec![0.4, 0.5, 0.6], // positive vector 2
])
.with_negative_vectors(vec![
vec![0.7, 0.8, 0.9], // negative vector
])
.with_top_k(10)
.with_mmr(0.7); // Enable MMR with lambda=0.7
let response = client.multi_vector_search("my-namespace", request).await?;
for result in response.results {
println!("ID: {}, Score: {}", result.id, result.score);
}Sourcepub async fn aggregate(
&self,
namespace: &str,
request: AggregationRequest,
) -> Result<AggregationResponse>
pub async fn aggregate( &self, namespace: &str, request: AggregationRequest, ) -> Result<AggregationResponse>
Aggregate vectors with grouping (Turbopuffer-inspired)
This performs aggregation queries on vector metadata, supporting count, sum, avg, min, and max operations with optional grouping.
§Example
use dakera_client::{DakeraClient, AggregationRequest};
let client = DakeraClient::new("http://localhost:3000")?;
// Count all vectors and sum scores, grouped by category
let request = AggregationRequest::new()
.with_count("total_count")
.with_sum("total_score", "score")
.with_avg("avg_score", "score")
.with_group_by("category");
let response = client.aggregate("my-namespace", request).await?;
if let Some(groups) = response.aggregation_groups {
for group in groups {
println!("Group: {:?}", group.group_key);
}
}Sourcepub async fn unified_query(
&self,
namespace: &str,
request: UnifiedQueryRequest,
) -> Result<UnifiedQueryResponse>
pub async fn unified_query( &self, namespace: &str, request: UnifiedQueryRequest, ) -> Result<UnifiedQueryResponse>
Unified query with flexible ranking options (Turbopuffer-inspired)
This provides a unified API for vector search (ANN/kNN), full-text search (BM25), and attribute ordering. Supports combining multiple ranking functions with Sum, Max, and Product operators.
§Example
use dakera_client::{DakeraClient, UnifiedQueryRequest, SortDirection};
let client = DakeraClient::new("http://localhost:3000")?;
// Vector ANN search
let request = UnifiedQueryRequest::vector_search(vec![0.1, 0.2, 0.3], 10);
let response = client.unified_query("my-namespace", request).await?;
// Full-text BM25 search
let request = UnifiedQueryRequest::fulltext_search("content", "hello world", 10);
let response = client.unified_query("my-namespace", request).await?;
// Attribute ordering with filter
let request = UnifiedQueryRequest::attribute_order("timestamp", SortDirection::Desc, 10)
.with_filter(serde_json::json!({"category": {"$eq": "science"}}));
let response = client.unified_query("my-namespace", request).await?;
for result in response.results {
println!("ID: {}, Score: {:?}", result.id, result.dist);
}Sourcepub async fn unified_vector_search(
&self,
namespace: &str,
vector: Vec<f32>,
top_k: usize,
) -> Result<UnifiedQueryResponse>
pub async fn unified_vector_search( &self, namespace: &str, vector: Vec<f32>, top_k: usize, ) -> Result<UnifiedQueryResponse>
Simple vector search using the unified query API (convenience method)
This is a shortcut for unified_query with a vector ANN search.
Sourcepub async fn unified_text_search(
&self,
namespace: &str,
field: &str,
query: &str,
top_k: usize,
) -> Result<UnifiedQueryResponse>
pub async fn unified_text_search( &self, namespace: &str, field: &str, query: &str, top_k: usize, ) -> Result<UnifiedQueryResponse>
Simple full-text search using the unified query API (convenience method)
This is a shortcut for unified_query with a BM25 full-text search.
Sourcepub async fn explain_query(
&self,
namespace: &str,
request: QueryExplainRequest,
) -> Result<QueryExplainResponse>
pub async fn explain_query( &self, namespace: &str, request: QueryExplainRequest, ) -> Result<QueryExplainResponse>
Explain query execution plan (similar to SQL EXPLAIN)
This provides detailed information about how a query will be executed, including index selection, execution stages, cost estimates, and performance recommendations.
§Example
use dakera_client::{DakeraClient, QueryExplainRequest};
let client = DakeraClient::new("http://localhost:3000")?;
// Explain a vector search query
let request = QueryExplainRequest::vector_search(vec![0.1, 0.2, 0.3], 10)
.with_verbose();
let plan = client.explain_query("my-namespace", request).await?;
println!("Query plan: {}", plan.summary);
println!("Estimated time: {}ms", plan.cost_estimate.estimated_time_ms);
for stage in &plan.stages {
println!("Stage {}: {} - {}", stage.order, stage.name, stage.description);
}
for rec in &plan.recommendations {
println!("Recommendation ({}): {}", rec.priority, rec.description);
}Sourcepub async fn warm_cache(
&self,
request: WarmCacheRequest,
) -> Result<WarmCacheResponse>
pub async fn warm_cache( &self, request: WarmCacheRequest, ) -> Result<WarmCacheResponse>
Warm cache for vectors in a namespace
This pre-loads vectors into cache tiers for faster subsequent access. Supports priority levels and can run in the background.
§Example
use dakera_client::{DakeraClient, WarmCacheRequest, WarmingPriority};
let client = DakeraClient::new("http://localhost:3000")?;
// Warm entire namespace with high priority
let response = client.warm_cache(
WarmCacheRequest::new("my-namespace")
.with_priority(WarmingPriority::High)
).await?;
println!("Warmed {} entries", response.entries_warmed);Sourcepub async fn warm_vectors(
&self,
namespace: &str,
vector_ids: Vec<String>,
) -> Result<WarmCacheResponse>
pub async fn warm_vectors( &self, namespace: &str, vector_ids: Vec<String>, ) -> Result<WarmCacheResponse>
Warm specific vectors by ID (convenience method)
Sourcepub async fn export(
&self,
namespace: &str,
request: ExportRequest,
) -> Result<ExportResponse>
pub async fn export( &self, namespace: &str, request: ExportRequest, ) -> Result<ExportResponse>
Export vectors from a namespace with pagination
This exports all vectors from a namespace, supporting pagination for
large datasets. Use the next_cursor from the response to fetch
subsequent pages.
§Example
use dakera_client::{DakeraClient, ExportRequest};
let client = DakeraClient::new("http://localhost:3000")?;
// Export first page of vectors
let mut request = ExportRequest::new().with_top_k(1000);
let response = client.export("my-namespace", request).await?;
println!("Exported {} vectors", response.returned_count);
// Fetch next page if available
if let Some(cursor) = response.next_cursor {
let next_request = ExportRequest::new().with_cursor(cursor);
let next_response = client.export("my-namespace", next_request).await?;
}Sourcepub async fn export_all(&self, namespace: &str) -> Result<ExportResponse>
pub async fn export_all(&self, namespace: &str) -> Result<ExportResponse>
Export all vectors from a namespace (convenience method)
This is a simple wrapper that exports with default settings.
Sourcepub async fn diagnostics(&self) -> Result<SystemDiagnostics>
pub async fn diagnostics(&self) -> Result<SystemDiagnostics>
Get system diagnostics
Sourcepub async fn compact(
&self,
request: CompactionRequest,
) -> Result<CompactionResponse>
pub async fn compact( &self, request: CompactionRequest, ) -> Result<CompactionResponse>
Trigger index compaction
Sourcepub async fn fetch(
&self,
namespace: &str,
request: FetchRequest,
) -> Result<FetchResponse>
pub async fn fetch( &self, namespace: &str, request: FetchRequest, ) -> Result<FetchResponse>
Fetch vectors by their IDs
Sourcepub async fn fetch_by_ids(
&self,
namespace: &str,
ids: &[&str],
) -> Result<Vec<Vector>>
pub async fn fetch_by_ids( &self, namespace: &str, ids: &[&str], ) -> Result<Vec<Vector>>
Fetch vectors by IDs (convenience method)
Sourcepub async fn upsert_text(
&self,
namespace: &str,
request: UpsertTextRequest,
) -> Result<TextUpsertResponse>
pub async fn upsert_text( &self, namespace: &str, request: UpsertTextRequest, ) -> Result<TextUpsertResponse>
Upsert text documents with automatic server-side embedding generation
Sourcepub async fn query_text(
&self,
namespace: &str,
request: QueryTextRequest,
) -> Result<TextQueryResponse>
pub async fn query_text( &self, namespace: &str, request: QueryTextRequest, ) -> Result<TextQueryResponse>
Query using natural language text with automatic server-side embedding
Sourcepub async fn query_text_simple(
&self,
namespace: &str,
text: &str,
top_k: u32,
) -> Result<TextQueryResponse>
pub async fn query_text_simple( &self, namespace: &str, text: &str, top_k: u32, ) -> Result<TextQueryResponse>
Query text (convenience method)
Sourcepub async fn batch_query_text(
&self,
namespace: &str,
request: BatchQueryTextRequest,
) -> Result<BatchQueryTextResponse>
pub async fn batch_query_text( &self, namespace: &str, request: BatchQueryTextRequest, ) -> Result<BatchQueryTextResponse>
Execute multiple text queries with automatic embedding in a single request
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn stream_namespace_events(
&self,
namespace: &str,
) -> Result<Receiver<Result<DakeraEvent>>>
pub async fn stream_namespace_events( &self, namespace: &str, ) -> Result<Receiver<Result<DakeraEvent>>>
Subscribe to namespace-scoped SSE events.
Opens a long-lived connection to GET /v1/namespaces/{namespace}/events
and returns a tokio::sync::mpsc::Receiver that yields
[DakeraEvent] results as they arrive. The background task exits when
the server closes the stream or the receiver is dropped.
Requires a Read-scoped API key.
§Example
use dakera_client::DakeraClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = DakeraClient::new("http://localhost:3000")?;
let mut rx = client.stream_namespace_events("my-ns").await?;
while let Some(result) = rx.recv().await {
println!("{:?}", result?);
}
Ok(())
}Sourcepub async fn stream_global_events(
&self,
) -> Result<Receiver<Result<DakeraEvent>>>
pub async fn stream_global_events( &self, ) -> Result<Receiver<Result<DakeraEvent>>>
Subscribe to the global SSE event stream (all namespaces).
Opens a long-lived connection to GET /ops/events and returns a
tokio::sync::mpsc::Receiver that yields [DakeraEvent] results.
Requires an Admin-scoped API key.
Sourcepub async fn stream_memory_events(
&self,
) -> Result<Receiver<Result<MemoryEvent>>>
pub async fn stream_memory_events( &self, ) -> Result<Receiver<Result<MemoryEvent>>>
Subscribe to the memory lifecycle SSE event stream (DASH-B).
Opens a long-lived connection to GET /v1/events/stream and returns a
tokio::sync::mpsc::Receiver that yields [MemoryEvent] results as
they arrive. The background task exits when the server closes the stream
or the receiver is dropped.
Requires a Read-scoped API key.
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn create_key(
&self,
request: CreateKeyRequest,
) -> Result<CreateKeyResponse>
pub async fn create_key( &self, request: CreateKeyRequest, ) -> Result<CreateKeyResponse>
Create a new API key
Sourcepub async fn list_keys(&self) -> Result<ListKeysResponse>
pub async fn list_keys(&self) -> Result<ListKeysResponse>
List all API keys
Sourcepub async fn delete_key(&self, key_id: &str) -> Result<KeySuccessResponse>
pub async fn delete_key(&self, key_id: &str) -> Result<KeySuccessResponse>
Delete (revoke) an API key
Sourcepub async fn deactivate_key(&self, key_id: &str) -> Result<KeySuccessResponse>
pub async fn deactivate_key(&self, key_id: &str) -> Result<KeySuccessResponse>
Deactivate an API key (soft delete)
Sourcepub async fn rotate_key(&self, key_id: &str) -> Result<RotateKeyResponse>
pub async fn rotate_key(&self, key_id: &str) -> Result<RotateKeyResponse>
Rotate an API key (creates new key, deactivates old)
Sourcepub async fn key_usage(&self, key_id: &str) -> Result<ApiKeyUsageResponse>
pub async fn key_usage(&self, key_id: &str) -> Result<ApiKeyUsageResponse>
Get API key usage statistics
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn knowledge_graph(
&self,
request: KnowledgeGraphRequest,
) -> Result<KnowledgeGraphResponse>
pub async fn knowledge_graph( &self, request: KnowledgeGraphRequest, ) -> Result<KnowledgeGraphResponse>
Build a knowledge graph from a seed memory
Sourcepub async fn full_knowledge_graph(
&self,
request: FullKnowledgeGraphRequest,
) -> Result<KnowledgeGraphResponse>
pub async fn full_knowledge_graph( &self, request: FullKnowledgeGraphRequest, ) -> Result<KnowledgeGraphResponse>
Build a full knowledge graph for an agent
Sourcepub async fn summarize(
&self,
request: SummarizeRequest,
) -> Result<SummarizeResponse>
pub async fn summarize( &self, request: SummarizeRequest, ) -> Result<SummarizeResponse>
Summarize memories
Sourcepub async fn deduplicate(
&self,
request: DeduplicateRequest,
) -> Result<DeduplicateResponse>
pub async fn deduplicate( &self, request: DeduplicateRequest, ) -> Result<DeduplicateResponse>
Deduplicate memories
Sourcepub async fn cross_agent_network(
&self,
request: CrossAgentNetworkRequest,
) -> Result<CrossAgentNetworkResponse>
pub async fn cross_agent_network( &self, request: CrossAgentNetworkRequest, ) -> Result<CrossAgentNetworkResponse>
Build a cross-agent knowledge network (DASH-A).
Calls POST /v1/knowledge/network/cross-agent (Admin scope) and returns
a graph of memory nodes and cross-agent similarity edges.
Source§impl DakeraClient
impl DakeraClient
Sourcepub async fn store_memory(
&self,
request: StoreMemoryRequest,
) -> Result<StoreMemoryResponse>
pub async fn store_memory( &self, request: StoreMemoryRequest, ) -> Result<StoreMemoryResponse>
Store a memory for an agent
§Example
use dakera_client::{DakeraClient, memory::StoreMemoryRequest};
let client = DakeraClient::new("http://localhost:3000")?;
let request = StoreMemoryRequest::new("agent-1", "The user prefers dark mode")
.with_importance(0.8)
.with_tags(vec!["preferences".to_string()]);
let response = client.store_memory(request).await?;
println!("Stored memory: {}", response.memory_id);Sourcepub async fn recall(&self, request: RecallRequest) -> Result<RecallResponse>
pub async fn recall(&self, request: RecallRequest) -> Result<RecallResponse>
Recall memories by semantic query
§Example
use dakera_client::{DakeraClient, memory::RecallRequest};
let client = DakeraClient::new("http://localhost:3000")?;
let request = RecallRequest::new("agent-1", "user preferences")
.with_top_k(10);
let response = client.recall(request).await?;
for memory in response.memories {
println!("{}: {} (score: {})", memory.id, memory.content, memory.score);
}Sourcepub async fn recall_simple(
&self,
agent_id: &str,
query: &str,
top_k: usize,
) -> Result<RecallResponse>
pub async fn recall_simple( &self, agent_id: &str, query: &str, top_k: usize, ) -> Result<RecallResponse>
Simple recall with just agent_id and query (convenience method)
Sourcepub async fn get_memory(&self, memory_id: &str) -> Result<RecalledMemory>
pub async fn get_memory(&self, memory_id: &str) -> Result<RecalledMemory>
Get a specific memory by ID
Sourcepub async fn forget(&self, request: ForgetRequest) -> Result<ForgetResponse>
pub async fn forget(&self, request: ForgetRequest) -> Result<ForgetResponse>
Forget (delete) memories
Sourcepub async fn search_memories(
&self,
request: RecallRequest,
) -> Result<RecallResponse>
pub async fn search_memories( &self, request: RecallRequest, ) -> Result<RecallResponse>
Search memories with advanced filters
Sourcepub async fn update_memory(
&self,
agent_id: &str,
memory_id: &str,
request: UpdateMemoryRequest,
) -> Result<StoreMemoryResponse>
pub async fn update_memory( &self, agent_id: &str, memory_id: &str, request: UpdateMemoryRequest, ) -> Result<StoreMemoryResponse>
Update an existing memory
Sourcepub async fn update_importance(
&self,
agent_id: &str,
request: UpdateImportanceRequest,
) -> Result<Value>
pub async fn update_importance( &self, agent_id: &str, request: UpdateImportanceRequest, ) -> Result<Value>
Update importance of memories
Sourcepub async fn consolidate(
&self,
agent_id: &str,
request: ConsolidateRequest,
) -> Result<ConsolidateResponse>
pub async fn consolidate( &self, agent_id: &str, request: ConsolidateRequest, ) -> Result<ConsolidateResponse>
Consolidate memories for an agent
Sourcepub async fn memory_feedback(
&self,
agent_id: &str,
request: FeedbackRequest,
) -> Result<FeedbackResponse>
pub async fn memory_feedback( &self, agent_id: &str, request: FeedbackRequest, ) -> Result<FeedbackResponse>
Submit feedback on a memory recall
Sourcepub async fn start_session(&self, agent_id: &str) -> Result<Session>
pub async fn start_session(&self, agent_id: &str) -> Result<Session>
Start a new session for an agent
Sourcepub async fn start_session_with_metadata(
&self,
agent_id: &str,
metadata: Value,
) -> Result<Session>
pub async fn start_session_with_metadata( &self, agent_id: &str, metadata: Value, ) -> Result<Session>
Start a session with metadata
Sourcepub async fn end_session(
&self,
session_id: &str,
summary: Option<String>,
) -> Result<Session>
pub async fn end_session( &self, session_id: &str, summary: Option<String>, ) -> Result<Session>
End a session, optionally with a summary
Sourcepub async fn get_session(&self, session_id: &str) -> Result<Session>
pub async fn get_session(&self, session_id: &str) -> Result<Session>
Get a session by ID
Sourcepub async fn list_sessions(&self, agent_id: &str) -> Result<Vec<Session>>
pub async fn list_sessions(&self, agent_id: &str) -> Result<Vec<Session>>
List sessions for an agent
Sourcepub async fn session_memories(&self, session_id: &str) -> Result<RecallResponse>
pub async fn session_memories(&self, session_id: &str) -> Result<RecallResponse>
Get memories in a session
Trait Implementations§
Source§impl Clone for DakeraClient
impl Clone for DakeraClient
Source§fn clone(&self) -> DakeraClient
fn clone(&self) -> DakeraClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more