Skip to content

@codesoul-co/hypha-memory / external-adapters

Using this module

Use the External adapters module for binding external or local providers to Hypha ports. It exports 4 classes, 2 constants, 2 functions, 9 interfaces, 2 types.

Import from the package entrypoint

ts
import {
  ExternalMemoryManagementAdapter,
  InMemoryExternalMemoryMappingStore,
  Mem0MemoryManagementAdapter,
  MemoryBankMemoryManagementAdapter,
  externalMemoryMappingSchema,
  unsupportedMemoryManagementCapabilities,
  negotiateMemoryManagementCapabilities,
  resolveExternalMemoryMappingStore,
} from '@codesoul-co/hypha-memory';

import type {
  ExternalMemoryAdapterOptions,
  ExternalMemoryClient,
  ExternalMemoryMapping,
  ExternalMemoryMappingBinding,
  ExternalMemoryMappingStore,
  ExternalProviderStateChange,
  Mem0MemoryManagementAdapterOptions,
  MemoryBankMemoryManagementAdapterOptions,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

  • Use the 11 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 4 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 2 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
ExternalMemoryManagementAdapterclassnew ExternalMemoryManagementAdapter(options: ExternalMemoryAdapterOptions): ExternalMemoryManagementAdapterExternal Memory Management Adapter class with 12 public constructor or member entries; its exact declarations are listed below.
InMemoryExternalMemoryMappingStoreclassnew InMemoryExternalMemoryMappingStore(): InMemoryExternalMemoryMappingStoreIn Memory External Memory Mapping Store class with 6 public constructor or member entries; its exact declarations are listed below.
Mem0MemoryManagementAdapterclassnew Mem0MemoryManagementAdapter(options: Mem0MemoryManagementAdapterOptions): Mem0MemoryManagementAdapterMem0 Memory Management Adapter class with 13 public constructor or member entries; its exact declarations are listed below.
MemoryBankMemoryManagementAdapterclassnew MemoryBankMemoryManagementAdapter(options: MemoryBankMemoryManagementAdapterOptions): MemoryBankMemoryManagementAdapterMemory Bank Memory Management Adapter class with 13 public constructor or member entries; its exact declarations are listed below.
externalMemoryMappingSchemaconstantconst externalMemoryMappingSchema: ZodType<ExternalMemoryMapping, ZodTypeDef, ExternalMemoryMapping>Runtime schema for External Memory Mapping.
unsupportedMemoryManagementCapabilitiesconstantconst unsupportedMemoryManagementCapabilities: MemoryManagementCapabilitiesUnsupported Memory Management Capabilities constant exported by the external-adapters module.
negotiateMemoryManagementCapabilitiesfunctionnegotiateMemoryManagementCapabilities(value: unknown): MemoryManagementCapabilitiesNegotiate Memory Management Capabilities function with 1 public call signature; parameters and return types are listed below.
resolveExternalMemoryMappingStorefunctionresolveExternalMemoryMappingStore(store: ExternalMemoryMappingStore | undefined, profile: ExternalMemoryMappingRuntimeProfile): ExternalMemoryMappingStoreResolve External Memory Mapping Store function with 1 public call signature; parameters and return types are listed below.
ExternalMemoryAdapterOptionsinterfaceinterface ExternalMemoryAdapterOptionsExternal Memory Adapter Options interface with 11 public fields or methods.
ExternalMemoryClientinterfaceinterface ExternalMemoryClientExternal Memory Client interface with 10 public fields or methods.
ExternalMemoryMappinginterfaceinterface ExternalMemoryMappingExternal Memory Mapping interface with 8 public fields or methods.
ExternalMemoryMappingBindinginterfaceinterface ExternalMemoryMappingBindingExternal Memory Mapping Binding interface with 4 public fields or methods.
ExternalMemoryMappingStoreinterfaceinterface ExternalMemoryMappingStoreExternal Memory Mapping Store interface with 5 public fields or methods.
ExternalProviderStateChangeinterfaceinterface ExternalProviderStateChangeExternal Provider State Change interface with 4 public fields or methods.
Mem0MemoryManagementAdapterOptionsinterfaceinterface Mem0MemoryManagementAdapterOptions extends Omit<ExternalMemoryAdapterOptions, 'id'>Mem0 Memory Management Adapter Options interface with 12 public fields or methods.
MemoryBankMemoryManagementAdapterOptionsinterfaceinterface MemoryBankMemoryManagementAdapterOptions extends Omit<ExternalMemoryAdapterOptions, 'id'>Memory Bank Memory Management Adapter Options interface with 12 public fields or methods.
MemoryBankPolicySpecinterfaceinterface MemoryBankPolicySpecMemory Bank Policy Spec interface with 8 public fields or methods.
ExternalMemoryMappingRuntimeProfiletypetype ExternalMemoryMappingRuntimeProfile = 'production' | 'test' | 'ephemeral'Public type alias for External Memory Mapping Runtime Profile; the declaration contains its complete type expression.
ExternalMemoryMappingStoreDurabilitytypetype ExternalMemoryMappingStoreDurability = 'ephemeral' | 'durable'Public type alias for External Memory Mapping Store Durability; the declaration contains its complete type expression.

ExternalMemoryManagementAdapter

External Memory Management Adapter class with 12 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { ExternalMemoryManagementAdapter } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare class ExternalMemoryManagementAdapter implements MemoryManagementProvider {
    readonly id: string;
    constructor(options: ExternalMemoryAdapterOptions);
    capabilities(): Promise<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[]>;
    health(): Promise<ProviderHealth>;
    close(): Promise<void>;
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(): Promise<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: ExternalMemoryAdapterOptions): ExternalMemoryManagementAdapterCreates 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<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): 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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
listmethodlist(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>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.

InMemoryExternalMemoryMappingStore

In Memory External Memory Mapping Store class with 6 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { InMemoryExternalMemoryMappingStore } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare class InMemoryExternalMemoryMappingStore implements ExternalMemoryMappingStore {
    readonly durability: "ephemeral";
    get(providerId: string, memoryId: string): Promise<ExternalMemoryMapping | null>;
    getByExternalId(providerId: string, externalId: string): Promise<ExternalMemoryMapping | null>;
    set(mapping: ExternalMemoryMapping): Promise<void>;
    list(providerId: string): Promise<ExternalMemoryMapping[]>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): InMemoryExternalMemoryMappingStoreCreates an instance of this class.
durabilitypropertyreadonly durability: "ephemeral"Public property; its type, readonly modifier and optionality are shown in the signature.
getmethodget(providerId: string, memoryId: string): Promise<ExternalMemoryMapping | null>Public method; parameters and return type are shown in the signature.
getByExternalIdmethodgetByExternalId(providerId: string, externalId: string): Promise<ExternalMemoryMapping | null>Public method; parameters and return type are shown in the signature.
listmethodlist(providerId: string): Promise<ExternalMemoryMapping[]>Public method; parameters and return type are shown in the signature.
setmethodset(mapping: ExternalMemoryMapping): Promise<void>Public method; parameters and return type are shown in the signature.

Mem0MemoryManagementAdapter

Mem0 Memory Management Adapter class with 13 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { Mem0MemoryManagementAdapter } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare class Mem0MemoryManagementAdapter extends ExternalMemoryManagementAdapter {
    readonly deployment: 'managed' | 'self_hosted';
    constructor(options: Mem0MemoryManagementAdapterOptions);
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(): Promise<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: Mem0MemoryManagementAdapterOptions): Mem0MemoryManagementAdapterCreates an instance of this class.
deletemethoddelete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>Public method; parameters and return type are shown in the signature.
deploymentpropertyreadonly deployment: "self_hosted" | "managed"Public property; its type, readonly modifier and optionality are shown in the signature.
getmethodget(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): 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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
listmethodlist(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>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.

MemoryBankMemoryManagementAdapter

Memory Bank Memory Management Adapter class with 13 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { MemoryBankMemoryManagementAdapter } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare class MemoryBankMemoryManagementAdapter extends ExternalMemoryManagementAdapter {
    readonly policy: MemoryBankPolicySpec;
    constructor(options: MemoryBankMemoryManagementAdapterOptions);
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(): Promise<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: MemoryBankMemoryManagementAdapterOptions): MemoryBankMemoryManagementAdapterCreates 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<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): 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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
listmethodlist(request: MemoryListRequest, signal?: AbortSignal): Promise<MemoryListResult>Public method; parameters and return type are shown in the signature.
policypropertyreadonly policy: MemoryBankPolicySpecPublic property; its type, readonly modifier and optionality 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.

externalMemoryMappingSchema

Runtime schema for External Memory Mapping.

  • Kind: constant
  • Import: import { externalMemoryMappingSchema } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare const externalMemoryMappingSchema: ZodType<ExternalMemoryMapping, ZodTypeDef, ExternalMemoryMapping>;

unsupportedMemoryManagementCapabilities

Unsupported Memory Management Capabilities constant exported by the external-adapters module.

  • Kind: constant
  • Import: import { unsupportedMemoryManagementCapabilities } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare const unsupportedMemoryManagementCapabilities: MemoryManagementCapabilities;

negotiateMemoryManagementCapabilities

Negotiate Memory Management Capabilities function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { negotiateMemoryManagementCapabilities } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare function negotiateMemoryManagementCapabilities(value: unknown): MemoryManagementCapabilities;

Call signature

text
negotiateMemoryManagementCapabilities(value: unknown): MemoryManagementCapabilities

Parameters

ParameterTypeRequiredDescription
valueunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: MemoryManagementCapabilities
  • Description: The return contract is defined by the type shown above.

resolveExternalMemoryMappingStore

Resolve External Memory Mapping Store function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { resolveExternalMemoryMappingStore } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export declare function resolveExternalMemoryMappingStore(store: ExternalMemoryMappingStore | undefined, profile: ExternalMemoryMappingRuntimeProfile): ExternalMemoryMappingStore;

Call signature

text
resolveExternalMemoryMappingStore(store: ExternalMemoryMappingStore | undefined, profile: ExternalMemoryMappingRuntimeProfile): ExternalMemoryMappingStore

Parameters

ParameterTypeRequiredDescription
storeExternalMemoryMappingStoreYesRequired parameter; accepted values are defined by the type column.
profileExternalMemoryMappingRuntimeProfileYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: ExternalMemoryMappingStore
  • Description: The return contract is defined by the type shown above.

ExternalMemoryAdapterOptions

External Memory Adapter Options interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalMemoryAdapterOptions } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalMemoryAdapterOptions {
    id: string;
    client: ExternalMemoryClient;
    fallback?: MemoryManagementProvider;
    fallbackPolicy?: MemoryFallbackPolicySpec;
    mappingStore?: ExternalMemoryMappingStore;
    mappingProfile?: ExternalMemoryMappingRuntimeProfile;
    timeoutMs?: number;
    retryAttempts?: number;
    circuitBreaker?: {
        failureThreshold: number;
        resetAfterMs: number;
    };
    now?: () => Date;
    onStateChange?: (event: ExternalProviderStateChange) => void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
circuitBreakerpropertycircuitBreaker?: { failureThreshold: number; resetAfterMs: number; }Public property; its type, readonly modifier and optionality are shown in the signature.
clientpropertyclient: ExternalMemoryClientPublic property; its type, readonly modifier and optionality are shown in the signature.
fallbackpropertyfallback?: MemoryManagementProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
fallbackPolicypropertyfallbackPolicy?: MemoryFallbackPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality 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.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
onStateChangemethodonStateChange?(event: ExternalProviderStateChange): void | Promise<void>Public method; parameters and return type are shown in the signature.
retryAttemptspropertyretryAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutMspropertytimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalMemoryClient

External Memory Client interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalMemoryClient } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalMemoryClient {
    capabilities(signal?: AbortSignal): 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[]>;
    health(signal?: AbortSignal): Promise<ProviderHealth>;
    close?(): Promise<void>;
}

