Skip to main content

Crate velesdb_server

Crate velesdb_server 

Source
Expand description

VelesDB Server - REST API library for the VelesDB vector database.

This module provides the HTTP handlers and types for the VelesDB REST API.

§OpenAPI Documentation

The API is documented using OpenAPI 3.0. Access the interactive documentation at:

  • Swagger UI: GET /swagger-ui
  • OpenAPI JSON: GET /api-docs/openapi.json

Re-exports§

pub use onboarding::OnboardingMetrics;

Modules§

auth
API key authentication middleware.
config
Server configuration module.
explain
EXPLAIN query handler and plan building logic.
match_query
MATCH query handler for REST API (EPIC-045 US-007).
onboarding
Lightweight counters for first-hour troubleshooting diagnostics.
query
VelesQL query execution handlers.
rate_limit
Global per-IP rate limiting middleware backed by tower-governor.
routes
Route definitions for the VelesDB REST API.
search
Search handlers for vector similarity, text, and hybrid search.
serde_id
Serde helpers for serializing u64 IDs as JSON strings.
tls
TLS configuration and server support via rustls.

Structs§

ActualStatsResponse
Actual execution statistics for EXPLAIN ANALYZE responses.
AggregationResponse
Response from VelesQL aggregation query execution.
ApiDoc
VelesDB API Documentation
AppState
Application state shared across handlers.
BatchSearchRequest
Request for batch vector search.
BatchSearchResponse
Response from batch search.
CollectionConfigResponse
Response with detailed collection configuration.
CollectionDiagnosticsResponse
Response with a collection’s health diagnostics.
CollectionResponse
Response with collection information.
CollectionStatsResponse
Response with collection statistics from ANALYZE.
ColumnStatsResponse
Per-column statistics in a collection stats response.
CreateCollectionRequest
Request to create a new collection.
CreateIndexRequest
Request to create a property index.
DegreeResponse
Response for node degree query.
EdgeCountResponse
Response for edge count query.
EnableStreamingRequest
Request body for the enable-streaming endpoint.
ErrorResponse
Error response.
ExplainCost
Estimated cost metrics for the query.
ExplainFeatures
Features detected in the query.
ExplainRequest
Request for query EXPLAIN.
ExplainResponse
Response from query EXPLAIN.
ExplainStep
A step in the query execution plan.
FusionRequest
Fusion configuration for hybrid dense+sparse search.
GraphSearchRequest
Request for graph embedding search.
GraphSearchResponse
Response for graph embedding search.
GuardRailsConfigRequest
Request to configure query guard-rails.
GuardRailsConfigResponse
Response with current guard-rails configuration.
HybridSearchRequest
Request for hybrid search (vector + text).
IdScoreResult
A single ID+score result from IDs-only search.
IndexResponse
Response with index information.
IndexStatsResponse
Per-index statistics in a collection stats response.
ListIndexesResponse
Response listing all indexes.
MultiQuerySearchRequest
Request for multi-query vector search with fusion.
NodeEdgeQueryParams
Query parameters for node-scoped edge queries.
NodeListResponse
Response containing all node IDs in the graph.
NodePayloadResponse
Response for a node payload retrieval.
NodeStatsResponse
Per-plan-node estimated execution statistics for EXPLAIN ANALYZE responses.
ParallelTraverseRequest
Request for parallel multi-source BFS traversal.
PointRequest
A point in an upsert request.
QueryErrorDetail
VelesQL query error detail.
QueryErrorResponse
VelesQL query error response.
QueryRequest
Request for VelesQL query execution.
QueryResponse
Response from VelesQL query execution.
QueryResponseMeta
Metadata section for VelesQL query responses.
ScrollPoint
A single point in a scroll response.
ScrollRequest
Request body for the scroll endpoint.
ScrollResponse
Response from the scroll endpoint.
SearchIdsResponse
Response from IDs-only search (no payload hydration).
SearchRequest
Request for vector search (dense, sparse, or hybrid).
SearchResponse
Response from vector search.
SearchResultResponse
A single search result.
StreamDoneEvent
SSE event: Traversal completed.
StreamInsertRequest
Request body for the streaming insert endpoint (single point).
StreamNodeEvent
SSE event: A node reached during traversal.
StreamStatsEvent
SSE event: Periodic statistics update.
StreamTraverseParams
Query parameters for streaming graph traversal.
TextSearchRequest
Request for BM25 text search.
TraversalResultItem
A single traversal result item.
TraversalStats
Statistics from traversal operation.
TraverseRequest
Request for graph traversal.
TraverseResponse
Response from graph traversal.
UnifiedQueryResponse
Unified response from /query endpoint.
UpsertNodePayloadRequest
Request to upsert a node payload.
UpsertPointsRequest
Request to upsert points.
VelesqlErrorDetail
Standardized VelesQL semantic/runtime error detail.
VelesqlErrorResponse
Standardized VelesQL semantic/runtime error response.

