mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-24 22:15:18 +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> |
||
|---|---|---|
| .. | ||
| cli_tests.rs | ||
| gnn_performance_test.rs | ||
| mcp_tests.rs | ||