Contract members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(signal?: AbortSignal): 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.
deletemethoddelete(request: ManagedMemoryDeleteRequest, signal?: AbortSignal): Promise<ManagedMemoryDeleteResult>Public method; parameters and return type are shown in the signature.
getmethodget(request: MemoryGetRequest, signal?: AbortSignal): Promise<ManagedMemoryRecord | null>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.
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.

ExternalMemoryMapping

External Memory Mapping interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalMemoryMapping } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalMemoryMapping {
    memoryId: string;
    providerId: string;
    externalId: string;
    externalVersion?: string;
    binding: ExternalMemoryMappingBinding;
    lastSyncedAt: string;
    syncState: 'synced' | 'pending' | 'failed' | 'deleted';
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
bindingpropertybinding: ExternalMemoryMappingBindingPublic property; its type, readonly modifier and optionality are shown in the signature.
externalIdpropertyexternalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
externalVersionpropertyexternalVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastSyncedAtpropertylastSyncedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryIdpropertymemoryId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public 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.
syncStatepropertysyncState: "failed" | "deleted" | "pending" | "synced"Public property; its type, readonly modifier and optionality are shown in the signature.

ExternalMemoryMappingBinding

External Memory Mapping Binding interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalMemoryMappingBinding } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalMemoryMappingBinding {
    scopeHash: string;
    profileRef?: MemoryContractSpecRef;
    recordRevision: number;
    provenance: MemoryProvenance;
}

