Skip to main content

ruvector_memopt/
lib.rs

1//! RuVector Memory Optimizer
2//!
3//! An intelligent cross-platform memory optimizer that leverages RuVector neural
4//! capabilities for smart optimization decisions.
5//!
6//! ## Platforms
7//!
8//! - **Windows**: Full optimization via Win32 APIs
9//! - **macOS**: Memory pressure hints, purge command, Apple Silicon support
10//!
11//! ## Features
12//!
13//! - **Neural Decision Engine**: GNN-based learning for optimal timing
14//! - **Pattern Recognition**: HNSW-indexed patterns for fast lookup
15//! - **Adaptive Strategy**: MinCut control for mode switching
16//! - **Anti-Forgetting**: EWC prevents losing good strategies
17//! - **Real-time Monitoring**: Live metrics dashboard
18//! - **System Tray/Menu Bar**: Background optimization
19//! - **Security**: Privilege management and input validation
20//!
21//! ## Safety
22//!
23//! - Protected process list prevents system instability
24//! - Memory floor ensures minimum available RAM
25//! - Rate limiting prevents over-optimization
26//! - Dry-run mode for testing
27
28pub mod core;
29pub mod neural;
30pub mod bench;
31pub mod monitor;
32pub mod security;
33pub mod algorithms;
34pub mod dashboard;
35pub mod accel;
36pub mod platform;
37
38// Platform-specific modules
39#[cfg(target_os = "windows")]
40pub mod windows;
41#[cfg(target_os = "windows")]
42pub mod tray;
43#[cfg(target_os = "windows")]
44pub mod browser;
45
46#[cfg(target_os = "macos")]
47pub mod macos;
48
49// Application-specific optimization (cross-platform)
50pub mod apps;
51
52// Re-exports - Core
53pub use core::config::OptimizerConfig;
54#[cfg(target_os = "windows")]
55pub use core::optimizer::IntelligentOptimizer;
56#[cfg(target_os = "windows")]
57pub use neural::engine::NeuralDecisionEngine;
58#[cfg(target_os = "windows")]
59pub use monitor::realtime::RealtimeMonitor;
60pub use algorithms::{MinCutClusterer, ProcessPageRank, CountMinSketch, SpectralAnalyzer};
61pub use bench::{AdvancedBenchmarkRunner, BenchmarkSuite};
62pub use dashboard::DashboardData;
63#[cfg(target_os = "windows")]
64pub use dashboard::DashboardServer;
65
66// Platform-specific re-exports
67#[cfg(target_os = "windows")]
68pub use windows::safety::{SafetyConfig, SafetyGuard};
69#[cfg(target_os = "windows")]
70pub use security::privileges::PrivilegeManager;
71
72#[cfg(target_os = "macos")]
73pub use macos::safety::{SafetyConfig, SafetyGuard};
74
75// App-specific optimization re-exports
76pub use apps::{
77    BrowserOptimizer, ElectronManager, DockerManager, LeakDetector, SmartSuggestions,
78    AppCategory, AppInfo, OptimizationAction, OptimizationResult,
79};
80
81// AI Mode - optional GPU/VRAM management and AI workload optimization
82#[cfg(feature = "ai")]
83pub mod ai;