Skip to content

@codesoul-co/hypha-memory / native-memory-runtime

Using this module

Use the Native memory runtime module for executing runtime behavior at this boundary. It exports 1 function, 2 interfaces.

Import from the package entrypoint

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

import type {
  NativeMemoryRuntimeDependencies,
  NativeMemoryRuntimeResources,
} 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 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
createNativeMemoryManagementProviderFactoryfunctioncreateNativeMemoryManagementProviderFactory(dependencies: NativeMemoryRuntimeDependencies): MemoryManagementProviderFactoryCreate Native Memory Management Provider Factory function with 1 public call signature; parameters and return types are listed below.
NativeMemoryRuntimeDependenciesinterfaceinterface NativeMemoryRuntimeDependenciesNative Memory Runtime Dependencies interface with 15 public fields or methods.
NativeMemoryRuntimeResourcesinterfaceinterface NativeMemoryRuntimeResourcesNative Memory Runtime Resources interface with 3 public fields or methods.

createNativeMemoryManagementProviderFactory

Create Native Memory Management Provider Factory function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createNativeMemoryManagementProviderFactory } from '@codesoul-co/hypha-memory';
  • Source module: native-memory-runtime

Declaration

text
export declare function createNativeMemoryManagementProviderFactory(dependencies: NativeMemoryRuntimeDependencies): MemoryManagementProviderFactory;

Call signature

text
createNativeMemoryManagementProviderFactory(dependencies: NativeMemoryRuntimeDependencies): MemoryManagementProviderFactory

Parameters

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

Returns

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

NativeMemoryRuntimeDependencies

Native Memory Runtime Dependencies interface with 15 public fields or methods.

  • Kind: interface
  • Import: import type { NativeMemoryRuntimeDependencies } from '@codesoul-co/hypha-memory';
  • Source module: native-memory-runtime

Declaration

text
export interface NativeMemoryRuntimeDependencies {
    structuredStore: StructuredStoreProvider;
    structuredStoreId: string;
    redisClient?: RedisLikeWorkingMemoryClient;
    embeddingProvider?: EmbeddingProvider;
    embeddingProviderId?: string;
    vectorStores: ManagedVectorStoreAdapter[];
    lifecycleHandlers?: Partial<Record<MemoryLifecycleWorkerType, MemoryLifecycleTaskHandler>>;
    ownerId: string;
    workingMemoryNamespace?: string;
    workingMemoryTtlSeconds?: number;
    events?: MemoryEventPublisher;
    onIndexEvent?: (event: IndexOutboxWorkerEvent) => void | Promise<void>;
    onLifecycleEvent?: (event: MemoryLifecycleWorkerEvent) => void | Promise<void>;
    now?: () => Date;
    close?: () => Promise<void>;
}

Contract members

MemberKindSignatureDescription
closemethodclose?(): Promise<void>Public method; parameters and return type are shown in the signature.
embeddingProviderpropertyembeddingProvider?: EmbeddingProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
embeddingProviderIdpropertyembeddingProviderId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
eventspropertyevents?: MemoryEventPublisherPublic property; its type, readonly modifier and optionality are shown in the signature.
lifecycleHandlerspropertylifecycleHandlers?: Partial<Record<MemoryLifecycleWorkerType, MemoryLifecycleTaskHandler>>Public property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
onIndexEventmethodonIndexEvent?(event: IndexOutboxWorkerEvent): void | Promise<void>Public method; parameters and return type are shown in the signature.
onLifecycleEventmethodonLifecycleEvent?(event: MemoryLifecycleWorkerEvent): void | Promise<void>Public method; parameters and return type are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
redisClientpropertyredisClient?: RedisLikeWorkingMemoryClientPublic property; its type, readonly modifier and optionality are shown in the signature.
structuredStorepropertystructuredStore: StructuredStoreProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
structuredStoreIdpropertystructuredStoreId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorStorespropertyvectorStores: ManagedVectorStoreAdapter[]Public property; its type, readonly modifier and optionality are shown in the signature.
workingMemoryNamespacepropertyworkingMemoryNamespace?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workingMemoryTtlSecondspropertyworkingMemoryTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

NativeMemoryRuntimeResources

Native Memory Runtime Resources interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { NativeMemoryRuntimeResources } from '@codesoul-co/hypha-memory';
  • Source module: native-memory-runtime

Declaration

text
export interface NativeMemoryRuntimeResources {
    workingStore: WorkingMemoryStore;
    lifecycleStore: StructuredMemoryLifecycleTaskStore;
    supervisor: MemoryWorkerSupervisor;
}

Contract members

MemberKindSignatureDescription
lifecycleStorepropertylifecycleStore: StructuredMemoryLifecycleTaskStorePublic property; its type, readonly modifier and optionality are shown in the signature.
supervisorpropertysupervisor: MemoryWorkerSupervisorPublic property; its type, readonly modifier and optionality are shown in the signature.
workingStorepropertyworkingStore: WorkingMemoryStorePublic property; its type, readonly modifier and optionality are shown in the signature.