Skip to main content

SqliteMemory

Struct SqliteMemory 

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

Long-term memory in SQLite.

Implementations§

Source§

impl SqliteMemory

Source

pub async fn canonical_memory_health(&self) -> Result<MemoryHealthReport>

Source

pub async fn graph_fact_ids_for_query( &self, query: &str, ) -> Result<HashSet<i64>>

Source

pub async fn search_embedding_owners( &self, query: &[f32], owner_type: &str, purpose: &str, limit: usize, ) -> Result<Vec<EmbeddingHit>>

Source

pub async fn fact_embedding_scores( &self, query: &[f32], limit: usize, ) -> Result<HashMap<i64, f32>>

Source

pub async fn episode_embedding_scores( &self, query: &[f32], limit: usize, ) -> Result<HashMap<i64, f32>>

Source

pub async fn upsert_owner_embedding( &self, owner_type: &str, owner_id: i64, purpose: &str, content: &str, embedding: Vec<f32>, ) -> Result<()>

Source

pub async fn project_fact_memory(&self, fact_id: i64) -> Result<()>

Source

pub async fn project_episode_memory(&self, episode_id: i64) -> Result<()>

Source

pub async fn backfill_missing_memory_projections( &self, ) -> Result<(usize, usize, usize, usize, usize)>

Source

pub async fn search_memory_claims( &self, query: &str, channel_id: Option<&str>, visibility: ChannelVisibility, requester_is_owner: bool, limit: usize, ) -> Result<Vec<MemoryClaimRecord>>

FTS5 claim search with visibility and temporal filtering at the owner row.

Source

pub async fn memory_graph_neighbors( &self, start_entity_id: i64, max_depth: usize, channel_id: Option<&str>, visibility: ChannelVisibility, requester_is_owner: bool, ) -> Result<Vec<GraphNeighbor>>

Traverse active graph edges to at most max_depth (clamped to two).

Source

pub async fn persist_extracted_fact_graph( &self, category: &str, key: &str, source_excerpt: &str, graph: &ExtractedMemoryGraph, ) -> Result<()>

Source§

impl SqliteMemory

Source

pub async fn export_readable(&self) -> Result<Vec<ExportFile>>

The memory as Markdown files. Reads only.

Source§

impl SqliteMemory

Source

pub async fn fold_candidates(&self) -> Result<Vec<FoldCandidate>>

Every active fact with a vector, as the fold planner reads it.

Source§

impl SqliteMemory

Source

pub async fn insert_episode(&self, episode: &Episode) -> Result<i64>

Source

pub async fn get_relevant_episodes( &self, query: &str, limit: usize, ) -> Result<Vec<Episode>>

Get episodes relevant to a query using embedding similarity.

Source

pub async fn get_recent_episodes(&self, limit: usize) -> Result<Vec<Episode>>

Get most recent episodes.

Source

pub async fn increment_episode_recall(&self, episode_id: i64) -> Result<()>

Increment recall count for an episode.

Source

pub async fn forget_other_models_vectors(&self) -> Result<u64>

Drops every vector another embedding model wrote, so the backfills re-embed with this one. Two models’ vectors do not share a space: compared, they score noise, even at the same dimension. The vectors on facts, episodes, procedures and error_solutions carry no model, so they go too when the index holds another model’s. Every row of memory_embeddings is derived (from those columns, or recomputed on demand), so the whole index is dropped with them. Returns how many of another model’s indexed vectors there were (0: nothing changed).

Source

pub async fn backfill_episode_embeddings(&self) -> Result<usize>

Backfill missing episode embeddings. Called on startup to ensure all episodes have embeddings for semantic search.

Source

pub async fn backfill_fact_embeddings(&self) -> Result<usize>

Backfill missing fact embeddings. Called on startup to ensure all active facts have pre-computed embeddings.

Source

pub async fn get_user_profile(&self) -> Result<UserProfile>

Get or create the user profile.

Source

pub async fn update_user_profile(&self, profile: &UserProfile) -> Result<()>

Update user profile fields.

Source

pub async fn insert_behavior_pattern( &self, pattern: &BehaviorPattern, ) -> Result<i64>

Insert a new behavior pattern.

Source

pub async fn get_behavior_patterns( &self, min_confidence: f32, ) -> Result<Vec<BehaviorPattern>>

Get behavior patterns above a confidence threshold.

Source

pub async fn record_behavior_pattern( &self, pattern_type: &str, description: &str, trigger_context: Option<&str>, action: Option<&str>, confidence_hint: f32, occurrence_delta: i32, ) -> Result<()>

Insert or update a behavior pattern by logical key (pattern_type + trigger_context + action).

Source

pub async fn update_behavior_pattern( &self, pattern_id: i64, confidence_delta: f32, ) -> Result<()>

Update pattern occurrence and confidence.

Source

pub async fn insert_procedure(&self, procedure: &Procedure) -> Result<i64>

Insert a new procedure.

Source

pub async fn get_relevant_procedures( &self, query: &str, limit: usize, ) -> Result<Vec<Procedure>>

Get procedures relevant to a query.

Source

