Widget Intelligence
A Rust library for intelligent widget suggestion and learning based on user behavior patterns.
Used in production https://neverenginelabs.com/products/nel-vcs-player
Features
- Simple API: Register widgets with Label, EventId, and values, then get suggestions
- Smart Suggestions: Query by EventID or Label to get suggested values based on training
- Persistent Storage: Sled-based database for long-term learning
- Pure Rust: Pure Rust library without UI framework dependencies
Installation
Add this to your Cargo.toml
:
[]
= "0.1"
Usage
Simplified Use Case
The Widget Intelligence system has been simplified to focus on the following use case:
- Register widgets with Label, EventId, and a vector of values
- Query for suggested values by EventId or Label
use *;
// Create a new suggestion engine
let mut engine = new;
// Register a widget with Label, EventId, and values
let widget = simplified;
engine.store_widget;
// Add more values to an existing widget
let widget_update = simplified;
engine.store_widget;
// Query for a suggested value by EventId
let suggestions = engine.get_suggestions_by_event_id;
if let Some = suggestions.first
// Query for a suggested value by Label
let query_widget = simplified;
let suggestions = engine.get_suggestions;
if let Some = suggestions.first
Persistent Storage
For persistent storage, use the PersistentWidgetSuggestionEngine
:
// Initialize with a database path
let mut system = init_intelligence_system?;
// Register widgets and get suggestions as above
let widget = simplified;
system.store_widget?;
// Flush changes to disk
system.flush?;