pub struct CaseKnowledge {
pub entry_id: Uuid,
pub case_context: String,
pub relevance_decay: f32,
pub explicit_links: Vec<Uuid>,
pub access_pattern: AccessPattern,
pub last_accessed: DateTime<Utc>,
}Expand description
Knowledge directly relevant to the current task or case.
Case knowledge has high relevance, is recently accessed, and is explicitly linked to the current working context.
Fields§
§entry_id: UuidUnique identifier for this knowledge entry.
case_context: StringProject or case identifier this knowledge belongs to.
relevance_decay: f32Time-based decay factor (0.0 to 1.0). Higher values indicate more recent/relevant knowledge.
explicit_links: Vec<Uuid>Manually linked entry IDs.
access_pattern: AccessPatternCurrent access pattern for this knowledge.
last_accessed: DateTime<Utc>When this knowledge was last accessed.
Implementations§
Source§impl CaseKnowledge
impl CaseKnowledge
Sourcepub fn new(entry_id: Uuid, case_context: impl Into<String>) -> Self
pub fn new(entry_id: Uuid, case_context: impl Into<String>) -> Self
Create new case knowledge with default values.
Sourcepub fn with_access_pattern(self, pattern: AccessPattern) -> Self
pub fn with_access_pattern(self, pattern: AccessPattern) -> Self
Set the access pattern.
Sourcepub fn update_decay(&mut self, half_life_days: f32)
pub fn update_decay(&mut self, half_life_days: f32)
Update the relevance decay based on time since last access.
Uses exponential decay: decay = exp(-days / half_life)
Sourcepub fn record_access(&mut self)
pub fn record_access(&mut self)
Record an access, resetting the decay factor.
Trait Implementations§
Source§impl Clone for CaseKnowledge
impl Clone for CaseKnowledge
Source§fn clone(&self) -> CaseKnowledge
fn clone(&self) -> CaseKnowledge
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 CaseKnowledge
impl Debug for CaseKnowledge
Source§impl<'de> Deserialize<'de> for CaseKnowledge
impl<'de> Deserialize<'de> for CaseKnowledge
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 CaseKnowledge
impl RefUnwindSafe for CaseKnowledge
impl Send for CaseKnowledge
impl Sync for CaseKnowledge
impl Unpin for CaseKnowledge
impl UnsafeUnpin for CaseKnowledge
impl UnwindSafe for CaseKnowledge
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request