Skip to Content

Interface EnrichMemoryOptions

What MemoryOperations.enrichMemory writes an addition from.

There is no domain to name here, and that is the difference from CreateMemoryOptions. An addition lands in the domain its session ran in, which is why EnrichMemoryOptions.sessionId is required rather than one half of a pair — and why the tag cap is left to the service, since the client cannot see which domain that is.

EnrichMemoryOptions.memoryIdx is the memory to extend, copied from a search result, or the NEW_MEMORY sentinel to open a standalone memory instead. The sentinel is case-sensitive: 'New' is read as an ordinary handle. It also changes what a later revert can remove: a revert reports RevertOutcome.MEMORY_REMOVED when the insight it undid was its memory's last, which is reachable for a memory the sentinel opened and not for one that already held others. Read the outcome rather than assuming either.

EnrichMemoryOptions.title and EnrichMemoryOptions.content are bounded together exactly as they are on a create. EnrichMemoryOptions.sources are trimmed to the service's cap rather than refused, so citing more than it keeps loses the tail — nothing in the result says so, and a debug log record is the only sign of it.

const found = await client.memory.search('gRPC health checking', {
domain: 'coding'
})
await client.memory.enrichMemory({
memoryIdx: found.memories[0].idx,
sessionId: found.sessionId,
title: 'The probe sends an empty service name',
content: 'An empty name asks after the server as a whole.',
sources: found.memories.map(memory => memory.idx)
})
interface EnrichMemoryOptions {
    timeout?: number;
    memoryIdx: string;
    sessionId: string;
    title: string;
    content: string;
    tags?: Iterable<Tag, any, any>;
    sources?: Iterable<string, any, any>;
    source?: DataSource;
}

Hierarchy (View Summary)

Index
timeout?: number

Seconds to wait for this call. Defaults to the client's own timeout.

memoryIdx: string

The memory to extend, or 'new' to open a standalone one.

sessionId: string

The session the memory was returned in.

title: string

A short title describing what was learned.

content: string

The knowledge to add.

tags?: Iterable<Tag, any, any>

Tags narrowing what it applies to.

sources?: Iterable<string, any, any>

Memories that helped reach this insight. Trimmed to the service's cap.

source?: DataSource

Whether a human or the agent produced it. Defaults to DataSource.AGENT.