Contract members

MemberKindSignatureDescription
profileRefpropertyprofileRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
provenancepropertyprovenance: MemoryProvenancePublic property; its type, readonly modifier and optionality are shown in the signature.
recordRevisionpropertyrecordRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalMemoryMappingStore

External Memory Mapping Store interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalMemoryMappingStore } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalMemoryMappingStore {
    readonly durability: ExternalMemoryMappingStoreDurability;
    get(providerId: string, memoryId: string): Promise<ExternalMemoryMapping | null>;
    getByExternalId(providerId: string, externalId: string): Promise<ExternalMemoryMapping | null>;
    set(mapping: ExternalMemoryMapping): Promise<void>;
    list(providerId: string): Promise<ExternalMemoryMapping[]>;
}

Contract members

MemberKindSignatureDescription
durabilitypropertyreadonly durability: ExternalMemoryMappingStoreDurabilityPublic property; its type, readonly modifier and optionality are shown in the signature.
getmethodget(providerId: string, memoryId: string): Promise<ExternalMemoryMapping | null>Public method; parameters and return type are shown in the signature.
getByExternalIdmethodgetByExternalId(providerId: string, externalId: string): Promise<ExternalMemoryMapping | null>Public method; parameters and return type are shown in the signature.
listmethodlist(providerId: string): Promise<ExternalMemoryMapping[]>Public method; parameters and return type are shown in the signature.
setmethodset(mapping: ExternalMemoryMapping): Promise<void>Public method; parameters and return type are shown in the signature.

