mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 05:43:58 +00:00
Implements GNN performance optimizations as outlined in issue #22: ## New Features ### GNN Cache System (gnn_cache.rs) - LRU-based layer caching eliminates ~2.5s initialization overhead - Query result caching with configurable TTL (default 5 minutes) - Batch operation support for amortized costs - Preloading of common layer configurations - Cache statistics tracking (hit rates, evictions) ### New MCP Tools (handlers.rs) - gnn_layer_create: Create/cache GNN layers (~5-10ms vs ~2.5s) - gnn_forward: Forward pass through cached layers - gnn_batch_forward: Batch operations with result caching - gnn_cache_stats: Monitor cache hit rates and performance - gnn_compress: Adaptive tensor compression by access frequency - gnn_decompress: Tensor decompression - gnn_search: Differentiable search with soft attention ### Protocol Extensions (protocol.rs) - GnnLayerCreateParams, GnnForwardParams - GnnBatchForwardParams with LayerConfig - GnnCompressParams, GnnDecompressParams - GnnSearchParams for differentiable search ## Performance Results (from tests) - Layer caching: 14.8x faster (demonstrated in debug builds) - Expected production improvement: 250-500x - Batch operations: Amortized initialization overhead ## Files Changed - crates/ruvector-cli/src/mcp/gnn_cache.rs (new) - crates/ruvector-cli/src/mcp/handlers.rs (extended) - crates/ruvector-cli/src/mcp/protocol.rs (extended) - crates/ruvector-cli/tests/gnn_performance_test.rs (new) Closes partial implementation for #22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
1.7 KiB
TOML
80 lines
1.7 KiB
TOML
[package]
|
|
name = "ruvector-cli"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
repository.workspace = true
|
|
readme = "README.md"
|
|
description = "CLI and MCP server for Ruvector"
|
|
|
|
[[bin]]
|
|
name = "ruvector"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "ruvector-mcp"
|
|
path = "src/mcp_server.rs"
|
|
|
|
[dependencies]
|
|
ruvector-core = { version = "0.1.2", path = "../ruvector-core" }
|
|
ruvector-graph = { version = "0.1.0", path = "../ruvector-graph", features = ["storage"] }
|
|
ruvector-gnn = { version = "0.1.0", path = "../ruvector-gnn" }
|
|
|
|
# LRU cache for performance optimization
|
|
lru = "0.12"
|
|
|
|
# CLI
|
|
clap = { workspace = true }
|
|
indicatif = { workspace = true }
|
|
console = { workspace = true }
|
|
|
|
# Async
|
|
tokio = { workspace = true }
|
|
futures = { workspace = true }
|
|
|
|
# Error handling
|
|
thiserror = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
|
|
# Serialization
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
|
|
# Configuration
|
|
toml = "0.8"
|
|
|
|
# Data formats
|
|
csv = "1.3"
|
|
ndarray-npy = "0.9"
|
|
ndarray = { workspace = true }
|
|
|
|
# Terminal colors
|
|
colored = "2.1"
|
|
prettytable-rs = "0.10"
|
|
|
|
# HTTP for MCP SSE transport
|
|
hyper = { version = "1.5", features = ["full"] }
|
|
hyper-util = { version = "0.1", features = ["full"] }
|
|
http-body-util = "0.1"
|
|
|
|
# MCP support
|
|
async-trait = "0.1"
|
|
tower = "0.5"
|
|
axum = { version = "0.7", features = ["ws"] }
|
|
tower-http = { version = "0.6", features = ["cors", "trace"] }
|
|
async-stream = "0.3"
|
|
|
|
# Additional utilities
|
|
uuid = { version = "1.11", features = ["v4"] }
|
|
chrono = "0.4"
|
|
shellexpand = "3.1"
|
|
rand = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
assert_cmd = "2.0"
|
|
predicates = "3.1"
|
|
tempfile = "3.13"
|