@codesoul-co/hypha-memory / mem0-rest-client
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/mem0-rest-client.ts - Exports: 6
Using this module
Use the Mem0 rest client module for binding external or local providers to Hypha ports. It exports 2 classes, 2 interfaces, 2 types.
Import from the package entrypoint
ts
import {
Mem0OssClient,
Mem0RestClient,
} from '@codesoul-co/hypha-memory';
import type {
Mem0HttpResponse,
Mem0OssClientOptions,
Mem0HttpFetch,
Mem0RestClientOptions,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 4 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 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
Mem0OssClient | class | new Mem0OssClient(options: Mem0OssClientOptions): Mem0OssClient | Mem0 Oss Client class with 12 public constructor or member entries; its exact declarations are listed below. |
Mem0RestClient | class | new Mem0RestClient(options: Mem0RestClientOptions): Mem0RestClient | Mem0 Rest Client class with 12 public constructor or member entries; its exact declarations are listed below. |
Mem0HttpResponse | interface | interface Mem0HttpResponse | Mem0 Http Response interface with 6 public fields or methods. |
Mem0OssClientOptions | interface | interface Mem0OssClientOptions | Mem0 Oss Client Options interface with 16 public fields or methods. |
Mem0HttpFetch | type | type Mem0HttpFetch = (url: string, init?: { method?: string; headers?: Record<string, string>; body?: string; signal?: AbortSignal; }) => Promise<Mem0HttpResponse> | Public type alias for Mem0 Http Fetch; the declaration contains its complete type expression. |
Mem0RestClientOptions | type | type Mem0RestClientOptions = Mem0OssClientOptions & { deployment?: 'self_hosted'; } | Public type alias for Mem0 Rest Client Options; the declaration contains its complete type expression. |
Mem0OssClient
Mem0 Oss Client class with 12 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { Mem0OssClient } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export declare class Mem0OssClient implements ExternalMemoryClient {
constructor(options: Mem0OssClientOptions);
capabilities(): Promise<Partial<MemoryManagementCapabilities>>;
add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
search(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>;
get(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | 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[]>;
reconcile(operationId: string, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]>;
health(signal?: AbortSignal): Promise<ProviderHealth>;
close(): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
add | method | add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult> | Public method; parameters and return type are shown in the signature. |
capabilities | method | capabilities(): Promise<Partial<MemoryManagementCapabilities>> | Public method; parameters and return type are shown in the signature. |
close | method | close(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: Mem0OssClientOptions): Mem0OssClient | Creates an instance of this class. |
delete | method | delete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult> | Public method; parameters and return type are shown in the signature. |
get | method | get(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null> | Public method; parameters and return type are shown in the signature. |
health | method | health(signal?: AbortSignal): Promise<ProviderHealth> | Public method; parameters and return type are shown in the signature. |
history | method | history(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]> | Public method; parameters and return type are shown in the signature. |
list | method | list(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult> | Public method; parameters and return type are shown in the signature. |
reconcile | method | reconcile(operationId: string, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]> | Public method; parameters and return type are shown in the signature. |
search | method | search(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]> | Public method; parameters and return type are shown in the signature. |
update | method | update(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult> | Public method; parameters and return type are shown in the signature. |
Mem0RestClient
Mem0 Rest Client class with 12 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { Mem0RestClient } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export declare class Mem0RestClient extends Mem0OssClient {
constructor(options: Mem0RestClientOptions);
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
add | method | add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult> | Public method; parameters and return type are shown in the signature. |
capabilities | method | capabilities(): Promise<Partial<MemoryManagementCapabilities>> | Public method; parameters and return type are shown in the signature. |
close | method | close(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: Mem0RestClientOptions): Mem0RestClient | Creates an instance of this class. |
delete | method | delete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult> | Public method; parameters and return type are shown in the signature. |
get | method | get(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null> | Public method; parameters and return type are shown in the signature. |
health | method | health(signal?: AbortSignal): Promise<ProviderHealth> | Public method; parameters and return type are shown in the signature. |
history | method | history(request: MemoryHistoryRequest, signal?: AbortSignal): Promise<MemoryVersion[]> | Public method; parameters and return type are shown in the signature. |
list | method | list(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult> | Public method; parameters and return type are shown in the signature. |
reconcile | method | reconcile(operationId: string, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]> | Public method; parameters and return type are shown in the signature. |
search | method | search(request: ManagedMemorySearchRequest, signal?: AbortSignal): Promise<ManagedMemorySearchResult[]> | Public method; parameters and return type are shown in the signature. |
update | method | update(request: ManagedMemoryUpdateRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult> | Public method; parameters and return type are shown in the signature. |
Mem0HttpResponse
Mem0 Http Response interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { Mem0HttpResponse } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export interface Mem0HttpResponse {
ok: boolean;
status: number;
statusText: string;
headers?: {
get(name: string): string | null;
};
json(): Promise<unknown>;
text(): Promise<string>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
headers | property | headers?: { get(name: string): string | null; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
json | method | json(): Promise<unknown> | Public method; parameters and return type are shown in the signature. |
ok | property | ok: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
statusText | property | statusText: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
text | method | text(): Promise<string> | Public method; parameters and return type are shown in the signature. |
Mem0OssClientOptions
Mem0 Oss Client Options interface with 16 public fields or methods.
- Kind: interface
- Import:
import type { Mem0OssClientOptions } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export interface Mem0OssClientOptions {
baseUrl: string;
apiKey?: string;
authMode?: 'x-api-key' | 'bearer' | 'none';
fetch?: Mem0HttpFetch;
providerId?: string;
healthPath?: string;
now?: () => Date;
mappingStore?: ExternalMemoryMappingStore;
mappingProfile?: ExternalMemoryMappingRuntimeProfile;
operationStore?: ExternalProviderOperationStore;
operationProfile?: ExternalMemoryMappingRuntimeProfile;
providerVersion?: string;
expectedProviderVersion?: string;
expectedCapabilities?: Partial<MemoryManagementCapabilities>;
listPaginationMode?: 'top-k-offset' | 'provider-cursor';
allowInsecureForTests?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
allowInsecureForTests | property | allowInsecureForTests?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
apiKey | property | apiKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
authMode | property | authMode?: "none" | "x-api-key" | "bearer" | Public property; its type, readonly modifier and optionality are shown in the signature. |
baseUrl | property | baseUrl: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedCapabilities | property | expectedCapabilities?: Partial<MemoryManagementCapabilities> | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedProviderVersion | property | expectedProviderVersion?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
fetch | method | fetch?(url: string, init?: { method?: string; headers?: Record<string, string>; body?: string; signal?: AbortSignal; }): Promise<Mem0HttpResponse> | Public method; parameters and return type are shown in the signature. |
healthPath | property | healthPath?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
listPaginationMode | property | listPaginationMode?: "top-k-offset" | "provider-cursor" | Public property; its type, readonly modifier and optionality are shown in the signature. |
mappingProfile | property | mappingProfile?: ExternalMemoryMappingRuntimeProfile | Public property; its type, readonly modifier and optionality are shown in the signature. |
mappingStore | property | mappingStore?: ExternalMemoryMappingStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
now | method | now?(): Date | Public method; parameters and return type are shown in the signature. |
operationProfile | property | operationProfile?: ExternalMemoryMappingRuntimeProfile | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationStore | property | operationStore?: ExternalProviderOperationStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerVersion | property | providerVersion?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
Mem0HttpFetch
Public type alias for Mem0 Http Fetch; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { Mem0HttpFetch } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export type Mem0HttpFetch = (url: string, init?: {
method?: string;
headers?: Record<string, string>;
body?: string;
signal?: AbortSignal;
}) => Promise<Mem0HttpResponse>;Mem0RestClientOptions
Public type alias for Mem0 Rest Client Options; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { Mem0RestClientOptions } from '@codesoul-co/hypha-memory'; - Source module:
mem0-rest-client
Declaration
text
export type Mem0RestClientOptions = Mem0OssClientOptions & {
deployment?: 'self_hosted';
};