pub struct MemoryLookupHit {
pub score: f32,
pub summary: String,
pub key: Option<String>,
pub source_uri: Option<String>,
pub principal: Option<String>,
pub scope: Option<String>,
pub recorded_at_millis: Option<i64>,
pub metadata: Value,
}Expand description
One hit returned by a MemoryLookupStore.
Fields§
§score: f32Retrieval score in [0, 1]; higher is more similar.
summary: StringShort text summary suitable for evidence display.
key: Option<String>Optional stable store key, frame id, or episode id.
source_uri: Option<String>Optional URI or locator for the backing memory source.
principal: Option<String>Optional principal, actor, tenant, or subject associated with the hit.
scope: Option<String>Optional caller-defined lookup scope such as tenant, workspace, or profile.
recorded_at_millis: Option<i64>Optional milliseconds since the Unix epoch when the source was recorded.
metadata: ValueOptional store-specific metadata.
Implementations§
Source§impl MemoryLookupHit
impl MemoryLookupHit
Sourcepub fn new(score: f32, summary: impl Into<String>) -> Self
pub fn new(score: f32, summary: impl Into<String>) -> Self
Create a hit with no key or metadata.
Sourcepub fn with_source_uri(self, source_uri: impl Into<String>) -> Self
pub fn with_source_uri(self, source_uri: impl Into<String>) -> Self
Attach a source URI or locator.
Sourcepub fn with_principal(self, principal: impl Into<String>) -> Self
pub fn with_principal(self, principal: impl Into<String>) -> Self
Attach the principal, actor, tenant, or subject associated with the hit.
Sourcepub fn with_scope(self, scope: impl Into<String>) -> Self
pub fn with_scope(self, scope: impl Into<String>) -> Self
Attach the caller-defined lookup scope.
Sourcepub fn with_recorded_at_millis(self, recorded_at_millis: i64) -> Self
pub fn with_recorded_at_millis(self, recorded_at_millis: i64) -> Self
Attach the source record timestamp in milliseconds since the Unix epoch.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Attach store-specific metadata.
Trait Implementations§
Source§impl Clone for MemoryLookupHit
impl Clone for MemoryLookupHit
Source§fn clone(&self) -> MemoryLookupHit
fn clone(&self) -> MemoryLookupHit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more