pub struct SonaEngine { /* private fields */ }Expand description
Main SONA engine integrating all components
Implementations§
Source§impl SonaEngine
impl SonaEngine
Sourcepub fn with_config(config: SonaConfig) -> Self
pub fn with_config(config: SonaConfig) -> Self
Create with custom config
Sourcepub fn begin_trajectory(&self, query_embedding: Vec<f32>) -> TrajectoryBuilder
pub fn begin_trajectory(&self, query_embedding: Vec<f32>) -> TrajectoryBuilder
Start trajectory recording for a query
Sourcepub fn end_trajectory(&self, builder: TrajectoryBuilder, quality: f32)
pub fn end_trajectory(&self, builder: TrajectoryBuilder, quality: f32)
Complete trajectory and submit for learning
Sourcepub fn submit_trajectory(&self, trajectory: QueryTrajectory)
pub fn submit_trajectory(&self, trajectory: QueryTrajectory)
Submit pre-built trajectory
Sourcepub fn apply_micro_lora(&self, input: &[f32], output: &mut [f32])
pub fn apply_micro_lora(&self, input: &[f32], output: &mut [f32])
Apply micro-LoRA to hidden states
Sourcepub fn apply_base_lora(
&self,
layer_idx: usize,
input: &[f32],
output: &mut [f32],
)
pub fn apply_base_lora( &self, layer_idx: usize, input: &[f32], output: &mut [f32], )
Apply base-LoRA to layer output
Sourcepub fn force_learn(&self) -> String
pub fn force_learn(&self) -> String
Force background learning cycle
Sourcepub fn find_patterns(
&self,
query_embedding: &[f32],
k: usize,
) -> Vec<LearnedPattern>
pub fn find_patterns( &self, query_embedding: &[f32], k: usize, ) -> Vec<LearnedPattern>
Find similar patterns to query
Sourcepub fn stats(&self) -> CoordinatorStats
pub fn stats(&self) -> CoordinatorStats
Get engine statistics
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable/disable engine
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if enabled
Sourcepub fn config(&self) -> &SonaConfig
pub fn config(&self) -> &SonaConfig
Get config
Sourcepub fn get_all_patterns(&self) -> Vec<LearnedPattern>
pub fn get_all_patterns(&self) -> Vec<LearnedPattern>
Get all learned patterns from ReasoningBank
Sourcepub fn export_lora_state(&self) -> LoRAState
pub fn export_lora_state(&self) -> LoRAState
Export LoRA state for SafeTensors serialization
Sourcepub fn get_quality_trajectories(&self) -> Vec<QualityTrajectory>
pub fn get_quality_trajectories(&self) -> Vec<QualityTrajectory>
Get quality trajectories for preference learning export
Sourcepub fn get_routing_decisions(&self) -> Vec<RoutingDecision>
pub fn get_routing_decisions(&self) -> Vec<RoutingDecision>
Get routing decisions for distillation export
Auto Trait Implementations§
impl !Freeze for SonaEngine
impl !RefUnwindSafe for SonaEngine
impl Send for SonaEngine
impl Sync for SonaEngine
impl Unpin for SonaEngine
impl !UnwindSafe for SonaEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more