@mongodb-js/agent-engine-sdk-memory

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

@mongodb-js/agent-engine-sdk-memory

MongoDB Atlas Agent Engine is in Public Preview and intended for evaluation and prototyping purposes only. We do not recommend production deployments during preview and expect to communicate breaking changes with you periodically. To learn more about preview feature considerations, see Preview Features.

Table of Contents

Classes

Memory

Public, transport-free memory facade.

Constructor

new Memory(opts?): Memory;

Parameters

Parameter Type
opts `MemoryOptions <#memoryoptions>`__

Returns

`Memory \<#memory>`__

Methods

bind()
bind(ctx): Memory;

Return a new Memory scoped to ctx without mutating this handle.

Parameters

Parameter Type
ctx `MemoryRequestContext <#memoryrequestcontext>`__

Returns

`Memory \<#memory>`__

buildContext()
buildContext(args): Promise<{
  formatted_context: string | Record<string, unknown>[];
  metadata: {
     memory_counts: Record<string, number>;
     timing: Record<string, number>;
     token_count: number;
  };
  selected_memories?: object[] | null;
}>;

Build a unified memory context across memory types.

Parameters

Parameter Type Description
args { enabledSources?: Set <string> | null; maxTokens?: number; metadataFilter?: Record <string, unknown> | null; query: string; sessionId?: string | null; threadId?: string | null; userId?: string | null; visibility?: string | null; }
args.enabledSources? Set <string> | null
args.maxTokens? number Optional gross context-construction budget. Omitted preserves prior behavior. Non-positive, non-integer, and non-finite values raise before runtime delegation. After retrieval and ranking, the server subtracts a 500-token formatting reserve, then greedily selects whole memory chunks that fit in the remainder. Positive values at or below 500 leave no budget for memories. Values above 500 can still yield empty context when no chunk fits. metadata.token_count reports formatted output only and excludes the reserve.
args.metadataFilter? Record <string, unknown> | null
args.query string
args.sessionId? string | null
args.threadId? string | null Deprecated alias for sessionId; a non-blank sessionId wins.
args.userId? string | null
args.visibility? string | null

Returns

Promise \<{ formatted_context: string | Record \<string, unknown>[]; metadata: { memory_counts: Record \<string, number>; timing: Record \<string, number>; token_count: number; }; selected_memories?: object [] | null; }>

close()
close(): Promise<void>;

Release the underlying transport(s) when this handle owns them.

Returns

Promise \<void>

discoverProcedures()
discoverProcedures(args): Promise<Record<string, unknown>[]>;

Parameters

Parameter Type
args { metadataFilter?: Record <string, unknown> | null; query: string; similarityThreshold?: number; tags?: string [] | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.metadataFilter? Record <string, unknown> | null
args.query string
args.similarityThreshold? number
args.tags? string [] | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<Record \<string, unknown>[]>

getProcedure()
getProcedure(args): Promise<unknown>;

Parameters

Parameter Type
args { includeDeleted?: boolean; procedureName: string; userId?: string | null; visibility?: string | null; }
args.includeDeleted? boolean
args.procedureName string
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

getSemantic()
getSemantic(args): Promise<unknown>;

Parameters

Parameter Type
args { label: string; userId?: string | null; visibility?: string | null; }
args.label string
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

getTaxonomicTerm()
getTaxonomicTerm(args): Promise<unknown>;

Parameters

Parameter Type
args { domain: string; term: string; userId?: string | null; visibility?: string | null; }
args.domain string
args.term string
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

listDomains()
listDomains(args?): Promise<string[]>;

Parameters

Parameter Type
args { visibility?: string | null; }
args.visibility? string | null

Returns

Promise \<string []>

listEpisodes()
listEpisodes(args?): Promise<unknown[]>;

Parameters

Parameter Type
args { limit?: number; sessionId?: string | null; userId?: string | null; visibility?: string | null; }
args.limit? number
args.sessionId? string | null
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown []>

recordTurn()
recordTurn(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  session_id: string;
  turn_seq: number;
}>;

Record a single conversation turn (write-accepted semantics).

Parameters

Parameter Type
args { content?: string | null; idempotencyKey?: string | null; isError?: boolean; modelName?: string | null; role: string; sessionId?: string | null; toolCallId?: string | null; toolCalls?: Record <string, unknown>[] | null; toolName?: string | null; }
args.content? string | null
args.idempotencyKey? string | null
args.isError? boolean
args.modelName? string | null
args.role string
args.sessionId? string | null
args.toolCallId? string | null
args.toolCalls? Record <string, unknown>[] | null
args.toolName? string | null

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; session_id: string; turn_seq: number; }>