Enums§

QueryType
Query type for unified /query endpoint.
SparseVectorInput
Input format for sparse vectors, supporting two JSON representations:

Constants§

VELESQL_CONTRACT_VERSION
Canonical VelesQL contract version for REST responses.

Functions§

add_edge
Add an edge to a collection’s graph.
add_edges_batch
Add multiple edges to a collection’s graph in one batched operation.
aggregate
Execute an aggregation-only VelesQL query.
analyze_collection
Analyze a collection, computing and persisting statistics.
batch_search
Batch search for multiple vectors.
bulk_delete_points
Deletes multiple points by ID in a single request.
collection_diagnostics
Get health diagnostics for a collection (index readiness, point count).
collection_sanity
Run a quick sanity check for onboarding and troubleshooting.
compact_collection
Compacts the vector storage of a collection, rewriting active vectors into a contiguous layout and reclaiming disk space from deleted entries.
create_collection
Create a new collection.
create_index
Create a property index on a graph collection.
default_avg_weight
Default average weight for weighted fusion.
default_collection_type
Default collection type: vector.
default_dense_weight
Default dense weight for relative score fusion.
default_fusion_strategy
Default fusion strategy: RRF.
default_hit_weight
Default hit weight for weighted fusion.
default_index_type
Default index type: hash.
default_max_weight
Default max weight for weighted fusion.
default_metric
Default distance metric: cosine.
default_rrf_k
Default RRF k parameter.
default_sparse_weight
Default sparse weight for relative score fusion.
default_storage_mode
Default storage mode: full (no quantization).
default_top_k
Default number of results to return.
default_vector_weight
Default vector weight for hybrid search.
delete_collection
Delete a collection.
delete_index
Delete a property index.
delete_point
Delete a point by ID.
enable_streaming
Enable streaming ingestion on a collection.
explain
Explain a VelesQL query, optionally executing it with instrumentation.
flush_collection
Flush pending changes to disk.
get_collection
Get collection information.
get_collection_config
Get detailed collection configuration (HNSW params, storage mode, schema, etc.).
get_collection_stats
Get cached collection statistics (returns 404 if never analyzed).
get_edge_count
Get the total number of edges in the graph.
get_edges
Get edges from a collection’s graph filtered by label.
get_guardrails
Get current guard-rails configuration.
get_node_degree
Get the degree (in and out) of a specific node.
get_node_edges
Get edges for a specific node with direction filtering.
get_node_payload
Get the payload of a graph node.
get_point
Get a point by ID.
get_point_relations
List outgoing relation edges for a point.
graph_search
Search graph nodes by embedding similarity.
health_check
Liveness probe — always returns 200 OK.
health_metrics
Simple health metrics for lightweight monitoring.
hybrid_search
Hybrid search combining vector similarity and BM25 text search.
is_empty
Check if a collection is empty.
list_collections
List all collections.
list_indexes
List all indexes on a collection.
list_nodes
List all node IDs in the graph.
match_query
Execute a MATCH query on a collection.
mode_to_search_quality
Convert search mode string to crate::SearchQuality.
multi_query_search
Multi-query search with fusion strategies.
multi_query_search_ids
Multi-query fusion search returning only ids and scores (no payloads).
prometheus_metrics
Prometheus text format metrics response.
query
Execute a VelesQL query.
readiness_check
Readiness probe — returns 200 when the database is fully loaded, 503 otherwise.
rebuild_index
Rebuilds the HNSW index of a vector collection, reclaiming memory occupied by tombstoned entries and producing a fresh graph from the current vector storage.
relate_points
Create a relation edge between two points in a collection.
remove_edge
Remove an edge by ID.
reorder_for_locality
Reorders the HNSW adjacency lists and vector storage for cache locality so nodes traversed together during search sit close in memory (issue #377). No-op for collections with fewer than 1 000 vectors. Recall is preserved — only the physical layout changes.
scroll_points
Scroll through collection points with cursor-based pagination.
search
Search for similar vectors.
search_ids
Lightweight search returning only IDs and scores (no payload hydration).
set_point_ttl
Set (or refresh) the durable TTL of a point.
stream_insert
Stream-insert a single point via the bounded ingestion channel.
stream_traverse
Stream graph traversal results via SSE.
stream_upsert_points
Stream upsert points using NDJSON.
text_search
Search using BM25 full-text search.
traverse_graph
Traverse the graph using BFS or DFS from a source node.
traverse_parallel
Parallel multi-source BFS traversal.
unrelate_points
Remove a relation edge by ID.
update_guardrails
Update guard-rails configuration (partial update).
upsert_node_payload
Upsert a payload on a graph node.
upsert_points
Upsert points to a collection.
upsert_points_raw
Bulk upsert points via the binary wire format.
vacuum_collection
Vacuums the HNSW index of a vector collection, removing tombstoned entries and rebuilding the graph from current vectors.