Interface Memory
idx: string;
kind: string;
timesServed: number;
intents: readonly string[];
insights: readonly Insight[];
reference: string | null;
feedback: (rating: MemoryFeedback) => Promise<FeedbackEntry>;
}
Properties
Readonlyidx
The handle addressing this memory.
Readonlykind
The kind of memory, when the service names one.
ReadonlytimesServed
How often it has been returned to anyone.
Readonlyintents
Questions it has been retrieved by before, oldest first.
Readonlyinsights
The findings it holds.
Readonlyreference
An earlier idx in this session that already carried this content.
When set, the insights are empty: fetch the memory by its own idx, not by this one, so a later rating stays with the search being worked in.
Readonlyfeedback
Rate this memory, using the session it was found in.
A shortcut for MemoryOperations.shareFeedback with a single FeedbackRating built from this memory's own idx.
Bound to this memory at conversion time, which means a Memory is no
longer a plain data record: structuredClone(memory) throws, so a
SearchResult carrying one cannot be posted to a worker or
structurally cloned. JSON.stringify drops the function silently and
works as before.
Throws
MemcoInvalidRequestError If this memory was fetched by the
top-level MemoryOperations.getMemory (not through a
MemoryOperations.withSession/MemoryOperations.startSession
session, and not found by a search): there is no session to record the
rating against, and this fails exactly as calling shareFeedback with a
blank sessionId would.
One memory a search returned.
A memory is the container that makes knowledge findable, not the finding itself — that lives one level down in Memory.insights.
When Memory.reference is set the memory carries no insights, and iterating them anyway reads as "nothing matched" when something did. Fetch it with MemoryOperations.getMemory by its own
idx, never the one inreference.None of the
intentsis "the one that matched": a memory is retrieved whole, so they say what it answers rather than why it came back this time.Example