Skip to main content

LearningStore

Trait LearningStore 

Source
pub trait LearningStore: Send + Sync {
Show 20 methods // Provided methods fn get_behavior_patterns<'life0, 'async_trait>( &'life0 self, _min_confidence: f32, ) -> Pin<Box<dyn Future<Output = Result<Vec<BehaviorPattern>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn record_behavior_pattern<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _pattern_type: &'life1 str, _description: &'life2 str, _trigger_context: Option<&'life3 str>, _action: Option<&'life4 str>, _confidence_hint: f32, _occurrence_delta: i32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait { ... } fn get_relevant_procedures<'life0, 'life1, 'async_trait>( &'life0 self, _query: &'life1 str, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Procedure>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_relevant_error_solutions<'life0, 'life1, 'async_trait>( &'life0 self, _error: &'life1 str, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ErrorSolution>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_user_profile<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<UserProfile>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn update_user_profile<'life0, 'life1, 'async_trait>( &'life0 self, _profile: &'life1 UserProfile, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn increment_expertise<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _domain: &'life1 str, _success: bool, _error: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn upsert_procedure<'life0, 'life1, 'async_trait>( &'life0 self, _procedure: &'life1 Procedure, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn update_procedure_outcome<'life0, 'async_trait>( &'life0 self, _procedure_id: i64, _success: bool, _duration: Option<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn insert_error_solution<'life0, 'life1, 'async_trait>( &'life0 self, _solution: &'life1 ErrorSolution, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn update_error_solution_outcome<'life0, 'async_trait>( &'life0 self, _solution_id: i64, _success: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn record_procedure_observation<'life0, 'life1, 'async_trait>( &'life0 self, procedure: &'life1 Procedure, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn record_error_solution_observation<'life0, 'life1, 'async_trait>( &'life0 self, solution: &'life1 ErrorSolution, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn record_task_outcome<'life0, 'life1, 'async_trait>( &'life0 self, domain: &'life1 str, success: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn procedure_trigger_embeddings<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_procedure_trigger_embedding<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _name: &'life1 str, _embedding: &'life2 [f32], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn procedures_missing_embedding<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(i64, String)>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn save_procedure_embedding<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _trigger: &'life1 str, _embedding: Vec<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn error_solutions_missing_embedding<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(i64, String)>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn save_error_solution_embedding<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _pattern: &'life1 str, _embedding: Vec<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Learning system: procedures, expertise, behavior patterns, and error solutions.

Provided Methods§

Source

fn get_behavior_patterns<'life0, 'async_trait>( &'life0 self, _min_confidence: f32, ) -> Pin<Box<dyn Future<Output = Result<Vec<BehaviorPattern>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get behavior patterns above a confidence threshold.

Source

fn record_behavior_pattern<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _pattern_type: &'life1 str, _description: &'life2 str, _trigger_context: Option<&'life3 str>, _action: Option<&'life4 str>, _confidence_hint: f32, _occurrence_delta: i32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Insert/update a behavior pattern occurrence.

Source

fn get_relevant_procedures<'life0, 'life1, 'async_trait>( &'life0 self, _query: &'life1 str, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Procedure>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get procedures relevant to a query.

Source

fn get_relevant_error_solutions<'life0, 'life1, 'async_trait>( &'life0 self, _error: &'life1 str, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ErrorSolution>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get error solutions relevant to an error message.

Source

fn get_user_profile<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<UserProfile>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the user profile.

Source

fn update_user_profile<'life0, 'life1, 'async_trait>( &'life0 self, _profile: &'life1 UserProfile, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store the user profile.

Source

fn increment_expertise<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _domain: &'life1 str, _success: bool, _error: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Increment expertise counters and update level for a domain.

Source

fn upsert_procedure<'life0, 'life1, 'async_trait>( &'life0 self, _procedure: &'life1 Procedure, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Insert or update a procedure.

Source

fn update_procedure_outcome<'life0, 'async_trait>( &'life0 self, _procedure_id: i64, _success: bool, _duration: Option<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update procedure outcome after execution.

Source

fn insert_error_solution<'life0, 'life1, 'async_trait>( &'life0 self, _solution: &'life1 ErrorSolution, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Insert a new error-solution pair.

Source

fn update_error_solution_outcome<'life0, 'async_trait>( &'life0 self, _solution_id: i64, _success: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update error solution outcome.

Source

fn record_procedure_observation<'life0, 'life1, 'async_trait>( &'life0 self, procedure: &'life1 Procedure, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a procedure seen in a finished task. Unlike upsert_procedure, a name already known keeps its stored trigger, steps and failure count and gains exactly one success, so a later sighting cannot rewrite a definition.

Source

fn record_error_solution_observation<'life0, 'life1, 'async_trait>( &'life0 self, solution: &'life1 ErrorSolution, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record an error followed by a recovery. The pair is stored as given (no further normalization) and is embedded later, in the background.

Source

fn record_task_outcome<'life0, 'life1, 'async_trait>( &'life0 self, domain: &'life1 str, success: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count a finished task toward a domain. Unlike increment_expertise, this only moves the counters; the level and confidence stay as stored.

Source

fn procedure_trigger_embeddings<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The trigger embeddings of the stored procedures, to spot duplicates.

Source

fn set_procedure_trigger_embedding<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _name: &'life1 str, _embedding: &'life2 [f32], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the trigger embedding of the procedure with this name.

Source

fn procedures_missing_embedding<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(i64, String)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Up to limit procedures (id, trigger) with no current embedding.

Source

fn save_procedure_embedding<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _trigger: &'life1 str, _embedding: Vec<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a procedure’s trigger embedding, computed over trigger.

Source

fn error_solutions_missing_embedding<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(i64, String)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Up to limit error solutions (id, pattern) with no current embedding.

Source

fn save_error_solution_embedding<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _pattern: &'life1 str, _embedding: Vec<f32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store an error solution’s embedding, computed over pattern.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl LearningStore for SqliteMemory

The daemon store implements the SDK memory crate’s learning contract.