Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55d7dbb

Browse files
committed
docs: optimize 12 crate READMEs and add SONA learning loop diagram
Standardize all linked crate READMEs to match root README style: plain-language taglines, comparison tables, key features tables. Add SONA feedback loop diagram to root README intro. Crates updated: ruvector-gnn, ruvector-core, ruvector-graph, ruvector-graph-transformer, sona, ruvector-attention, ruvllm, ruvector-solver, ruvector-replication, ruvector-postgres, rvf-crypto, examples/dna. Co-Authored-By: claude-flow <[email protected]>
1 parent 59c0999 commit 55d7dbb

13 files changed

Lines changed: 504 additions & 542 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ npx ruvector
1616

1717
Most vector databases store your data and search it — the same way, every time. RuVector is fundamentally different. It watches how you use it and gets smarter: search results improve automatically, the system tunes itself to your workload, and it runs AI models right on your hardware — no cloud APIs, no per-query bills. It drops into PostgreSQL, runs in browsers, and ships as a single file. Open source. Free forever.
1818

19+
```
20+
User Query → [SONA Engine] → Model Response → User Feedback
21+
↑ │
22+
└─────── Learning Signal ─────────┘
23+
(< 1ms adaptation)
24+
```
25+
1926
| | RuVector | Typical Vector DB |
2027
|---|---|---|
2128
| **Self-Learning & Optimization** | | |

crates/ruvector-attention/README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
# ruvector-attention
22