retrieve()
retrieve(
   memoryType,
   query,
   options?
): Promise<{
  count: number;
  results: object[];
}>;

Retrieve memories of a declared custom type by semantic query.

Filters are exact-match equality on declared tag keys; result ordering may improve between releases and is not contractual. One type per call.

Parameters

Parameter Type
memoryType string
query string
options? { tags?: `TagMap <#tagmap>__ \|null;topK?:number`; }
options.tags? `TagMap <#tagmap>__ \|null`
options.topK? number

Returns

Promise \<{ count: number; results: object []; }>

save()
save(
   memoryType,
   content,
   options?
): Promise<{
  has_embedding: boolean;
  id: string;
  tags: Record<string, string | number | boolean>;
  type: string;
}>;

Save a memory of a declared custom type.

The platform stamps identity (org, project, user) and enforces the type’s declared tag schema; this method validates only tag syntax client-side so mistakes fail fast with server-matching messages. Built-in types (semantic, episodic, taxonomic, procedural) are rejected — use their dedicated methods.

Parameters

Parameter Type
memoryType string
content string
options? { contextualMetadata?: Record <string, unknown> | null; tags?: `TagMap <#tagmap>__ \|null`; }
options.contextualMetadata? Record <string, unknown> | null
options.tags? `TagMap <#tagmap>__ \|null`

Returns

Promise \<{ has_embedding: boolean; id: string; tags: Record \<string, string | number | boolean>; type: string; }>

saveEpisode()
saveEpisode(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  title: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; content: string; metadata?: Record <string, unknown> | null; participants?: string [] | null; sessionId?: string | null; summary?: string | null; tags?: string [] | null; title: string; userId?: string | null; visibility?: string; }
args.agentId? string | null
args.content string
args.metadata? Record <string, unknown> | null
args.participants? string [] | null
args.sessionId? string | null
args.summary? string | null
args.tags? string [] | null
args.title string
args.userId? string | null
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; title: string; }>

saveProcedure()
saveProcedure(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  procedure: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; allowedTools?: string [] | null; compatibility?: string | null; content: string; description: string; extractionSource?: string | null; license?: string | null; procedure: string; resources?: Record <string, unknown>[] | null; sourceFormat?: string | null; sourcePath?: string | null; steps?: Record <string, unknown>[] | null; tags?: string [] | null; triggerConditions?: string [] | null; updateExisting?: boolean; userId?: string | null; visibility?: string; }
args.agentId? string | null
args.allowedTools? string [] | null
args.compatibility? string | null
args.content string
args.description string
args.extractionSource? string | null
args.license? string | null
args.procedure string
args.resources? Record <string, unknown>[] | null
args.sourceFormat? string | null
args.sourcePath? string | null
args.steps? Record <string, unknown>[] | null
args.tags? string [] | null
args.triggerConditions? string [] | null
args.updateExisting? boolean
args.userId? string | null
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; procedure: string; }>

saveSemantic()
saveSemantic(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  label: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; label: string; metadata?: Record <string, unknown> | null; source?: string; text: string; upsert?: boolean; userId?: string | null; visibility?: string; }
args.agentId? string | null
args.label string
args.metadata? Record <string, unknown> | null
args.source? string
args.text string
args.upsert? boolean
args.userId? string | null
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; label: string; }>

saveTaxonomic()
saveTaxonomic(args): Promise<{
  acknowledged: boolean;
  domain: string;
  has_embedding: boolean;
  id: string;
  term: string;
}>;

Parameters

Parameter Type
args { definition: string; domain: string; relatedTerms?: string [] | null; term: string; userId?: string | null; visibility?: string; }
args.definition string
args.domain string
args.relatedTerms? string [] | null
args.term string
args.userId? string | null
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; domain: string; has_embedding: boolean; id: string; term: string; }>

search(args): Promise<object[]>;

