pub struct RememberBuilder<'a> { /* private fields */ }Expand description
Per-call builder returned by Client::remember.
Awaiting the builder writes the prompt as an episodic memory and returns
the persisted row. The write is queue-backed: the returned row’s vector
index entry is pending until the worker drains the embed job. Use
Client::search for retrieval — remember no longer reads.
§Examples
let written = client
.remember("the user said hello", scope)
.metadata(serde_json::json!({ "source": "chat" }))
.await?;
println!("wrote pid={}", written.pid);Attach a parsed event-time when the utterance references a specific moment:
let written = client
.remember("the deployment happened Friday", scope)
.event_at(deploy_time)
.await?;Implementations§
Source§impl<'a> RememberBuilder<'a>
impl<'a> RememberBuilder<'a>
Sourcepub fn metadata(self, metadata: Value) -> Self
pub fn metadata(self, metadata: Value) -> Self
Attaches arbitrary JSON metadata to the written memory.
The value is stored verbatim in the memories.metadata JSONB column
and surfaces unchanged through Client::recall and
Client::search. Operators viewing memories via the admin surface
see the same value — do not put secrets in metadata.
Defaults to {} when unset, matching the column’s schema default.
Sourcepub fn event_at(self, event_at: impl Into<DateTime<FixedOffset>>) -> Self
pub fn event_at(self, event_at: impl Into<DateTime<FixedOffset>>) -> Self
Records the wall-clock time the event being remembered occurred.
Distinct from created_at (when memoir was told). Set this when the
utterance carries a parseable date or time reference — the agent (or
upstream parser) is responsible for resolving “last Friday” to an
absolute moment before passing it here. Memoir does not parse the
content for time references on this path; LLM-driven event-time
extraction is a separate write path (ticket 0011).
Accepts any value convertible to DateTime<FixedOffset>, including
DateTime<Utc>. Defaults to None when unset, which is the right
value for memories whose content has no meaningful event-time
(preferences, identity facts, atemporal observations).
Trait Implementations§
Source§impl<'a> IntoFuture for RememberBuilder<'a>
impl<'a> IntoFuture for RememberBuilder<'a>
Source§type Output = Result<Memory, ClientError>
type Output = Result<Memory, ClientError>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <RememberBuilder<'a> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <RememberBuilder<'a> as IntoFuture>::Output> + Send + 'a>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RememberBuilder<'a>
impl<'a> !UnwindSafe for RememberBuilder<'a>
impl<'a> Freeze for RememberBuilder<'a>
impl<'a> Send for RememberBuilder<'a>
impl<'a> Sync for RememberBuilder<'a>
impl<'a> Unpin for RememberBuilder<'a>
impl<'a> UnsafeUnpin for RememberBuilder<'a>
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> 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> 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