mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-27 00:25:10 +00:00
Implements a complete Compress-Sense-Expand architecture as standalone example: - **Compress Layer**: Binary tensor storage with 4 compression strategies - None (1x), Float16 (2x), Int8 (4x), Binary (32x) - **Sense Layer**: Policy network for COMPRESS/EXPAND routing decisions - ThresholdPolicy (~2μs), LinearPolicy (~5μs), MLPPolicy (~15μs) - **Expand Layer**: Dimension projection with LLM registry - Supports LLaMA, GPT-4, Claude, Mistral, Phi-3 - **RefragStore**: Hybrid search returning mixed tensor/text results This example demonstrates REFRAG concepts (arXiv:2509.01092) without modifying ruvector-core, serving as proof-of-concept for Issue #10. Includes: - 25 passing unit tests - Interactive demo (cargo run --bin refrag-demo) - Performance benchmarks (cargo run --bin refrag-benchmark) - Criterion benchmarks for CI integration Refs: #10, #22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.1 KiB
TOML
50 lines
1.1 KiB
TOML
[package]
|
|
name = "refrag-pipeline-example"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "REFRAG Pipeline Example - Compress-Sense-Expand for 30x RAG latency reduction"
|
|
license = "MIT"
|
|
publish = false
|
|
|
|
[[bin]]
|
|
name = "refrag-demo"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "refrag-benchmark"
|
|
path = "src/benchmark.rs"
|
|
|
|
[dependencies]
|
|
# RuVector core for vector storage
|
|
ruvector-core = { path = "../../crates/ruvector-core" }
|
|
|
|
# Serialization
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
bincode = { version = "2.0.0-rc.3", features = ["serde"] }
|
|
base64 = "0.22"
|
|
|
|
# Math and numerics
|
|
ndarray = { version = "0.16", features = ["serde"] }
|
|
rand = "0.8"
|
|
rand_distr = "0.4"
|
|
|
|
# Async runtime
|
|
tokio = { version = "1.41", features = ["rt-multi-thread", "macros", "time"] }
|
|
|
|
# Error handling
|
|
thiserror = "2.0"
|
|
anyhow = "1.0"
|
|
|
|
# Utilities
|
|
uuid = { version = "1.11", features = ["v4"] }
|
|
chrono = "0.4"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
[dev-dependencies]
|
|
criterion = { version = "0.5", features = ["html_reports"] }
|
|
|
|
[[bench]]
|
|
name = "refrag_bench"
|
|
harness = false
|