Skip to content

@codesoul-co/hypha-memory / hindsight-local-client

Using this module

Use the Hindsight local client module for binding external or local providers to Hypha ports. It exports 1 class, 2 constants, 2 functions, 1 interface.

Import from the package entrypoint

ts
import {
  HindsightLocalMemoryBankClient,
  HINDSIGHT_LOCAL_PROTOCOL,
  HINDSIGHT_LOCAL_VERSION,
  bankIdForScope,
  documentIdForOperation,
} from '@codesoul-co/hypha-memory';

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

Usage patterns

  • Use the 1 type/interface export 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.
  • 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
HindsightLocalMemoryBankClientclassnew HindsightLocalMemoryBankClient(options: HindsightLocalMemoryBankClientOptions): HindsightLocalMemoryBankClientNative adapter for Hindsight Self-hosted HTTP API 0.8.
HINDSIGHT_LOCAL_PROTOCOLconstantconst HINDSIGHT_LOCAL_PROTOCOL: "hindsight.http.v0.8"HINDSIGHT LOCAL PROTOCOL constant exported by the hindsight-local-client module.
HINDSIGHT_LOCAL_VERSIONconstantconst HINDSIGHT_LOCAL_VERSION: "0.8.5"HINDSIGHT LOCAL VERSION constant exported by the hindsight-local-client module.
bankIdForScopefunctionbankIdForScope(scope: ManagedMemoryScope): stringBank ID For Scope function with 1 public call signature; parameters and return types are listed below.
documentIdForOperationfunctiondocumentIdForOperation(operationId: string): stringDocument ID For Operation function with 1 public call signature; parameters and return types are listed below.
HindsightLocalMemoryBankClientOptionsinterfaceinterface HindsightLocalMemoryBankClientOptionsHindsight Local Memory Bank Client Options interface with 12 public fields or methods.

HindsightLocalMemoryBankClient

Native adapter for Hindsight Self-hosted HTTP API 0.8.

  • Kind: class
  • Import: import { HindsightLocalMemoryBankClient } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export declare class HindsightLocalMemoryBankClient implements ExternalMemoryClient {
    readonly protocol: "hindsight.http.v0.8";
    constructor(options: HindsightLocalMemoryBankClientOptions);
    capabilities(signal?: AbortSignal): Promise<Partial<MemoryManagementCapabilities>>;
    add(request: MemoryAddRequest, signal?: AbortSignal): Promise<ManagedMemoryWriteResult>;
    reconcileOperation(operationId: string, signal?: AbortSignal): Promise<ManagedMemoryWriteResult | null>;
    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>;
}

Public 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.
constructorconstructor(options: HindsightLocalMemoryBankClientOptions): HindsightLocalMemoryBankClientCreates 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(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.
protocolpropertyreadonly protocol: "hindsight.http.v0.8"Public property; its type, readonly modifier and optionality are shown in the signature.
reconcileOperationmethodreconcileOperation(operationId: string, signal?: AbortSignal): Promise<ManagedMemoryWriteResult | 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.

HINDSIGHT_LOCAL_PROTOCOL

HINDSIGHT LOCAL PROTOCOL constant exported by the hindsight-local-client module.

  • Kind: constant
  • Import: import { HINDSIGHT_LOCAL_PROTOCOL } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export declare const HINDSIGHT_LOCAL_PROTOCOL: "hindsight.http.v0.8";

HINDSIGHT_LOCAL_VERSION

HINDSIGHT LOCAL VERSION constant exported by the hindsight-local-client module.

  • Kind: constant
  • Import: import { HINDSIGHT_LOCAL_VERSION } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export declare const HINDSIGHT_LOCAL_VERSION: "0.8.5";

bankIdForScope

Bank ID For Scope function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { bankIdForScope } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export declare function bankIdForScope(scope: ManagedMemoryScope): string;

Call signature

text
bankIdForScope(scope: ManagedMemoryScope): string

Parameters

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

Returns

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

documentIdForOperation

Document ID For Operation function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { documentIdForOperation } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export declare function documentIdForOperation(operationId: string): string;

Call signature

text
documentIdForOperation(operationId: string): string

Parameters

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

Returns

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

HindsightLocalMemoryBankClientOptions

Hindsight Local Memory Bank Client Options interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { HindsightLocalMemoryBankClientOptions } from '@codesoul-co/hypha-memory';
  • Source module: hindsight-local-client

Declaration

text
export interface HindsightLocalMemoryBankClientOptions {
    baseUrl: string;
    bearerToken?: string;
    fetch?: Mem0HttpFetch;
    providerId?: string;
    mappingStore?: ExternalMemoryMappingStore;
    mappingProfile?: ExternalMemoryMappingRuntimeProfile;
    operationStore?: ExternalProviderOperationStore;
    operationProfile?: ExternalMemoryMappingRuntimeProfile;
    profileRef?: MemoryContractSpecRef;
    operationDeadlineMs?: number;
    now?: () => Date;
    expectedApiVersion?: string;
}

Contract members

MemberKindSignatureDescription
baseUrlpropertybaseUrl: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
bearerTokenpropertybearerToken?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedApiVersionpropertyexpectedApiVersion?: 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.
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.
operationProfilepropertyoperationProfile?: ExternalMemoryMappingRuntimeProfilePublic 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.
profileRefpropertyprofileRef?: MemoryContractSpecRefPublic 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.