pub struct InsightSynthesizer { /* private fields */ }Expand description
Synthesizes insights from clusters of related experiences using an LLM.
Created via InsightSynthesizer::new() with an InsightSynthesizerConfig.
Implementations§
Source§impl InsightSynthesizer
impl InsightSynthesizer
Sourcepub fn new(config: InsightSynthesizerConfig) -> Self
pub fn new(config: InsightSynthesizerConfig) -> Self
Create a new synthesizer with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new synthesizer with default configuration.
Sourcepub fn config(&self) -> &InsightSynthesizerConfig
pub fn config(&self) -> &InsightSynthesizerConfig
Access the configuration.
Sourcepub fn should_synthesize(&self, cluster_size: usize) -> bool
pub fn should_synthesize(&self, cluster_size: usize) -> bool
Check if synthesis should be attempted based on cluster size.
Sourcepub fn is_debounced(&self, collective_id: CollectiveId) -> bool
pub fn is_debounced(&self, collective_id: CollectiveId) -> bool
Check if a collective is still within the debounce window.
Sourcepub fn mark_synthesized(&self, collective_id: CollectiveId)
pub fn mark_synthesized(&self, collective_id: CollectiveId)
Record that synthesis was performed for a collective (updates debounce timer).
Sourcepub async fn find_cluster(
&self,
start_id: ExperienceId,
substrate: &dyn SubstrateProvider,
) -> Vec<Experience>
pub async fn find_cluster( &self, start_id: ExperienceId, substrate: &dyn SubstrateProvider, ) -> Vec<Experience>
Find all experiences connected to start_id via relations (BFS traversal).
Traverses the relation graph starting from the given experience, collecting all reachable experiences. Capped at 50 to prevent runaway traversal on dense graphs.
Sourcepub async fn synthesize_cluster(
&self,
cluster: &[Experience],
collective_id: CollectiveId,
provider: &dyn LlmProvider,
llm_config: &LlmConfig,
) -> Option<NewDerivedInsight>
pub async fn synthesize_cluster( &self, cluster: &[Experience], collective_id: CollectiveId, provider: &dyn LlmProvider, llm_config: &LlmConfig, ) -> Option<NewDerivedInsight>
Synthesize a cluster of related experiences into a consolidated insight using an LLM.
Builds a prompt from experience contents, calls the LLM, and returns a
NewDerivedInsight ready to store. Returns None if synthesis fails.
Auto Trait Implementations§
impl !Freeze for InsightSynthesizer
impl RefUnwindSafe for InsightSynthesizer
impl Send for InsightSynthesizer
impl Sync for InsightSynthesizer
impl Unpin for InsightSynthesizer
impl UnsafeUnpin for InsightSynthesizer
impl UnwindSafe for InsightSynthesizer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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