Class Session
Index
Properties
Readonlyid
The session id that was opened.
Readonlyinstructions
What the service said when the session was opened.
ReadonlytoolCatalog
What MemoryOperations.listTools reported when
this session was opened, which tools filters against. null
when that fetch failed -- every tool is then treated as available
rather than none.
Constructed by MemoryOperations.startSession, never by a caller.
Methods
[asyncDispose]
-
Leave the session.
Deliberately a no-op. See the class documentation.
Returns Promise<void>
search
-
Search within this session.
Parameters
- query: string
What you want to know, in plain language.
- options: ScopedSearchOptions = {}
Tags to narrow by, and a deadline.
Returns Promise<SearchResult>
What matched.
- query: string
getMemory
-
Fetch one memory in full, by an idx this session returned.
Parameters
- idx: string
The handle, copied exactly as it appeared in a search response.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<Memory>
The memory, its
feedback()bound to this session — unlike MemoryOperations.getMemory, which has no session of its own to bind. - idx: string
createMemory
-
Save new knowledge into this session's domain.
Parameters
- options: ScopedCreateMemoryOptions
What to save, and a deadline.
Returns Promise<WriteResult>
The operation id, when the write can be undone, and guidance.
- options: ScopedCreateMemoryOptions
enrichMemory
-
Add to a memory this session returned, or open a new one.
Parameters
- options: ScopedEnrichMemoryOptions
What to add, which memory to add it to, and a deadline.
Returns Promise<WriteResult>
The operation id, when the write can be undone, and guidance.
- options: ScopedEnrichMemoryOptions
shareFeedback
-
Rate what this session returned.
Parameters
- options: ScopedShareFeedbackOptions
The ratings, and a deadline.
Returns Promise<FeedbackResult>
What was recorded, and anything the service wants to say back.
- options: ScopedShareFeedbackOptions
revertMemory
-
Undo one of your own writes.
Parameters
- operationId: string
The handle a write returned.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<RevertResult>
What the revert actually removed.
- operationId: string
importMemories
-
importMemories(
memories: Iterable<ImportedMemory>,
options?: TimeoutOptions,
): Promise<ImportResult>Contribute many memories at once, recorded against this session.
Parameters
- memories: Iterable<ImportedMemory>
The memories to import.
- options: TimeoutOptions = {}
Per-call deadline.
Returns Promise<ImportResult>
One outcome per memory, in the order they were given.
- memories: Iterable<ImportedMemory>
tools
-
This session's operations, described and rendered for an LLM.
Each tool carries what the operation is for, a JSON Schema for its arguments, and a call that renders the result as text. Every one is bound to this session, so nothing a model sends can change which session a call is recorded under.
The toolset hands itself to a framework —
toLangChain(),toAnthropic(),toOpenAI()— or runs what a model named withcall().An operation is included only when your token's role permits it, as reported by MemoryOperations.listTools when this session was opened. This only shapes what is offered here — it does not gate calling a Session method directly.
Returns Toolset
One tool per operation your role permits, as a Toolset.
An open session, with every session-bound memory operation applied.
Returned by MemoryOperations.startSession and MemoryOperations.withSession alike; not constructed directly. No method here takes a session id or a domain: this object supplies both. That is the point of it — a call that silently drops the session id is still a valid call. It opens a session of its own and records the search there, so the series you were assembling quietly splits in two, and a later rating lands against a search you did not mean to make.
Nothing closes one: the contract has no operation that ends a session, so this is a handle to carry rather than a resource to release. Used as an async-disposable,
[Symbol.asyncDispose]releases nothing either — it exists soawait usingcan bound the region of code a session belongs to, which is a claim about the reader's attention rather than about a resource.