pub struct NewDerivedInsight {
pub collective_id: CollectiveId,
pub content: String,
pub embedding: Option<Vec<f32>>,
pub source_experience_ids: Vec<ExperienceId>,
pub insight_type: InsightType,
pub confidence: f32,
pub domain: Vec<String>,
}Expand description
Input for creating a new derived insight.
The embedding field is required when using the External embedding
provider, and optional when using the Builtin provider (which
generates embeddings from content automatically).
§Example
use pulsedb::{NewDerivedInsight, InsightType};
let insight = NewDerivedInsight {
collective_id,
content: "Error handling patterns converge on early return".to_string(),
embedding: Some(embedding_vec),
source_experience_ids: vec![exp_a, exp_b, exp_c],
insight_type: InsightType::Pattern,
confidence: 0.85,
domain: vec!["rust".to_string(), "error-handling".to_string()],
};
let id = db.store_insight(insight)?;Fields§
§collective_id: CollectiveIdThe collective to store this insight in.
content: StringThe insight content (text, max 50KB).
embedding: Option<Vec<f32>>Pre-computed embedding vector (required for External provider).
source_experience_ids: Vec<ExperienceId>IDs of the source experiences this insight was derived from (1-100).
insight_type: InsightTypeThe type of derivation.
confidence: f32Confidence in this insight (0.0-1.0).
domain: Vec<String>Domain tags for categorical filtering.
Auto Trait Implementations§
impl Freeze for NewDerivedInsight
impl RefUnwindSafe for NewDerivedInsight
impl Send for NewDerivedInsight
impl Sync for NewDerivedInsight
impl Unpin for NewDerivedInsight
impl UnsafeUnpin for NewDerivedInsight
impl UnwindSafe for NewDerivedInsight
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
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>
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 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>
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