OxiRS Vec - Vector Search Engine
Status: v0.3.2 - Released 2026-07-12
✨ Production Release: Production-ready with API stability guarantees and comprehensive testing (1,754 tests passing).
High-performance vector search infrastructure for semantic similarity search in RDF knowledge graphs.
Features
Vector Indexing
- HNSW Index - Hierarchical Navigable Small World graphs for fast approximate nearest neighbor search
- Flat Index - Exact search for smaller datasets
- IVF Index - Inverted file index for large-scale datasets
- Dynamic Updates - Real-time index updates without full rebuilds
- Real-Time Embedding Pipeline - Streaming embedding updates with configurable consistency, per-ID version history, and live health/alerting monitoring (see Real-Time Embedding Pipeline below)
Search Capabilities
- Similarity Search - Find semantically similar entities
- Filtered Search - Combine vector similarity with RDF constraints
- Batch Operations - Efficient bulk indexing and search
- Multiple Distance Metrics - Cosine, Euclidean, Manhattan, Dot product
Integration
- SPARQL Extension - Vector search functions in SPARQL queries
- GraphQL Support - Vector similarity in GraphQL queries
- Embedding Models - Integration with various embedding providers
- Storage Backends - Persistent vector indices
Installation
Add to your Cargo.toml:
# Experimental feature
[]
= "0.3.2"
Quick Start
Basic Vector Search
use ;
async
SPARQL Integration
use VectorFunctions;
let sparql = r#"
PREFIX vec: <http://oxirs.org/vec/>
SELECT ?entity ?score WHERE {
?entity a foaf:Person .
# Vector similarity search
?entity vec:similarTo "machine learning researcher" .
?entity vec:similarity ?score .
FILTER (?score > 0.8)
}
ORDER BY DESC(?score)
LIMIT 10
"#;
Architecture
Index Types
HNSW (Hierarchical Navigable Small World)
- Use Case: General purpose, balanced performance
- Search Time: O(log N)
- Build Time: O(N log N)
- Memory: Moderate
Flat Index
- Use Case: Small datasets, exact search required
- Search Time: O(N)
- Build Time: O(N)
- Memory: Low
IVF (Inverted File)
- Use Case: Large datasets, acceptable approximate results
- Search Time: O(√N)
- Build Time: O(N)
- Memory: Moderate
Distance Metrics
Advanced Features
Filtered Search
Combine vector similarity with RDF constraints:
use FilteredSearch;
let filters = builder
.add_constraint
.add_constraint
.build;
let results = store.filtered_search?;
Batch Operations
Efficient bulk indexing:
let batch = vec!;
store.add_batch?;
store.build_index?;
Incremental Updates
// Add without full rebuild
store.add_incremental?;
// Periodic optimization
store.optimize_index?;
Performance
Benchmarks (on sample datasets)
| Dataset Size | Index Type | Build Time | Query Time (10-NN) |
|---|---|---|---|
| 10K vectors | HNSW | 2.5s | 0.5ms |
| 100K vectors | HNSW | 28s | 1.2ms |
| 1M vectors | HNSW | 320s | 2.8ms |
| 10K vectors | Flat | 0.1s | 12ms |
| 100K vectors | IVF | 15s | 3.5ms |
Benchmarked on M1 Mac with 768-dimensional vectors
Configuration
let config = VectorStoreConfig ;
Integration Examples
With oxirs-embed
use EmbeddingModel;
use VectorStore;
// Generate embeddings
let model = load?;
let embedding = model.encode?;
// Index and search
let mut store = new?;
store.add_vector?;
With oxirs-core (RDF)
use Dataset;
use RdfVectorIndex;
let dataset = from_file?;
let mut index = new?;
// Index entities by their descriptions
for entity in dataset.subjects
Real-Time Embedding Pipeline
real_time_embedding_pipeline is a streaming embedding-update system for high-throughput,
low-latency workloads. It is organized into config, traits, types, pipeline,
streaming, coordination, monitoring, versioning, and consistency submodules,
all compiled in and wired live into RealTimeEmbeddingPipeline:
consistency-InconsistencyRepairEnginedetects and repairs embedding drift with severity-based repair strategiesversioning-VersionManagerkeeps a per-ID embedding version history with configurable retentionmonitoring-PipelinePerformanceMonitor/MetricsCollector/AlertManagerfor metrics collection, health checks, and severity-throttled alertingcoordination-UpdateCoordinatorsynchronizes concurrent update batches
use ;
let config = PipelineConfig ;
let runtime = new?;
runtime.block_on?;
# Ok::
Status
Production Release (v0.3.2)
- ✅ HNSW/IVF/Flat indices with persisted dataset support
- ✅ SPARQL/GraphQL integration enhanced with federation-aware vector filters
- ✅ CLI pipelines for batch embedding import/export and monitoring
- ✅ SciRS2 metrics for query latency, recall, and index health
- ✅ Real-time embedding pipeline with consistency repair, versioning, and monitoring submodules wired live (previously declared but commented out as unimplemented)
- ✅ GPU acceleration abstractions (Pure Rust, no-op by default); real NVIDIA CUDA acceleration is provided by the separate
oxirs-vec-adapter-cudacrate (publish = false), which quarantines thecuda-runtime-sysC FFI off this crate's Pure-Rust dependency surface per the COOLJAPAN Pure Rust Policy v2 — the formercuda/gpu-fullfeatures were removed - ✅ Distributed indexing - Raft-based replication and cross-datacenter sync (
distributedmodule)
Contributing
This is an experimental module. Feedback and contributions are welcome!
License
Apache-2.0
See Also
- oxirs-embed - Embedding generation
- oxirs-arq - SPARQL query engine
- oxirs-core - RDF data model