pub struct RecalledFact {
pub fact: GraphFact,
pub activation_score: Option<f32>,
pub provenance_message_id: Option<MessageId>,
pub provenance_snippet: Option<String>,
pub neighbors: Vec<GraphFact>,
}Expand description
A graph fact returned by the view-aware recall path.
Wraps a base GraphFact and carries optional enrichment fields populated
depending on the RecallView in use.
§Examples
use zeph_memory::{RecalledFact, RecallView};
use zeph_memory::graph::types::GraphFact;
use zeph_memory::graph::EdgeType;
let base = GraphFact {
entity_name: "Rust".to_string(),
relation: "uses".to_string(),
target_name: "LLVM".to_string(),
fact: "Rust uses LLVM for code generation".to_string(),
entity_match_score: 0.9,
hop_distance: 0,
confidence: 0.95,
valid_from: None,
edge_type: EdgeType::Semantic,
retrieval_count: 1,
edge_id: None,
};
let recalled = RecalledFact::from_graph_fact(base);
assert!(recalled.activation_score.is_none());
assert!(recalled.provenance_message_id.is_none());
assert!(recalled.neighbors.is_empty());Fields§
§fact: GraphFactThe base graph fact (text, relation, confidence, edge_type, hop_distance).
activation_score: Option<f32>Spreading-activation score. Some when the SA path was used; None for plain BFS.
Used by the assembler to render (activation: X) suffix and preserve
current output bytes when view = Head.
provenance_message_id: Option<MessageId>Source-message ID for the edge (Zoom-In only).
provenance_snippet: Option<String>≤200-char snippet from the source message, with \n\r<> scrubbed (Zoom-In only).
neighbors: Vec<GraphFact>1-hop neighbor facts deduped against the head set (Zoom-Out only).
Implementations§
Source§impl RecalledFact
impl RecalledFact
Sourcepub fn from_graph_fact(fact: GraphFact) -> Self
pub fn from_graph_fact(fact: GraphFact) -> Self
Wrap a plain GraphFact with no enrichment fields set.
Sourcepub fn from_activated_fact(af: ActivatedFact) -> Self
pub fn from_activated_fact(af: ActivatedFact) -> Self
Wrap a SYNAPSE spreading-activation result, preserving its activation score and source-message provenance.
entity_name/target_name are left empty because spreading activation does not
resolve entity names — callers format the fact via edge.fact instead.
Trait Implementations§
Source§impl Clone for RecalledFact
impl Clone for RecalledFact
Source§fn clone(&self) -> RecalledFact
fn clone(&self) -> RecalledFact
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RecalledFact
impl RefUnwindSafe for RecalledFact
impl Send for RecalledFact
impl Sync for RecalledFact
impl Unpin for RecalledFact
impl UnsafeUnpin for RecalledFact
impl UnwindSafe for RecalledFact
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> 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> ⓘ
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 moreSource§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>
T in a tonic::Request