Skip to Content

Interface CreateMemoryOptions

What MemoryOperations.createMemory writes a new memory from.

Name a domain or a session — never neither. A write that names neither is refused before anything is sent, because the request has no other way to say where to save. Naming the session you have been searching in saves into that session's domain and records the memory as part of that work; naming a domain alone saves a standalone memory. Naming both is allowed, and the service takes the domain from the session.

CreateMemoryOptions.title and CreateMemoryOptions.content are bounded together, not one each, so a long title spends the content's characters. A finding that does not fit is better split across two memories than trimmed. CreateMemoryOptions.query is bounded on its own. Both caps are the service's, learned when the connection was verified, so a client that has not yet listed domains checks only that the fields are non-blank.

CreateMemoryOptions.source records who produced the content and defaults to DataSource.AGENT. Claiming DataSource.USER says a person said this, or corrected what the agent had — a statement about provenance rather than a hint, which is why the toolset binds this field instead of offering it to a model.

const written = await client.memory.createMemory({
domain: 'coding',
query: 'how do we verify a gRPC connection before using it',
title: 'The client health-probes before its first real call',
content: 'connect() probes grpc.health.v1 and then lists domains.',
tags: [{ type: 'language', value: 'typescript' }]
})
console.log(written.operationId)
interface CreateMemoryOptions {
    timeout?: number;
    query: string;
    title: string;
    content: string;
    domain?: string;
    sessionId?: string;
    tags?: Iterable<Tag, any, any>;
    source?: DataSource;
}

Hierarchy (View Summary)

Index
timeout?: number

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

query: string

What someone would search to find this memory.

title: string

A short title describing what it is about.

content: string

The knowledge to save.

domain?: string

The domain to save into. Pass this or CreateMemoryOptions.sessionId.

sessionId?: string

The session this was learned during, which supplies the domain.

tags?: Iterable<Tag, any, any>

Tags narrowing what it applies to.

source?: DataSource

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