ExternalProviderStateChange

External Provider State Change interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ExternalProviderStateChange } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface ExternalProviderStateChange {
    type: 'degraded' | 'recovered' | 'circuit_opened' | 'quarantined';
    providerId: string;
    occurredAt: string;
    error?: NormalizedMemoryError;
}

Contract members

MemberKindSignatureDescription
errorpropertyerror?: NormalizedMemoryErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
occurredAtpropertyoccurredAt: stringPublic 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.
typepropertytype: "degraded" | "quarantined" | "recovered" | "circuit_opened"Public property; its type, readonly modifier and optionality are shown in the signature.

Mem0MemoryManagementAdapterOptions

Mem0 Memory Management Adapter Options interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { Mem0MemoryManagementAdapterOptions } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface Mem0MemoryManagementAdapterOptions extends Omit<ExternalMemoryAdapterOptions, 'id'> {
    id?: string;
    deployment?: 'managed' | 'self_hosted';
}

Contract members

MemberKindSignatureDescription
circuitBreakerpropertycircuitBreaker?: { failureThreshold: number; resetAfterMs: number; }Public property; its type, readonly modifier and optionality are shown in the signature.
clientpropertyclient: ExternalMemoryClientPublic property; its type, readonly modifier and optionality are shown in the signature.
deploymentpropertydeployment?: "self_hosted" | "managed"Public property; its type, readonly modifier and optionality are shown in the signature.
fallbackpropertyfallback?: MemoryManagementProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
fallbackPolicypropertyfallbackPolicy?: MemoryFallbackPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid?: stringPublic property; its type, readonly modifier and optionality 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.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
onStateChangemethodonStateChange?(event: ExternalProviderStateChange): void | Promise<void>Public method; parameters and return type are shown in the signature.
retryAttemptspropertyretryAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutMspropertytimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryBankMemoryManagementAdapterOptions

Memory Bank Memory Management Adapter Options interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryBankMemoryManagementAdapterOptions } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface MemoryBankMemoryManagementAdapterOptions extends Omit<ExternalMemoryAdapterOptions, 'id'> {
    id?: string;
    policy: MemoryBankPolicySpec;
}

Contract members

MemberKindSignatureDescription
circuitBreakerpropertycircuitBreaker?: { failureThreshold: number; resetAfterMs: number; }Public property; its type, readonly modifier and optionality are shown in the signature.
clientpropertyclient: ExternalMemoryClientPublic property; its type, readonly modifier and optionality are shown in the signature.
fallbackpropertyfallback?: MemoryManagementProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
fallbackPolicypropertyfallbackPolicy?: MemoryFallbackPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid?: stringPublic property; its type, readonly modifier and optionality 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.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
onStateChangemethodonStateChange?(event: ExternalProviderStateChange): void | Promise<void>Public method; parameters and return type are shown in the signature.
policypropertypolicy: MemoryBankPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
retryAttemptspropertyretryAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutMspropertytimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryBankPolicySpec

Memory Bank Policy Spec interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryBankPolicySpec } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export interface MemoryBankPolicySpec {
    extractionProfileRef?: import('./contracts').MemoryContractSpecRef;
    importanceThreshold?: number;
    reinforcementFactor?: number;
    decayFunction?: 'exponential' | 'linear' | 'custom';
    decayHalfLifeSeconds?: number;
    consolidationThreshold?: number;
    consolidationMinItems?: number;
    preserveOriginals?: boolean;
}

Contract members

MemberKindSignatureDescription
consolidationMinItemspropertyconsolidationMinItems?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
consolidationThresholdpropertyconsolidationThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
decayFunctionpropertydecayFunction?: "custom" | "exponential" | "linear"Public property; its type, readonly modifier and optionality are shown in the signature.
decayHalfLifeSecondspropertydecayHalfLifeSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
extractionProfileRefpropertyextractionProfileRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
importanceThresholdpropertyimportanceThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
preserveOriginalspropertypreserveOriginals?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
reinforcementFactorpropertyreinforcementFactor?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExternalMemoryMappingRuntimeProfile

Public type alias for External Memory Mapping Runtime Profile; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { ExternalMemoryMappingRuntimeProfile } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export type ExternalMemoryMappingRuntimeProfile = 'production' | 'test' | 'ephemeral';

ExternalMemoryMappingStoreDurability

Public type alias for External Memory Mapping Store Durability; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { ExternalMemoryMappingStoreDurability } from '@codesoul-co/hypha-memory';
  • Source module: external-adapters

Declaration

text
export type ExternalMemoryMappingStoreDurability = 'ephemeral' | 'durable';