pub struct DerivedInsight {
pub id: InsightId,
pub collective_id: CollectiveId,
pub content: String,
pub embedding: Vec<f32>,
pub source_experience_ids: Vec<ExperienceId>,
pub insight_type: InsightType,
pub confidence: f32,
pub domain: Vec<String>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
}Expand description
A stored derived insight — synthesized knowledge from multiple experiences.
Unlike experiences (which are raw agent observations), insights are computed/derived knowledge that represents higher-level understanding.
§Embedding Storage
Insight embeddings are stored inline (not in a separate table) because:
- Insights are expected to be far fewer than experiences
- The insight record is always loaded with its embedding for HNSW rebuild
- Simpler storage model (no table join needed)
Fields§
§id: InsightIdUnique identifier (UUID v7, time-ordered).
collective_id: CollectiveIdThe collective this insight belongs to.
content: StringThe insight content (text).
embedding: Vec<f32>Semantic embedding vector for similarity search.
source_experience_ids: Vec<ExperienceId>IDs of the source experiences this insight was derived from.
insight_type: InsightTypeThe type of derivation.
confidence: f32Confidence in this insight (0.0 = uncertain, 1.0 = certain).
domain: Vec<String>Domain tags for categorical filtering.
created_at: TimestampWhen this insight was created.
updated_at: TimestampWhen this insight was last updated.
Trait Implementations§
Source§impl Clone for DerivedInsight
impl Clone for DerivedInsight
Source§fn clone(&self) -> DerivedInsight
fn clone(&self) -> DerivedInsight
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DerivedInsight
impl Debug for DerivedInsight
Source§impl<'de> Deserialize<'de> for DerivedInsight
impl<'de> Deserialize<'de> for DerivedInsight
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DerivedInsight
impl RefUnwindSafe for DerivedInsight
impl Send for DerivedInsight
impl Sync for DerivedInsight
impl Unpin for DerivedInsight
impl UnsafeUnpin for DerivedInsight
impl UnwindSafe for DerivedInsight
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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