Search one or more memory sources and return a single ranked list.

Parameters

Parameter Type
args { domain?: string | null; metadataFilter?: Record <string, unknown> | null; query: string; sessionId?: string | null; similarityThreshold?: number; sources?: string | readonly string [] | null; tags?: string [] | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.domain? string | null
args.metadataFilter? Record <string, unknown> | null
args.query string
args.sessionId? string | null
args.similarityThreshold? number
args.sources? string | readonly string [] | null
args.tags? string [] | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

searchEpisodes()
searchEpisodes(args): Promise<object[]>;

Parameters

Parameter Type
args { query: string; sessionId?: string | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.query string
args.sessionId? string | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

searchSemantic()
searchSemantic(args): Promise<object[]>;

Parameters

Parameter Type
args { query: string; topK?: number; userId?: string | null; visibility?: string | null; }
args.query string
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

searchTaxonomic()
searchTaxonomic(args): Promise<object[]>;

Parameters

Parameter Type
args { domain?: string | null; query: string; topK?: number; userId?: string | null; visibility?: string | null; }
args.domain? string | null
args.query string
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>


MemoryAPIError

Base for typed transport errors from the HTTP memory transports.

Extends

  • Error

Extended by

  • `MemoryAuthError \<#memoryautherror>`__

  • `MemoryNotProvisionedError \<#memorynotprovisionederror>`__

  • `MemoryBadRequestError \<#memorybadrequesterror>`__

  • `MemoryServerError \<#memoryservererror>`__

  • `MemoryConnectionError \<#memoryconnectionerror>`__

Constructor

new MemoryAPIError(message, opts?): MemoryAPIError;

Parameters

Parameter Type
message string
opts { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryAPIError \<#memoryapierror>`__

Overrides

Error.constructor

Properties

Property Modifier Type
code readonly string | null
responseText readonly string | null
status readonly number | null

MemoryAuthError

Raised for 401 / 403 responses.

Extends

  • `MemoryAPIError \<#memoryapierror>`__

Constructor

new MemoryAuthError(message, opts?): MemoryAuthError;

Parameters

Parameter Type
message string
opts? { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryAuthError \<#memoryautherror>`__

Overrides

`MemoryAPIError \<#memoryapierror>`__. `constructor \<#constructor-1>`__

Properties

Property Modifier Type Inherited from
code readonly string | null MemoryAPIError` <#memoryapierror>`__.code<#property-code>__
responseText readonly string | null MemoryAPIError` <#memoryapierror>`__.responseText<#property-responsetext>__
status readonly number | null MemoryAPIError` <#memoryapierror>`__.status<#property-status>__

MemoryBadRequestError

Raised for 4xx responses other than auth / not-provisioned.

Extends

  • `MemoryAPIError \<#memoryapierror>`__

Extended by

  • `MemoryRouteNotFoundError \<#memoryroutenotfounderror>`__

Constructor

new MemoryBadRequestError(message, opts?): MemoryBadRequestError;

Parameters

Parameter Type
message string
opts? { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryBadRequestError \<#memorybadrequesterror>`__

Overrides

`MemoryAPIError \<#memoryapierror>`__. `constructor \<#constructor-1>`__

Properties

Property Modifier Type Inherited from
code readonly string | null MemoryAPIError` <#memoryapierror>`__.code<#property-code>__
responseText readonly string | null MemoryAPIError` <#memoryapierror>`__.responseText<#property-responsetext>__
status readonly number | null MemoryAPIError` <#memoryapierror>`__.status<#property-status>__

MemoryClientAdapter

A single MemoryClient-backed runtime + CRUD client for the Memory facade.

Implements

  • `MemoryRuntime \<#memoryruntime>`__

  • `MemoryCrudClient \<#memorycrudclient>`__

Constructor

new MemoryClientAdapter(opts): MemoryClientAdapter;

Parameters

Parameter Type
opts `MemoryClientAdapterOptions <#memoryclientadapteroptions>`__

Returns

`MemoryClientAdapter \<#memoryclientadapter>`__

Methods

buildContext()
buildContext(args): Promise<{
  formatted_context: string | Record<string, unknown>[];
  metadata: {
     memory_counts: Record<string, number>;
     timing: Record<string, number>;
     token_count: number;
  };
  selected_memories?: object[] | null;
}>;

Parameters

Parameter Type Description
args { enabledSources?: Set <string> | null; maxTokens?: number; metadataFilter?: Record <string, unknown> | null; query: string; sessionId?: string | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.enabledSources? Set <string> | null
args.maxTokens? number Optional gross context-construction budget. After retrieval and ranking, the server subtracts a 500-token formatting reserve, then greedily selects whole memory chunks that fit in the remainder. Positive values at or below 500 leave no budget for memories. Values above 500 can still yield empty context when no chunk fits.
args.metadataFilter? Record <string, unknown> | null
args.query string
args.sessionId? string | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<{ formatted_context: string | Record \<string, unknown>[]; metadata: { memory_counts: Record \<string, number>; timing: Record \<string, number>; token_count: number; }; selected_memories?: object [] | null; }>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `buildContext \<#buildcontext-2>`__

close()
close(): void;

Optional: release underlying resources.

Returns

void

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `close \<#close-2>`__

createCustom()
createCustom(args): Promise<{
  has_embedding: boolean;
  id: string;
  tags: Record<string, string | number | boolean>;
  type: string;
}>;

Identity is stamped by the platform.

Parameters

Parameter Type
args { content: string; contextualMetadata?: Record <string, unknown> | null; memoryType: string; tags?: Record <string, unknown> | null; }
args.content string
args.contextualMetadata? Record <string, unknown> | null
args.memoryType string
args.tags? Record <string, unknown> | null

Returns

Promise \<{ has_embedding: boolean; id: string; tags: Record \<string, string | number | boolean>; type: string; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `createCustom \<#createcustom-1>`__

createEpisodic()
createEpisodic(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  title: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; content: string; metadata?: Record <string, unknown> | null; participants?: string [] | null; sessionId: string; summaryText?: string | null; tags?: string [] | null; title: string; userId: string; visibility?: string; }
args.agentId? string | null
args.content string
args.metadata? Record <string, unknown> | null
args.participants? string [] | null
args.sessionId string
args.summaryText? string | null
args.tags? string [] | null
args.title string
args.userId string
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; title: string; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `createEpisodic \<#createepisodic-1>`__

createProcedural()
createProcedural(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  procedure: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; allowedTools?: string [] | null; compatibility?: string | null; content: string; description: string; extractionSource?: string | null; license?: string | null; procedure: string; resources?: Record <string, unknown>[] | null; sourceFormat?: string | null; sourcePath?: string | null; steps?: Record <string, unknown>[] | null; tags?: string [] | null; triggerConditions?: string [] | null; updateExisting?: boolean; userId: string; visibility?: string; }
args.agentId? string | null
args.allowedTools? string [] | null
args.compatibility? string | null
args.content string
args.description string
args.extractionSource? string | null
args.license? string | null
args.procedure string
args.resources? Record <string, unknown>[] | null
args.sourceFormat? string | null
args.sourcePath? string | null
args.steps? Record <string, unknown>[] | null
args.tags? string [] | null
args.triggerConditions? string [] | null
args.updateExisting? boolean
args.userId string
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; procedure: string; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `createProcedural \<#createprocedural-1>`__

createSemantic()
createSemantic(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  label: string;
}>;

Parameters

Parameter Type
args { agentId?: string | null; label: string; metadata?: Record <string, unknown> | null; source?: string; text: string; upsert?: boolean; userId: string; visibility?: string; }
args.agentId? string | null
args.label string
args.metadata? Record <string, unknown> | null
args.source? string
args.text string
args.upsert? boolean
args.userId string
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; label: string; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `createSemantic \<#createsemantic-1>`__

createTaxonomic()
createTaxonomic(args): Promise<{
  acknowledged: boolean;
  domain: string;
  has_embedding: boolean;
  id: string;
  term: string;
}>;

Parameters

Parameter Type
args { definition: string; domain: string; relatedTerms?: string [] | null; term: string; userId: string; visibility?: string; }
args.definition string
args.domain string
args.relatedTerms? string [] | null
args.term string
args.userId string
args.visibility? string

Returns

Promise \<{ acknowledged: boolean; domain: string; has_embedding: boolean; id: string; term: string; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `createTaxonomic \<#createtaxonomic-1>`__

discoverProcedures()
discoverProcedures(args): Promise<Record<string, unknown>[]>;

Parameters

Parameter Type
args { metadataFilter?: Record <string, unknown> | null; query: string; similarityThreshold?: number; tags?: string [] | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.metadataFilter? Record <string, unknown> | null
args.query string
args.similarityThreshold? number
args.tags? string [] | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<Record \<string, unknown>[]>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `discoverProcedures \<#discoverprocedures-2>`__

getDistinctDomains()
getDistinctDomains(args): Promise<string[]>;

Parameters

Parameter Type
args { visibility?: string | null; }
args.visibility? string | null

Returns

Promise \<string []>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `getDistinctDomains \<#getdistinctdomains-1>`__

getProcedural()
getProcedural(args): Promise<unknown>;

Parameters

Parameter Type
args { includeDeleted?: boolean; procedure?: string | null; userId?: string | null; visibility?: string | null; }
args.includeDeleted? boolean
args.procedure? string | null
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `getProcedural \<#getprocedural-1>`__

getSemantic()
getSemantic(args): Promise<unknown>;

Parameters

Parameter Type
args { label: string; userId?: string | null; visibility?: string | null; }
args.label string
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `getSemantic \<#getsemantic-2>`__

getTaxonomic()
getTaxonomic(args): Promise<unknown>;

Parameters

Parameter Type
args { domain: string; term?: string | null; userId?: string | null; visibility?: string | null; }
args.domain string
args.term? string | null
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `getTaxonomic \<#gettaxonomic-1>`__

listEpisodic()
listEpisodic(args): Promise<unknown[]>;

Parameters

Parameter Type
args { limit?: number; sessionId?: string | null; userId?: string | null; visibility?: string | null; }
args.limit? number
args.sessionId? string | null
args.userId? string | null
args.visibility? string | null

Returns

Promise \<unknown []>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `listEpisodic \<#listepisodic-1>`__

recordTurn()
recordTurn(args): Promise<{
  acknowledged: boolean;
  has_embedding: boolean;
  id: string;
  session_id: string;
  turn_seq: number;
}>;

Parameters

Parameter Type
args { agentId?: string | null; content?: string | null; idempotencyKey?: string | null; isError?: boolean; modelName?: string | null; role: string; sessionId?: string | null; toolCallId?: string | null; toolCalls?: Record <string, unknown>[] | null; toolName?: string | null; userId?: string | null; }
args.agentId? string | null
args.content? string | null
args.idempotencyKey? string | null
args.isError? boolean
args.modelName? string | null
args.role string
args.sessionId? string | null
args.toolCallId? string | null
args.toolCalls? Record <string, unknown>[] | null
args.toolName? string | null
args.userId? string | null

Returns

Promise \<{ acknowledged: boolean; has_embedding: boolean; id: string; session_id: string; turn_seq: number; }>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `recordTurn \<#recordturn-2>`__

retrieveCustom()
retrieveCustom(args): Promise<{
  count: number;
  results: object[];
}>;

Identity is stamped by the platform.

Parameters

Parameter Type
args { memoryType: string; query: string; tags?: Record <string, unknown> | null; topK?: number; }
args.memoryType string
args.query string
args.tags? Record <string, unknown> | null
args.topK? number

Returns

Promise \<{ count: number; results: object []; }>

Implementation of

`MemoryCrudClient \<#memorycrudclient>`__. `retrieveCustom \<#retrievecustom-1>`__

searchEpisodes()
searchEpisodes(args): Promise<object[]>;

Parameters

Parameter Type
args { query: string; sessionId?: string | null; topK?: number; userId?: string | null; visibility?: string | null; }
args.query string
args.sessionId? string | null
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `searchEpisodes \<#searchepisodes-2>`__

searchSemantic()
searchSemantic(args): Promise<object[]>;

Parameters

Parameter Type
args { query: string; topK?: number; userId?: string | null; visibility?: string | null; }
args.query string
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `searchSemantic \<#searchsemantic-2>`__

searchTaxonomic()
searchTaxonomic(args): Promise<object[]>;

Parameters

Parameter Type
args { domain?: string | null; query: string; topK?: number; userId?: string | null; visibility?: string | null; }
args.domain? string | null
args.query string
args.topK? number
args.userId? string | null
args.visibility? string | null

Returns

Promise \<object []>

Implementation of

`MemoryRuntime \<#memoryruntime>`__. `searchTaxonomic \<#searchtaxonomic-2>`__


MemoryClientError

Base for pre-HTTP client/usage errors (no status code or response body).

Extends

  • Error

Extended by

  • `MemoryNotSupportedError \<#memorynotsupportederror>`__

Constructor

new MemoryClientError(message, options?): MemoryClientError;

Parameters

Parameter Type
message string
options? ErrorOptions

Returns

`MemoryClientError \<#memoryclienterror>`__

Overrides

Error.constructor

MemoryConnectionError

Raised when the transport fails to reach the memory backend (connect/timeout).

Extends

  • `MemoryAPIError \<#memoryapierror>`__

Constructor

new MemoryConnectionError(message, opts?): MemoryConnectionError;

Parameters

Parameter Type
message string
opts? { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryConnectionError \<#memoryconnectionerror>`__

Overrides

`MemoryAPIError \<#memoryapierror>`__. `constructor \<#constructor-1>`__

Properties

Property Modifier Type Inherited from
code readonly string | null MemoryAPIError` <#memoryapierror>`__.code<#property-code>__
responseText readonly string | null MemoryAPIError` <#memoryapierror>`__.responseText<#property-responsetext>__
status readonly number | null MemoryAPIError` <#memoryapierror>`__.status<#property-status>__

MemoryIdentityError

Raised when a required identity dimension cannot be resolved.

Extends

  • Error

Constructor

new MemoryIdentityError(message): MemoryIdentityError;

Parameters

Parameter Type
message string

Returns

`MemoryIdentityError \<#memoryidentityerror>`__

Overrides

Error.constructor

MemoryNotProvisionedError

Raised when the project’s memory runtime is not yet reachable.

Extends

  • `MemoryAPIError \<#memoryapierror>`__

Constructor

new MemoryNotProvisionedError(message, opts?): MemoryNotProvisionedError;

Parameters

Parameter Type
message string
opts? { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryNotProvisionedError \<#memorynotprovisionederror>`__

Overrides

`MemoryAPIError \<#memoryapierror>`__. `constructor \<#constructor-1>`__

Properties

Property Modifier Type Inherited from
code readonly string | null MemoryAPIError` <#memoryapierror>`__.code<#property-code>__
responseText readonly string | null MemoryAPIError` <#memoryapierror>`__.responseText<#property-responsetext>__
status readonly number | null MemoryAPIError` <#memoryapierror>`__.status<#property-status>__

MemoryNotSupportedError

Raised when an operation is unavailable in the active transport mode.

This is a client-side capability check raised before any HTTP request is attempted, so it carries no status code or response body.

Extends

  • `MemoryClientError \<#memoryclienterror>`__

Constructor

new MemoryNotSupportedError(message, options?): MemoryNotSupportedError;

Parameters

Parameter Type
message string
options? ErrorOptions

Returns

`MemoryNotSupportedError \<#memorynotsupportederror>`__

Overrides

`MemoryClientError \<#memoryclienterror>`__. `constructor \<#constructor-5>`__


MemoryRouteNotFoundError

Raised when a core-loop request 404s, hinting a route-shape mismatch.

The SDK selects the route shape from projectId presence (set => project-scoped Gateway routes; empty => flat OE routes). A 404 on a core-loop POST most often means that shape does not match the backend the baseUrl points at, so this carries a directional, actionable hint rather than the opaque 404. It extends MemoryBadRequestError so existing 4xx handling still catches it.

Extends

  • `MemoryBadRequestError \<#memorybadrequesterror>`__

Constructor

new MemoryRouteNotFoundError(message, opts?): MemoryRouteNotFoundError;

Parameters

Parameter Type
message string
opts? { code?: string | null; responseText?: string | null; status?: number | null; }
opts.code? string | null
opts.responseText? string | null
opts.status? number | null

Returns

`MemoryRouteNotFoundError \<#memoryroutenotfounderror>`__

Overrides

`MemoryBadRequestError \<#me

(本文超出站点单文档体积上限,已截断)