pub async fn update_procedure( &self, procedure_id: i64, success: bool, new_steps: Option<&[String]>, duration_secs: Option<f32>, ) -> Result<()>

Update procedure success/failure and optionally update steps.

Source

pub async fn get_or_create_expertise(&self, domain: &str) -> Result<Expertise>

Get or create expertise for a domain.

Source

pub async fn increment_expertise( &self, domain: &str, success: bool, error: Option<&str>, ) -> Result<()>

Increment expertise counters and update level.

Source

pub async fn insert_error_solution( &self, solution: &ErrorSolution, ) -> Result<i64>

Insert a new error solution.

Source

pub async fn get_relevant_error_solutions( &self, error: &str, limit: usize, ) -> Result<Vec<ErrorSolution>>

Get error solutions relevant to an error message.

Source

pub async fn update_error_solution( &self, solution_id: i64, success: bool, ) -> Result<()>

Update error solution success/failure.

Source

pub async fn get_fact_history( &self, category: &str, key: &str, ) -> Result<Vec<Fact>>

Get the history of a fact (all versions including superseded).

Source

pub async fn increment_fact_recall(&self, fact_id: i64) -> Result<()>

Increment recall count for a fact.

Source§

impl SqliteMemory

Source

pub async fn reconcile_structured_personal_memory( &self, write: &PersonalMemoryWrite, source: &str, provenance: Option<&str>, channel: Option<&str>, privacy: FactPrivacy, ) -> Result<PersonalMemoryWriteResult>

Source

pub async fn canonical_personal_facts(&self) -> Result<Vec<Fact>>

Source

pub async fn retract_canonical_projection( &self, projected_id: i64, source: &str, ) -> Result<bool>

Retracts the canonical record behind a projected id from Self::canonical_personal_facts (owner and people facts, aliases and relationship edges carry synthetic negative ids there). Returns whether an active record was retracted.

Source

pub async fn retract_owner_profile_key( &self, key: &str, source: &str, ) -> Result<bool>

Retracts the owner’s canonical facts and aliases a profile key names (residence, birthday, name, …): forgetting [user] residence must reach the store the owner block is rendered from, not only the legacy row. Returns whether anything was retracted.

Source

pub async fn backfill_structured_personal_memory(&self) -> Result<usize>

Conservatively dual-writes only unambiguous owner-profile legacy keys. Relationship-shaped and compound-name facts stay untouched and pending.

Source§

impl SqliteMemory

Source

pub fn new(pool: SqlitePool, embedder: Arc<dyn Embedder>) -> Self

Memory over pool, whose tables migrate has created.

Source

pub fn with_channel_ids(self, channels: Arc<dyn ChannelIds>) -> Self

Compares and derives channel ids the host’s way.

Source

pub fn with_error_cleaner(self, clean: fn(&str) -> String) -> Self

Strips host text (wrappers, notices) from an error before its recurrence pattern is derived.

Source

pub fn with_message_log(self, messages: Arc<dyn MessageLog>) -> Self

Links episodes to the host’s messages (see MessageLog).

Source

pub fn pool(&self) -> &SqlitePool

The pool the store works on.

Trait Implementations§

Source§

impl Clone for SqliteMemory

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl EpisodeStore for SqliteMemory

Source§

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

Insert the episode with the event span it covers, then embed its summary and project it into the memory index. Multiple episodes per session are allowed (mid-session ones for long conversations, then a final one when the session goes idle).

Source§

fn last_episode_bound<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EpisodeBound>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Where the session’s most recent episode stopped, if it has one.
Source§

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

(session id, latest episode end time) for every session with an episode.
Source§

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

Refresh derived canonical-memory projections for an episode. Stores that do not maintain secondary indexes may keep the default no-op.
Source§

fn get_relevant_episodes<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get episodes relevant to a query.
Source§

fn get_relevant_episodes_for_channel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, limit: usize, channel_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get episodes for a specific channel context.
Source§

fn get_relevant_episodes_for_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, limit: usize, session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get episodes only from one canonical session (used by untrusted internal/sub-agent origins).
Source§

impl FactStore for SqliteMemory

Source§

fn search_facts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, limit: usize, config: &'life2 FactSearchConfig, ) -> Pin<Box<dyn Future<Output = Result<FactSearchReport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Explicit fact search: one ranked list plus query-relevant related facts. Ranking lives in crate::search; a store only gathers facts and scores. The default returns an empty report so stores without search keep compiling.
Source§

fn stamp_fact_provenance<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, source: &'life3 str, first_seen_at: Option<DateTime<Utc>>, source_excerpt: Option<&'life4 str>, ) -> 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,

Record where the active fact at this key came from.
Source§

fn reconcile_personal_memory<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, write: &'life1 PersonalMemoryWrite, source: &'life2 str, source_excerpt: Option<&'life3 str>, channel_id: Option<&'life4 str>, privacy: FactPrivacy, ) -> Pin<Box<dyn Future<Output = Result<PersonalMemoryWriteResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Reconcile an entity-aware personal-memory write atomically.
Source§

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

Compatibility projection of active canonical facts and relationships.
Source§

