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
u64IDs as JSON strings. - tls
- TLS configuration and server support via rustls.
Structs§
- Actual
Stats Response - Actual execution statistics for EXPLAIN ANALYZE responses.
- Aggregation
Response - Response from
VelesQLaggregation query execution. - ApiDoc
- VelesDB API Documentation
- AppState
- Application state shared across handlers.
- Batch
Search Request - Request for batch vector search.
- Batch
Search Response - Response from batch search.
- Collection
Config Response - Response with detailed collection configuration.
- Collection
Diagnostics Response - Response with a collection’s health diagnostics.
- Collection
Response - Response with collection information.
- Collection
Stats Response - Response with collection statistics from ANALYZE.
- Column
Stats Response - Per-column statistics in a collection stats response.
- Create
Collection Request - Request to create a new collection.
- Create
Index Request - Request to create a property index.
- Degree
Response - Response for node degree query.
- Edge
Count Response - Response for edge count query.
- Enable
Streaming Request - Request body for the enable-streaming endpoint.
- Error
Response - Error response.
- Explain
Cost - Estimated cost metrics for the query.
- Explain
Features - Features detected in the query.
- Explain
Request - Request for query EXPLAIN.
- Explain
Response - Response from query EXPLAIN.
- Explain
Step - A step in the query execution plan.
- Fusion
Request - Fusion configuration for hybrid dense+sparse search.
- Graph
Search Request - Request for graph embedding search.
- Graph
Search Response - Response for graph embedding search.
- Guard
Rails Config Request - Request to configure query guard-rails.
- Guard
Rails Config Response - Response with current guard-rails configuration.
- Hybrid
Search Request - Request for hybrid search (vector + text).
- IdScore
Result - A single ID+score result from IDs-only search.
- Index
Response - Response with index information.
- Index
Stats Response - Per-index statistics in a collection stats response.
- List
Indexes Response - Response listing all indexes.
- Multi
Query Search Request - Request for multi-query vector search with fusion.
- Node
Edge Query Params - Query parameters for node-scoped edge queries.
- Node
List Response - Response containing all node IDs in the graph.
- Node
Payload Response - Response for a node payload retrieval.
- Node
Stats Response - Per-plan-node estimated execution statistics for EXPLAIN ANALYZE responses.
- Parallel
Traverse Request - Request for parallel multi-source BFS traversal.
- Point
Request - A point in an upsert request.
- Query
Error Detail VelesQLquery error detail.- Query
Error Response VelesQLquery error response.- Query
Request - Request for
VelesQLquery execution. - Query
Response - Response from
VelesQLquery execution. - Query
Response Meta - Metadata section for
VelesQLquery responses. - Scroll
Point - A single point in a scroll response.
- Scroll
Request - Request body for the scroll endpoint.
- Scroll
Response - Response from the scroll endpoint.
- Search
IdsResponse - Response from IDs-only search (no payload hydration).
- Search
Request - Request for vector search (dense, sparse, or hybrid).
- Search
Response - Response from vector search.
- Search
Result Response - A single search result.
- Stream
Done Event - SSE event: Traversal completed.
- Stream
Insert Request - Request body for the streaming insert endpoint (single point).
- Stream
Node Event - SSE event: A node reached during traversal.
- Stream
Stats Event - SSE event: Periodic statistics update.
- Stream
Traverse Params - Query parameters for streaming graph traversal.
- Text
Search Request - Request for BM25 text search.
- Traversal
Result Item - A single traversal result item.
- Traversal
Stats - Statistics from traversal operation.
- Traverse
Request - Request for graph traversal.
- Traverse
Response - Response from graph traversal.
- Unified
Query Response - Unified response from /query endpoint.
- Upsert
Node Payload Request - Request to upsert a node payload.
- Upsert
Points Request - Request to upsert points.
- Velesql
Error Detail - Standardized
VelesQLsemantic/runtime error detail. - Velesql
Error Response - Standardized
VelesQLsemantic/runtime error response.
Enums§
- Query
Type - Query type for unified /query endpoint.
- Sparse
Vector Input - Input format for sparse vectors, supporting two JSON representations:
Constants§
- VELESQL_
CONTRACT_ VERSION - Canonical
VelesQLcontract 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.