Interface CreateMemoryOptions
interface CreateMemoryOptions {
timeout?: number;
query: string;
title: string;
content: string;
domain?: string;
sessionId?: string;
tags?: Iterable<Tag, any, any>;
source?: DataSource;
}
timeout?: number;
query: string;
title: string;
content: string;
domain?: string;
sessionId?: string;
tags?: Iterable<Tag, any, any>;
source?: DataSource;
}
Hierarchy (View Summary)
- TimeoutOptions
- CreateMemoryOptions
Properties
Optionaltimeout
timeout?: number
Seconds to wait for this call. Defaults to the client's own timeout.
query
query: string
What someone would search to find this memory.
title
title: string
A short title describing what it is about.
content
content: string
The knowledge to save.
Optionaldomain
domain?: string
The domain to save into. Pass this or CreateMemoryOptions.sessionId.
OptionalsessionId
sessionId?: string
The session this was learned during, which supplies the domain.
Optionaltags
Tags narrowing what it applies to.
Optionalsource
Whether a human or the agent produced it. Defaults to DataSource.AGENT.
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.
Example