Skip to content

@codesoul-co/hypha-memory / mem0-platform-client

Using this module

Use the Mem0 platform client module for binding external or local providers to Hypha ports. It exports 1 class, 2 interfaces.

Import from the package entrypoint

ts
import {
  Mem0PlatformClient,
} from '@codesoul-co/hypha-memory';

import type {
  Mem0PlatformClientOptions,
  Mem0PlatformEvent,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
Mem0PlatformClientclassnew Mem0PlatformClient(options: Mem0PlatformClientOptions): Mem0PlatformClientClient for the documented Mem0 Platform v3 additive/search/list protocol.
Mem0PlatformClientOptionsinterfaceinterface Mem0PlatformClientOptionsMem0 Platform Client Options interface with 15 public fields or methods.
Mem0PlatformEventinterfaceinterface Mem0PlatformEventMem0 Platform Event interface with 4 public fields or methods.

Mem0PlatformClient

Client for the documented Mem0 Platform v3 additive/search/list protocol.

  • Kind: class
  • Import: import { Mem0PlatformClient } from '@codesoul-co/hypha-memory';
  • Source module: mem0-platform-client

Declaration

text
export declare class Mem0PlatformClient implements ExternalMemoryClient {
    constructor(options: Mem0PlatformClientOptions);
    capabilities(): Promise<Partial<MemoryManagementCapabilities>>;
    add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
    search(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>;
    get(request: MemoryGetRequest, signal?: AbortSignal): Promise<import("./contracts").ManagedMemoryRecord<unknown> | null>;
    list(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>;
    update(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
    delete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>;
    history(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]>;
    health(signal?: AbortSignal): Promise<ProviderHealth>;
    close(): Promise<void>;
    getEvent(eventId: string, signal?: AbortSignal): Promise<Mem0PlatformEvent>;
    resumeEvent(operationId: string, signal?: AbortSignal): Promise<Mem0PlatformEvent | null>;
    reconcile(operationId: string, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>;
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(): Promise<Partial<MemoryManagementCapabilities>>Public method; parameters and return type are shown in the signature.
closemethodclose(): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: Mem0PlatformClientOptions): Mem0PlatformClientCreates an instance of this class.
deletemethoddelete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>Public method; parameters and return type are shown in the signature.
getmethodget(request: MemoryGetRequest, signal?: AbortSignal): Promise<import("./contracts").ManagedMemoryRecord<unknown> | null>Public method; parameters and return type are shown in the signature.
getEventmethodgetEvent(eventId: string, signal?: AbortSignal): Promise<Mem0PlatformEvent>Public method; parameters and return type are shown in the signature.
healthmethodhealth(signal?: AbortSignal): Promise<ProviderHealth>Public method; parameters and return type are shown in the signature.
historymethodhistory(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]>Public method; parameters and return type are shown in the signature.
listmethodlist(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>Public method; parameters and return type are shown in the signature.
reconcilemethodreconcile(operationId: string, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>Public method; parameters and return type are shown in the signature.
resumeEventmethodresumeEvent(operationId: string, signal?: AbortSignal): Promise<Mem0PlatformEvent | null>Public method; parameters and return type are shown in the signature.
searchmethodsearch(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>Public method; parameters and return type are shown in the signature.
updatemethodupdate(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.

Mem0PlatformClientOptions

Mem0 Platform Client Options interface with 15 public fields or methods.

  • Kind: interface
  • Import: import type { Mem0PlatformClientOptions } from '@codesoul-co/hypha-memory';
  • Source module: mem0-platform-client

Declaration

text
export interface Mem0PlatformClientOptions {
    baseUrl?: string;
    apiToken?: string;
    credentialProvider?: RenewableCredentialProvider;
    fetch?: Mem0HttpFetch;
    providerId?: string;
    mappingStore?: ExternalMemoryMappingStore;
    mappingProfile?: ExternalMemoryMappingRuntimeProfile;
    operationStore?: ExternalProviderOperationStore;
    operationDeadlineMs?: number;
    maxOperationAttempts?: number;
    providerVersion?: string;
    expectedProviderVersion?: string;
    expectedCapabilities?: Partial<MemoryManagementCapabilities>;
    now?: () => Date;
    allowInsecureForTests?: boolean;
}

Contract members

MemberKindSignatureDescription
allowInsecureForTestspropertyallowInsecureForTests?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
apiTokenpropertyapiToken?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
baseUrlpropertybaseUrl?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
credentialProviderpropertycredentialProvider?: RenewableCredentialProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedCapabilitiespropertyexpectedCapabilities?: Partial<MemoryManagementCapabilities>Public property; its type, readonly modifier and optionality are shown in the signature.
expectedProviderVersionpropertyexpectedProviderVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fetchmethodfetch?(url: string, init?: { method?: string; headers?: Record<string, string>; body?: string; signal?: AbortSignal; }): Promise<import("/Users/erwin/Downloads/codespace/Hypha/packages/memory/dist/mem0-rest-client").Mem0HttpResponse>Public method; parameters and return type are shown in the signature.
mappingProfilepropertymappingProfile?: ExternalMemoryMappingRuntimeProfilePublic property; its type, readonly modifier and optionality are shown in the signature.
mappingStorepropertymappingStore?: ExternalMemoryMappingStorePublic property; its type, readonly modifier and optionality are shown in the signature.
maxOperationAttemptspropertymaxOperationAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
operationDeadlineMspropertyoperationDeadlineMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationStorepropertyoperationStore?: ExternalProviderOperationStorePublic property; its type, readonly modifier and optionality are shown in the signature.
providerIdpropertyproviderId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerVersionpropertyproviderVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

Mem0PlatformEvent

Mem0 Platform Event interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { Mem0PlatformEvent } from '@codesoul-co/hypha-memory';
  • Source module: mem0-platform-client

Declaration

text
export interface Mem0PlatformEvent {
    id: string;
    status: 'PENDING' | 'RUNNING' | 'FAILED' | 'SUCCEEDED';
    results?: unknown[];
    payload?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadpropertypayload?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
resultspropertyresults?: unknown[]Public property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "PENDING" | "RUNNING" | "FAILED" | "SUCCEEDED"Public property; its type, readonly modifier and optionality are shown in the signature.