SonaEngine

Struct SonaEngine 

Source
pub struct SonaEngine { /* private fields */ }
Expand description

Main SONA engine integrating all components

Implementations§

Source§

impl SonaEngine

Source

pub fn new(hidden_dim: usize) -> Self

Create new SONA engine with default config

Source

pub fn with_config(config: SonaConfig) -> Self

Create with custom config

Source

pub fn begin_trajectory(&self, query_embedding: Vec<f32>) -> TrajectoryBuilder

Start trajectory recording for a query

Source

pub fn end_trajectory(&self, builder: TrajectoryBuilder, quality: f32)

Complete trajectory and submit for learning

Source

pub fn submit_trajectory(&self, trajectory: QueryTrajectory)

Submit pre-built trajectory

Source

pub fn apply_micro_lora(&self, input: &[f32], output: &mut [f32])

Apply micro-LoRA to hidden states

Source

pub fn apply_base_lora( &self, layer_idx: usize, input: &[f32], output: &mut [f32], )

Apply base-LoRA to layer output

Source

pub fn tick(&self) -> Option<String>

Run background learning cycle if due

Source

pub fn force_learn(&self) -> String

Force background learning cycle

Source

pub fn flush(&self)

Flush instant loop updates

Source

pub fn find_patterns( &self, query_embedding: &[f32], k: usize, ) -> Vec<LearnedPattern>

Find similar patterns to query

Source

pub fn stats(&self) -> CoordinatorStats

Get engine statistics

Source

pub fn set_enabled(&mut self, enabled: bool)

Enable/disable engine

Source

pub fn is_enabled(&self) -> bool

Check if enabled

Source

pub fn config(&self) -> &SonaConfig

Get config

Source

pub fn get_all_patterns(&self) -> Vec<LearnedPattern>

Get all learned patterns from the reasoning bank

Source

pub fn export_lora_state(&self) -> LoRAState

Export LoRA state for serialization

Source

pub fn get_quality_trajectories(&self) -> Vec<QualityTrajectory>

Get quality trajectories for preference learning export

Source

pub fn get_routing_decisions(&self) -> Vec<RoutingDecision>

Get routing decisions for distillation export

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V