3-
Advanced attention mechanisms for vector search and geometric AI, implementing 7 mathematical theories for transformer attention.
4-
53
[![Crates.io](https://img.shields.io/crates/v/ruvector-attention.svg)](https://crates.io/crates/ruvector-attention)
64
[![Documentation](https://docs.rs/ruvector-attention/badge.svg)](https://docs.rs/ruvector-attention)
75
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE)
86
[![Tests](https://img.shields.io/badge/tests-142%20passing-brightgreen.svg)]()
97

10-
## Overview
11-
12-
`ruvector-attention` provides production-ready implementations of advanced attention mechanisms based on mathematical foundations from differential geometry, information theory, and optimal transport. The library combines theoretical rigor with practical optimizations including SIMD acceleration, caching, and quantization.
8+
**46 attention mechanisms grounded in 7 mathematical theories -- from Flash Attention to optimal transport -- in one crate.**
139

14-
## Features
10+
```bash
11+
cargo add ruvector-attention
12+
```
1513

16-
- 🚀 **High-Performance**: SIMD-accelerated with 4-way unrolled accumulators
17-
- 🎯 **Ergonomic API**: Fluent builder pattern and preset configurations
18-
- 📦 **Modular Design**: Mix and match attention mechanisms
19-
- 🔧 **Flexible**: Support for standard, sparse, graph, and geometric attention
20-
- 🧠 **7 Mathematical Theories**: Optimal Transport, Mixed Curvature, Topology, Information Geometry, Information Bottleneck, PDE/Diffusion, and Unified Diagnostics
21-
- 📊 **Unified Reporting**: Health monitoring and automatic attention mode selection
22-
- 🔢 **Quantization-Friendly**: Component-wise precision control (8-bit Euclidean, 5-bit Hyperbolic/Spherical)
14+
Attention is the core operation in transformers, vector search, and graph neural networks, but most libraries give you one or two flavors and call it done. `ruvector-attention` ships 46 mechanisms spanning standard dot-product, sparse (Flash, linear, local-global), geometric (hyperbolic, mixed-curvature), graph (GAT, RoPE), and mixture-of-experts -- all SIMD-accelerated with quantization support. Pick the right attention for your data shape instead of forcing everything through softmax(QK^T/sqrt(d))V.
15+
16+
| | ruvector-attention | PyTorch `nn.MultiheadAttention` | FlashAttention (standalone) | xFormers |
17+
|---|---|---|---|---|
18+
| **Mechanism count** | 46 | 1 (scaled dot-product) | 1 (Flash) | ~5 |
19+
| **Geometric attention** | Hyperbolic, spherical, mixed-curvature | No | No | No |
20+
| **Graph attention** | Edge-featured GAT, RoPE for graphs | No | No | Limited |
21+
| **Optimal transport** | Sliced Wasserstein, centroid OT | No | No | No |
22+
| **Topology-gated** | Coherence-based mode switching | No | No | No |
23+
| **Quantization** | Per-component (8-bit E, 5-bit H/S) | Via separate tools | No | Limited |
24+
| **Language** | Rust (with WASM target) | Python/C++ | CUDA only | Python/CUDA |
25+
| **SIMD acceleration** | Built in (4-way unrolled) | Via backend | CUDA only | Via backend |
26+
27+
| Feature | What It Does | Why It Matters |
28+
|---------|-------------|----------------|
29+
| **Flash Attention** | O(n) memory tiled computation | Process long sequences without running out of memory |
30+
| **Mixed Curvature Fusion** | Combines Euclidean, hyperbolic, and spherical spaces in one pass | Model hierarchies, clusters, and flat data simultaneously |
31+
| **Optimal Transport Attention** | Uses Wasserstein distance instead of dot-product similarity | Better distribution matching for retrieval and generation |
32+
| **Topology-Gated Switching** | Automatically picks attention mode based on local coherence | Self-adapts to data characteristics without manual tuning |
33+
| **Information Bottleneck** | Compresses attention via KL minimization | Keeps only the signal, discards noise |
34+
| **PDE/Diffusion Attention** | Runs heat equation on a similarity graph | Smooth, noise-robust attention for irregular data |
35+
| **Unified Diagnostics** | Health monitoring and automatic mode selection across all 7 theories | One report tells you which attention works best for your data |
36+
37+
> Part of the [RuVector](https://github.com/ruvnet/ruvector) ecosystem -- the self-learning vector database with graph intelligence.
2338
2439
## Supported Attention Mechanisms
2540

crates/ruvector-core/README.md

Lines changed: 56 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,23 @@
55
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
66
[![Rust](https://img.shields.io/badge/rust-1.77%2B-orange.svg)](https://www.rust-lang.org)
77

8-
**High-performance Rust vector database engine with HNSW indexing, quantization, and SIMD optimizations.**
8+
**The pure-Rust vector database engine behind RuVector -- HNSW indexing, quantization, and SIMD acceleration in a single crate.**
99

10-
`ruvector-core` is the foundational Rust library powering [Ruvector](https://github.com/ruvnet/ruvector)—a next-generation vector database built for extreme performance and universal deployment. This crate provides the core vector database engine with state-of-the-art algorithms optimized for modern hardware.
10+
`ruvector-core` is the foundational library that powers the entire [RuVector](https://github.com/ruvnet/ruvector) ecosystem. It gives you a production-grade vector database you can embed directly into any Rust application: insert vectors, search them in under a millisecond, filter by metadata, and compress storage up to 32x -- all without external services. If you need vector search as a library instead of a server, this is the crate.
1111

12-
## 🌟 Why Ruvector Core?
12+
| | ruvector-core | Typical Vector Database |
13+
|---|---|---|
14+
| **Deployment** | Embed as a Rust dependency -- no server, no network calls | Run a separate service, manage connections |
15+
| **Query latency** | <0.5 ms p50 at 1M vectors with HNSW | ~1-5 ms depending on network and index |
16+
| **Memory compression** | Scalar (4x), Product (8-32x), Binary (32x) quantization built in | Often requires paid tiers or external tools |
17+
| **SIMD acceleration** | SimSIMD hardware-optimized distance calculations, automatic | Manual tuning or not available |
18+
| **Search modes** | Dense vectors, sparse BM25, hybrid, MMR diversity, filtered -- all in one API | Typically dense-only; hybrid and filtering are add-ons |
19+
| **Storage** | Zero-copy mmap with `redb` -- instant loading, no deserialization | Load time scales with dataset size |
20+
| **Concurrency** | Lock-free indexing with parallel batch processing via Rayon | Varies; many require single-writer locks |
21+
| **Dependencies** | Minimal -- pure Rust, compiles anywhere `rustc` runs | Often depends on C/C++ libraries (BLAS, LAPACK) |
22+
| **Cost** | Free forever -- open source (MIT) | Per-vector or per-query pricing on managed tiers |
1323

14-
-**Blazing Fast**: <0.5ms p50 query latency with HNSW indexing
15-
- 🧠 **Memory Efficient**: 4-32x compression via quantization techniques
16-
- 🎯 **High Accuracy**: 95%+ recall with HNSW + Product Quantization
17-
- 🚀 **SIMD Accelerated**: Hardware-optimized distance calculations using SimSIMD
18-
- 🔧 **Zero Dependencies**: Minimal external dependencies, pure Rust implementation
19-
- 📦 **Production Ready**: Battle-tested algorithms with comprehensive benchmarks
20-
21-
## 🚀 Features
22-
23-
### Core Capabilities
24-
25-
- **HNSW Indexing**: Hierarchical Navigable Small World graphs for O(log n) approximate nearest neighbor search
26-
- **Multiple Distance Metrics**: Euclidean, Cosine, Dot Product, Manhattan
27-
- **Advanced Quantization**: Scalar (4x), Product (8-32x), and Binary (32x) quantization
28-
- **SIMD Optimizations**: Hardware-accelerated distance calculations via `simsimd`
29-
- **Zero-Copy I/O**: Memory-mapped storage for instant loading
30-
- **Concurrent Operations**: Lock-free data structures and parallel batch processing
31-
- **Flexible Storage**: Persistent storage with `redb` and memory-mapped files
32-
33-
### Advanced Features
34-
35-
- **Hybrid Search**: Combine dense vector search with sparse BM25 text search
36-
- **Filtered Search**: Apply metadata filters during vector search
37-
- **MMR Diversification**: Maximal Marginal Relevance for diverse result sets
38-
- **Conformal Prediction**: Uncertainty quantification for search results
39-
- **Product Quantization**: Memory-efficient vector compression with high accuracy
40-
- **Cache Optimization**: Multi-level caching for improved performance
41-
- **Lock-Free Indexing**: High-concurrency operations without blocking
42-
43-
## 📦 Installation
24+
## Installation
4425

4526
Add `ruvector-core` to your `Cargo.toml`:
4627

@@ -60,7 +41,25 @@ Available features:
6041
- `simd` (default): Enable SIMD-optimized distance calculations
6142
- `uuid-support` (default): Enable UUID generation for vector IDs
6243

63-
## ⚡ Quick Start
44+
## Key Features
45+
46+
| Feature | What It Does | Why It Matters |
47+
|---------|-------------|----------------|
48+
| **HNSW Indexing** | Hierarchical Navigable Small World graphs for O(log n) approximate nearest neighbor search | Sub-millisecond queries at million-vector scale |
49+
| **Multiple Distance Metrics** | Euclidean, Cosine, Dot Product, Manhattan | Match the metric to your embedding model without conversion |
50+
| **Scalar Quantization** | Compress vectors to 8-bit integers (4x reduction) | Cut memory by 75% with 98% recall preserved |
51+
| **Product Quantization** | Split vectors into subspaces with codebooks (8-32x reduction) | Store millions of vectors on a single machine |
52+
| **Binary Quantization** | 1-bit representation (32x reduction) | Ultra-fast screening pass for massive datasets |
53+
| **SIMD Distance** | Hardware-accelerated distance via SimSIMD | Up to 80K QPS on 8 cores without code changes |
54+
| **Zero-Copy I/O** | Memory-mapped storage loads instantly | No deserialization step -- open a file and search immediately |
55+
| **Hybrid Search** | Combine dense vector similarity with sparse BM25 text scoring | One query handles both semantic and keyword matching |
56+
| **Metadata Filtering** | Apply key-value filters during search | No post-filtering needed -- results are already filtered |
57+
| **MMR Diversification** | Maximal Marginal Relevance re-ranking | Avoid redundant results when top-K are too similar |
58+
| **Conformal Prediction** | Uncertainty quantification on search results | Know when to trust (or distrust) a match |
59+
| **Lock-Free Indexing** | Concurrent reads and writes without blocking | High-throughput ingestion while serving queries |
60+
| **Batch Processing** | Parallel insert and search via Rayon | Saturate all cores for bulk operations |
61+
62+
## Quick Start
6463

6564
### Basic Usage
6665

@@ -195,7 +194,7 @@ options.quantization = Some(QuantizationConfig::Product {
195194
let db = VectorDB::new(options)?;
196195
```
197196

198-
## 📊 API Overview
197+
## API Overview
199198

200199
### Core Types
201200

@@ -300,13 +299,13 @@ let mmr = MMRSearch::new(MMRConfig {
300299
});
301300
```
302301

303-
## 🎯 Performance Characteristics
302+
## Performance
304303

305304
### Latency (Single Query)
306305

307306
```
308307
Operation Flat Index HNSW Index
309-
─────────────────────────────────────────────
308+
---------------------------------------------
310309
Search (1K vecs) ~0.1ms ~0.2ms
311310
Search (100K vecs) ~10ms ~0.5ms
312311
Search (1M vecs) ~100ms <1ms
@@ -318,7 +317,7 @@ Batch (1000) ~50ms ~500ms
318317

319318
```
320319
Configuration Memory Recall
321-
─────────────────────────────────────────────
320+
---------------------------------------------
322321
Full Precision (f32) ~1.5GB 100%
323322
Scalar Quantization ~400MB 98%
324323
Product Quantization ~200MB 95%
@@ -329,14 +328,14 @@ Binary Quantization ~50MB 85%
329328

330329
```
331330
Configuration QPS Latency (p50)
332-
─────────────────────────────────────────────────
331+
-----------------------------------------------------
333332
Single Thread ~2,000 ~0.5ms
334333
Multi-Thread (8 cores) ~50,000 <0.5ms
335334
With SIMD ~80,000 <0.3ms
336335
With Quantization ~100,000 <0.2ms
337336
```
338337

339-
## 🔧 Configuration Guide
338+
## Configuration Guide
340339

341340
### For Maximum Accuracy
342341

@@ -378,7 +377,7 @@ let options = DbOptions {
378377
let options = DbOptions::default(); // Recommended defaults
379378
```
380379

381-
## 🔨 Building and Testing
380+
## Building and Testing
382381

383382
### Build
384383

@@ -426,68 +425,26 @@ Available benchmarks:
426425
- `batch_operations` - Batch insert/search operations
427426
- `comprehensive_bench` - Full system benchmarks
428427

429-
## 📚 Documentation
430-
431-
### Complete Ruvector Documentation
432-
433-
This crate is part of the larger Ruvector project:
434-
435-
- **[Main README](../../README.md)** - Complete project overview
436-
- **[Getting Started Guide](../../docs/guide/GETTING_STARTED.md)** - Quick start tutorial
437-
- **[Rust API Reference](../../docs/api/RUST_API.md)** - Detailed API documentation
438-
- **[Advanced Features Guide](../../docs/guide/ADVANCED_FEATURES.md)** - Quantization, indexing, tuning
439-
- **[Performance Tuning](../../docs/optimization/PERFORMANCE_TUNING_GUIDE.md)** - Optimization strategies
440-
- **[Benchmarking Guide](../../docs/benchmarks/BENCHMARKING_GUIDE.md)** - Running benchmarks
441-
442-
### API Documentation
443-
444-
Generate and view the full API documentation:
445-
446-
```bash
447-
cargo doc --open --no-deps
448-
```
449-
450-
## 🌐 Related Crates
428+
## Related Crates
451429

452430
`ruvector-core` is the foundation for platform-specific bindings:
453431

454432
- **[ruvector-node](../ruvector-node/)** - Node.js bindings via NAPI-RS
455433
- **[ruvector-wasm](../ruvector-wasm/)** - WebAssembly bindings for browsers
434+
- **[ruvector-gnn](../ruvector-gnn/)** - Graph Neural Network layer for learned search
456435
- **[ruvector-cli](../ruvector-cli/)** - Command-line interface
457436
- **[ruvector-bench](../ruvector-bench/)** - Performance benchmarks
458437

459-
## 🤝 Contributing
460-
461-
We welcome contributions! See the main [Contributing Guidelines](../../docs/development/CONTRIBUTING.md) for details.
462-
463-
### Areas for Contribution
464-
465-
- 🐛 Bug fixes and stability improvements
466-
- ✨ New distance metrics or quantization techniques
467-
- 📈 Performance optimizations
468-
- 🧪 Additional test coverage
469-
- 📝 Documentation and examples
470-
471-
## 📊 Comparison
472-
473-
**Why Ruvector Core vs. Alternatives?**
474-
475-
| Feature | Ruvector Core | hnswlib-rs | faiss-rs | qdrant |
476-
|---------|---------------|------------|----------|--------|
477-
| **Pure Rust** ||| ❌ (C++) ||
478-
| **SIMD** | ✅ SimSIMD ||||
479-
| **Quantization** | ✅ Multiple ||||
480-
| **Zero-Copy I/O** |||||
481-
| **Metadata Filter** |||||
482-
| **Hybrid Search** |||||
483-
| **P50 Latency** | <0.5ms | ~1ms | ~0.5ms | ~1ms |
484-
| **Dependencies** | Minimal | Minimal | Heavy | Heavy |
485-
486-
## 📜 License
438+
## Documentation
487439

488-
**MIT License** - see [LICENSE](../../LICENSE) for details.
440+
- **[Main README](../../README.md)** - Complete project overview
441+
- **[Getting Started Guide](../../docs/guide/GETTING_STARTED.md)** - Quick start tutorial
442+
- **[Rust API Reference](../../docs/api/RUST_API.md)** - Detailed API documentation
443+
- **[Advanced Features Guide](../../docs/guide/ADVANCED_FEATURES.md)** - Quantization, indexing, tuning
444+
- **[Performance Tuning](../../docs/optimization/PERFORMANCE_TUNING_GUIDE.md)** - Optimization strategies
445+
- **[API Documentation](https://docs.rs/ruvector-core)** - Full API reference on docs.rs
489446

490-
## 🙏 Acknowledgments
447+
## Acknowledgments
491448

492449
Built with state-of-the-art algorithms and libraries:
493450

@@ -497,15 +454,18 @@ Built with state-of-the-art algorithms and libraries:
497454
- **[rayon](https://crates.io/crates/rayon)** - Data parallelism
498455
- **[memmap2](https://crates.io/crates/memmap2)** - Memory-mapped files
499456

457+
## License
458+
459+
**MIT License** - see [LICENSE](../../LICENSE) for details.
460+
500461
---
501462

502463
<div align="center">
503464

504-
**Part of [Ruvector](https://github.com/ruvnet/ruvector) Built by [rUv](https://ruv.io)**
465+
**Part of [RuVector](https://github.com/ruvnet/ruvector) - Built by [rUv](https://ruv.io)**
505466

506467
[![Star on GitHub](https://img.shields.io/github/stars/ruvnet/ruvector?style=social)](https://github.com/ruvnet/ruvector)
507-
[![Follow @ruvnet](https://img.shields.io/twitter/follow/ruvnet?style=social)](https://twitter.com/ruvnet)
508468

509-
[Documentation](https://docs.rs/ruvector-core) [Crates.io](https://crates.io/crates/ruvector-core) [GitHub](https://github.com/ruvnet/ruvector)
469+
[Documentation](https://docs.rs/ruvector-core) | [Crates.io](https://crates.io/crates/ruvector-core) | [GitHub](https://github.com/ruvnet/ruvector)
510470

511471
</div>

0 commit comments

Comments
 (0)