Module utils

Module utils 

Source
Expand description

Utility functions and helpers for common semantic search workflows

This module provides convenience functions that combine multiple features and simplify common patterns in semantic search applications.

Structs§

BatchDeletionResult
Result of a batch deletion operation
BatchEmbeddingStats
Statistics for a batch embedding operation
BatchIndexResult
Result of a batch index operation with statistics
HealthCheckResult
Health check result for a semantic router
IndexStats
Export index statistics to a JSON-serializable structure

Functions§

average_embedding
Calculate the average embedding from a set of embeddings
batch_delete
Delete multiple CIDs from a vector index in batch
cosine_similarity
Calculate cosine similarity between two embeddings
create_hybrid_index_from_map
Create a hybrid index with metadata extracted from a CID mapping
export_index_stats
health_check
Perform a comprehensive health check on a vector index
index_with_quality_check
Validate and index embeddings in a single operation with quality checking
normalize_vector
Normalize a vector to unit length (L2 norm = 1)
normalize_vectors
Normalize a batch of vectors in place
pairwise_similarities
Calculate pairwise cosine similarities between a query and multiple embeddings
validate_embeddings
Validate a batch of embeddings and return quality reports