fn record_memory_recall<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, fact_ids: &'life1 [i64], episode_ids: &'life2 [i64], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Record that these facts and episodes were shown to a model. Recall counts drive Core Profile salience and decay, so only content that actually reached a prompt or a tool result may count; fetching a candidate that was then cut by a budget is not a recall.
Source§

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

Supersede active automated facts that restate another active fact in the same category, keeping the most authoritative copy. Returns how many rows were folded. Soft: superseded rows remain as history.
Source§

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

Source§

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

Source§

fn refresh_fact_memory<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Refresh canonical claim/vector projections for the active fact at this key.
Source§

fn project_extracted_fact_graph<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, source_excerpt: &'life3 str, graph: &'life4 ExtractedMemoryGraph, ) -> 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,

Persist a model-extracted semantic graph for an already-written fact. Implementations must validate the graph and retain claim provenance.
Source§

fn upsert_fact_with_provenance<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, value: &'life3 str, source: &'life4 str, channel_id: Option<&'life5 str>, privacy: FactPrivacy, first_seen_at: Option<DateTime<Utc>>, source_excerpt: Option<&'life6 str>, ) -> 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, 'life5: 'async_trait, 'life6: 'async_trait,

Upsert a fact with full provenance data.
Source§

fn get_facts<'life0, 'life1, 'async_trait>( &'life0 self, category: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Fact>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all facts, optionally filtered by category.
Source§

fn get_relevant_facts<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, max: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Fact>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get facts semantically relevant to a query, falling back to get_facts on error.
Source§

fn get_relevant_facts_for_channel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, max: usize, channel_id: Option<&'life2 str>, visibility: ChannelVisibility, requester_is_owner: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Fact>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get facts for a specific channel context, respecting privacy levels. Read more
Source§

fn update_fact_privacy<'life0, 'async_trait>( &'life0 self, fact_id: i64, privacy: FactPrivacy, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update a fact’s privacy level (e.g., channel → global after approval).
Source§

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

Soft-delete a fact by superseding it.
Source§

fn delete_fact_by_key<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Soft-delete a fact by category and key. Returns true if a fact was found and deleted.
Source§

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

Get all active facts with provenance info for memory management display.
Source§

fn upsert_fact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, category: &'life1 str, key: &'life2 str, value: &'life3 str, source: &'life4 str, channel_id: Option<&'life5 str>, privacy: FactPrivacy, ) -> 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, 'life5: 'async_trait,

Upsert a fact with channel provenance and privacy level.
Source§

impl LearningStore for SqliteMemory

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

Source§

fn get_behavior_patterns<'life0, 'async_trait>( &'life0 self, min_confidence: f32, ) -> Pin<Box<dyn Future<Output = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<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 = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<()>> + 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 = MemoryResult<()>> + 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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<()>> + 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 = MemoryResult<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 = MemoryResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

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

impl MemoryDecay for SqliteMemory

Fading of unrecalled facts, episodes and behavior patterns.

Source§

fn decay<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 DecayPolicy, now: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl MemoryGraphStore for SqliteMemory

Source§

fn upsert_entity<'life0, 'async_trait>( &'life0 self, entity: GraphEntityUpsert, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Source§

fn invalidate_claim<'life0, 'life1, 'async_trait>( &'life0 self, claim_id: i64, valid_to: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn neighbors<'life0, 'life1, 'async_trait>( &'life0 self, start_entity_id: i64, max_depth: usize, scope: &'life1 GraphSearchScope, ) -> Pin<Box<dyn Future<Output = Result<Vec<GraphNeighbor>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl PeopleStore for SqliteMemory

Source§

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

Create or update a person record. Returns the person ID.
Source§

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

Get a person by their database ID.
Source§

fn get_person_by_platform_id<'life0, 'life1, 'async_trait>( &'life0 self, platform_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Person>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Look up a person by a platform-qualified sender ID (e.g., “slack:U123”).
Source§

fn find_person_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Person>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find a person by name or alias (case-insensitive).
Source§

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

Get all people.
Source§

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

Delete a person and all their facts (cascade).
Link a platform identity to a person.
Source§

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

Update interaction tracking for a person.
Source§

fn upsert_person_fact<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, person_id: i64, category: &'life1 str, key: &'life2 str, value: &'life3 str, source: &'life4 str, confidence: f32, ) -> 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,

Create or update a fact about a person.
Source§

fn get_person_facts<'life0, 'life1, 'async_trait>( &'life0 self, person_id: i64, category: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PersonFact>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get facts about a person, optionally filtered by category.
Source§

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

Delete a person fact by ID.
Source§

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

Confirm an auto-extracted person fact (set confidence to 1.0).
Source§

fn get_people_with_upcoming_dates<'life0, 'async_trait>( &'life0 self, within_days: i32, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Person, PersonFact)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get people with upcoming dates (birthdays, important dates) within N days.
Source§

fn prune_stale_person_facts<'life0, 'async_trait>( &'life0 self, retention_days: u32, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete stale auto-extracted person facts older than N days with confidence < 1.0.
Source§

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

Get people who haven’t interacted in more than N days.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MemoryStores for T

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more