Skip to content

@codesoul-co/hypha-memory / index-outbox

Using this module

Use the Index outbox module for using the public contracts and operations for this capability boundary. It exports 3 classes, 8 interfaces.

Import from the package entrypoint

ts
import {
  IndexOutboxWorker,
  InMemoryLocalVectorStoreAdapter,
  LegacyVectorIndexStoreAdapter,
} from '@codesoul-co/hypha-memory';

import type {
  IndexOutboxWorkerEvent,
  IndexOutboxWorkerOptions,
  IndexOutboxWorkerRunResult,
  ManagedVectorPoint,
  ManagedVectorSearchRequest,
  ManagedVectorSearchResult,
  ManagedVectorStoreAdapter,
  ManagedVectorWriteOptions,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 8 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 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
IndexOutboxWorkerclassnew IndexOutboxWorker(options: IndexOutboxWorkerOptions): IndexOutboxWorkerIndex Outbox Worker class with 6 public constructor or member entries; its exact declarations are listed below.
InMemoryLocalVectorStoreAdapterclassnew InMemoryLocalVectorStoreAdapter(id?: string): InMemoryLocalVectorStoreAdapterIn Memory Local Vector Store Adapter class with 6 public constructor or member entries; its exact declarations are listed below.
LegacyVectorIndexStoreAdapterclassnew LegacyVectorIndexStoreAdapter(id: string, provider: VectorIndexProvider): LegacyVectorIndexStoreAdapterLegacy Vector Index Store Adapter class with 6 public constructor or member entries; its exact declarations are listed below.
IndexOutboxWorkerEventinterfaceinterface IndexOutboxWorkerEventIndex Outbox Worker Event interface with 7 public fields or methods.
IndexOutboxWorkerOptionsinterfaceinterface IndexOutboxWorkerOptionsIndex Outbox Worker Options interface with 14 public fields or methods.
IndexOutboxWorkerRunResultinterfaceinterface IndexOutboxWorkerRunResultIndex Outbox Worker Run Result interface with 4 public fields or methods.
ManagedVectorPointinterfaceinterface ManagedVectorPointManaged Vector Point interface with 3 public fields or methods.
ManagedVectorSearchRequestinterfaceinterface ManagedVectorSearchRequestManaged Vector Search Request interface with 4 public fields or methods.
ManagedVectorSearchResultinterfaceinterface ManagedVectorSearchResultManaged Vector Search Result interface with 3 public fields or methods.
ManagedVectorStoreAdapterinterfaceinterface ManagedVectorStoreAdapterManaged Vector Store Adapter interface with 5 public fields or methods.
ManagedVectorWriteOptionsinterfaceinterface ManagedVectorWriteOptionsManaged Vector Write Options interface with 2 public fields or methods.

IndexOutboxWorker

Index Outbox Worker class with 6 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { IndexOutboxWorker } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export declare class IndexOutboxWorker {
    constructor(options: IndexOutboxWorkerOptions);
    runOnce(): Promise<IndexOutboxWorkerRunResult>;
    start(): void;
    stop(): void;
    drain(): Promise<void>;
    stopAndDrain(): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: IndexOutboxWorkerOptions): IndexOutboxWorkerCreates an instance of this class.
drainmethoddrain(): Promise<void>Public method; parameters and return type are shown in the signature.
runOncemethodrunOnce(): Promise<IndexOutboxWorkerRunResult>Public method; parameters and return type are shown in the signature.
startmethodstart(): voidPublic method; parameters and return type are shown in the signature.
stopmethodstop(): voidPublic method; parameters and return type are shown in the signature.
stopAndDrainmethodstopAndDrain(): Promise<void>Public method; parameters and return type are shown in the signature.

InMemoryLocalVectorStoreAdapter

In Memory Local Vector Store Adapter class with 6 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { InMemoryLocalVectorStoreAdapter } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export declare class InMemoryLocalVectorStoreAdapter implements ManagedVectorStoreAdapter {
    readonly id: string;
    constructor(id?: string);
    upsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>;
    delete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>;
    search(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>;
    health(): Promise<ProviderHealth>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(id?: string): InMemoryLocalVectorStoreAdapterCreates an instance of this class.
deletemethoddelete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
searchmethodsearch(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>Public method; parameters and return type are shown in the signature.
upsertmethodupsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>Public method; parameters and return type are shown in the signature.

LegacyVectorIndexStoreAdapter

Legacy Vector Index Store Adapter class with 6 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { LegacyVectorIndexStoreAdapter } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export declare class LegacyVectorIndexStoreAdapter implements ManagedVectorStoreAdapter {
    readonly id: string;
    constructor(id: string, provider: VectorIndexProvider);
    upsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>;
    delete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>;
    search(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>;
    health(): Promise<ProviderHealth>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(id: string, provider: VectorIndexProvider): LegacyVectorIndexStoreAdapterCreates an instance of this class.
deletemethoddelete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
searchmethodsearch(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>Public method; parameters and return type are shown in the signature.
upsertmethodupsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>Public method; parameters and return type are shown in the signature.

IndexOutboxWorkerEvent

Index Outbox Worker Event interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { IndexOutboxWorkerEvent } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface IndexOutboxWorkerEvent {
    type: 'memory.index.started' | 'memory.index.completed' | 'memory.index.partial' | 'memory.index.failed';
    operationId: string;
    outboxId: string;
    memoryId: string;
    memoryVersionId: string;
    scopeHash: string;
    error?: NormalizedMemoryError;
}

Contract members

MemberKindSignatureDescription
errorpropertyerror?: NormalizedMemoryErrorPublic 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.
memoryVersionIdpropertymemoryVersionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outboxIdpropertyoutboxId: stringPublic 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.
typepropertytype: "memory.index.started" | "memory.index.completed" | "memory.index.partial" | "memory.index.failed"Public property; its type, readonly modifier and optionality are shown in the signature.

IndexOutboxWorkerOptions

Index Outbox Worker Options interface with 14 public fields or methods.

  • Kind: interface
  • Import: import type { IndexOutboxWorkerOptions } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface IndexOutboxWorkerOptions {
    ownerId: string;
    outboxStore: MemoryIndexOutboxStore;
    recordStore: ManagedMemoryRecordStore;
    embeddingProvider: EmbeddingProvider;
    vectorStores: ManagedVectorStoreAdapter[];
    batchSize?: number;
    leaseMs?: number;
    renewalMs?: number;
    maxAttempts?: number;
    retryDelayMs?: number;
    pollIntervalMs?: number;
    now?: () => Date;
    onEvent?: (event: IndexOutboxWorkerEvent) => void | Promise<void>;
    onError?: (error: NormalizedMemoryError) => void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
batchSizepropertybatchSize?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
embeddingProviderpropertyembeddingProvider: EmbeddingProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseMspropertyleaseMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxAttemptspropertymaxAttempts?: 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.
onErrormethodonError?(error: NormalizedMemoryError): void | Promise<void>Public method; parameters and return type are shown in the signature.
onEventmethodonEvent?(event: IndexOutboxWorkerEvent): void | Promise<void>Public method; parameters and return type are shown in the signature.
outboxStorepropertyoutboxStore: MemoryIndexOutboxStorePublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
pollIntervalMspropertypollIntervalMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
recordStorepropertyrecordStore: ManagedMemoryRecordStorePublic property; its type, readonly modifier and optionality are shown in the signature.
renewalMspropertyrenewalMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
retryDelayMspropertyretryDelayMs?: numberPublic 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.

IndexOutboxWorkerRunResult

Index Outbox Worker Run Result interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { IndexOutboxWorkerRunResult } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface IndexOutboxWorkerRunResult {
    leased: number;
    completed: number;
    failed: number;
    deadLettered: number;
}

Contract members

MemberKindSignatureDescription
completedpropertycompleted: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deadLetteredpropertydeadLettered: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
failedpropertyfailed: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
leasedpropertyleased: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ManagedVectorPoint

Managed Vector Point interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { ManagedVectorPoint } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface ManagedVectorPoint {
    id: string;
    vector: number[];
    metadata: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
idpropertyid: 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.
vectorpropertyvector: number[]Public property; its type, readonly modifier and optionality are shown in the signature.

ManagedVectorSearchRequest

Managed Vector Search Request interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ManagedVectorSearchRequest } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface ManagedVectorSearchRequest {
    vector: number[];
    topK: number;
    filter?: Record<string, unknown>;
    scoreThreshold?: number;
}

Contract members

MemberKindSignatureDescription
filterpropertyfilter?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
scoreThresholdpropertyscoreThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
topKpropertytopK: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorpropertyvector: number[]Public property; its type, readonly modifier and optionality are shown in the signature.

ManagedVectorSearchResult

Managed Vector Search Result interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { ManagedVectorSearchResult } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface ManagedVectorSearchResult {
    id: string;
    score: number;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
idpropertyid: 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.
scorepropertyscore: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ManagedVectorStoreAdapter

Managed Vector Store Adapter interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ManagedVectorStoreAdapter } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface ManagedVectorStoreAdapter {
    readonly id: string;
    upsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>;
    delete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>;
    search(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>;
    health(): Promise<ProviderHealth>;
}

Contract members

MemberKindSignatureDescription
deletemethoddelete(ids: string[], options?: ManagedVectorWriteOptions): Promise<void>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.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
searchmethodsearch(request: ManagedVectorSearchRequest): Promise<ManagedVectorSearchResult[]>Public method; parameters and return type are shown in the signature.
upsertmethodupsert(points: ManagedVectorPoint[], options?: ManagedVectorWriteOptions): Promise<void>Public method; parameters and return type are shown in the signature.

ManagedVectorWriteOptions

Managed Vector Write Options interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { ManagedVectorWriteOptions } from '@codesoul-co/hypha-memory';
  • Source module: index-outbox

Declaration

text
export interface ManagedVectorWriteOptions {
    fencingToken?: number;
    memoryRevision?: number;
}

Contract members

MemberKindSignatureDescription
fencingTokenpropertyfencingToken?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryRevisionpropertymemoryRevision?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.