pub struct RecallItem {
pub memory_id: i64,
pub name: String,
pub namespace: String,
pub memory_type: String,
pub description: String,
pub snippet: String,
pub distance: f32,
pub source: String,
pub graph_depth: Option<u32>,
}Expand description
Individual item returned by the recall query.
The memory_type field is serialised as "type" in JSON to maintain
compatibility with external clients — the Rust name uses memory_type
to avoid conflict with the reserved keyword.
§Examples
use sqlite_graphrag::output::RecallItem;
let item = RecallItem {
memory_id: 7,
name: "nota-rust".into(),
namespace: "global".into(),
memory_type: "user".into(),
description: "aprendizado de Rust".into(),
snippet: "ownership e borrowing".into(),
distance: 0.12,
source: "direct".into(),
graph_depth: None,
};
let json = serde_json::to_string(&item).unwrap();
// Rust field `memory_type` appears as `"type"` in JSON.
assert!(json.contains("\"type\":\"user\""));
assert!(!json.contains("memory_type"));
assert!(json.contains("\"distance\":0.12"));Fields§
§memory_id: i64§name: String§namespace: String§memory_type: String§description: String§snippet: String§distance: f32§source: String§graph_depth: Option<u32>Number of graph hops between this match and the seed memories.
Set to None for direct vector matches (where distance is meaningful)
and to Some(N) for traversal results, with N=0 when the depth could
not be tracked precisely. Added in v1.0.23 to disambiguate graph results
from the distance: 0.0 placeholder previously used for graph entries.
Field is omitted from JSON output when None.
Trait Implementations§
Source§impl Clone for RecallItem
impl Clone for RecallItem
Source§fn clone(&self) -> RecallItem
fn clone(&self) -> RecallItem
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 moreAuto Trait Implementations§
impl Freeze for RecallItem
impl RefUnwindSafe for RecallItem
impl Send for RecallItem
impl Sync for RecallItem
impl Unpin for RecallItem
impl UnsafeUnpin for RecallItem
impl UnwindSafe for RecallItem
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