Skip to Content

Interface SearchResult

What MemoryOperations.search returns.

memories is ordered most relevant first, and the knowledge lives one level down in Memory.insights — a memory is the container that makes an insight findable, not the finding itself. Expect to loop twice.

A memory whose Memory.reference is set carries no insights: an earlier result in this same session already delivered them, and this entry only says where. Fetch it with MemoryOperations.getMemory by its own idx, never the one in reference — that is what keeps a later rating with the search you are working in.

sessionId is not always the one you sent. A search naming a domain and no session opens a session and reports it here, so this is where to read the id back if you mean to rate what came out.

notice is a remark about the query itself rather than about its results, and is null when there is nothing to say. instructions is written for a model rather than for you; hand it on rather than parsing it.

const result = await session.search('how does gRPC health checking work')
for (const memory of result.memories) {
for (const insight of memory.insights) {
console.log(insight.title, insight.updated)
}
}

MemoryOperations.shareFeedback — rating what came back is the other half of a search, and what moves an insight's reliability signal.

interface SearchResult {
    sessionId: string;
    memories: readonly Memory[];
    notice: string | null;
    instructions: Instructions;
}
Index
sessionId: string

The session the search was recorded against.

memories: readonly Memory[]

What matched, most relevant first.

notice: string | null

Anything the service wants to say about this particular search.

instructions: Instructions

What the service asks the caller to do with the results.