Skip to content

@codesoul-co/hypha-memory / index

Using this module

Aggregates the public entrypoint exports for @codesoul-co/hypha-memory; applications import these symbols from the package entrypoint instead of internal file paths.

Import from the package entrypoint

ts
import {
  MemoryManager,
  memoryProviderProfileSchema,
  memoryRetrievalPolicySchema,
  memorySpecDefinition,
  memorySpecDefinitions,
  memorySpecExample,
  memorySpecJsonSchema,
  memorySpecJsonSchemas,
} from '@codesoul-co/hypha-memory';

import type {
  ArtifactMeta,
  ArtifactRef,
  ArtifactStoreProvider,
  EmbeddingProvider,
  MemoryAuditOptions,
  MemoryAuditReport,
  MemoryManagerOptions,
  MemoryManagerRecoveryOptions,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

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

Runtime validation example

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

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = memoryProviderProfileSchema.parse(input);

Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.

Public exports

SymbolKindSignatureDescription
MemoryManagerclassnew MemoryManager(provider: MemoryProvider | MemoryManagementProvider, options?: MemoryManagerOptions): MemoryManagerMemory Manager class with 16 public constructor or member entries; its exact declarations are listed below.
memoryProviderProfileSchemaconstantconst memoryProviderProfileSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["structured", "vector", "artifact", "hybrid"]>; providerRef: z.ZodString; configSchema: z.ZodOptional<z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>>; }, "strip", z.ZodTypeAny, { id: string; type: "artifact" | "structured" | "vector" | "hybrid"; providerRef: string; configSchema?: JsonSchema | undefined; }, { id: string; type: "art...Runtime schema for Memory Provider Profile.
memoryRetrievalPolicySchemaconstantconst memoryRetrievalPolicySchema: z.ZodObject<{ defaultTopK: z.ZodOptional<z.ZodNumber>; vectorWeight: z.ZodOptional<z.ZodNumber>; textWeight: z.ZodOptional<z.ZodNumber>; requireScope: z.ZodOptional<z.ZodBoolean>; allowedTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["working", "episodic", "semantic", "procedural", "artifact", "governance"]>, "many">>; }, "strip", z.ZodTypeAny, { defaultTopK?: number | undefined; vec...Runtime schema for Memory Retrieval Policy.
memorySpecDefinitionconstantconst memorySpecDefinition: SpecSchemaDefinition<MemorySpec>Runtime validation entrypoint for the Memory spec, combining its parser, example and JSON Schema.
memorySpecDefinitionsconstantconst memorySpecDefinitions: readonly [SpecSchemaDefinition<MemorySpec>]Memory Spec Definitions constant exported by the index module.
memorySpecExampleconstantconst memorySpecExample: MemorySpecValid example value for Memory Spec.
memorySpecJsonSchemaconstantconst memorySpecJsonSchema: JsonSchemaJSON Schema for Memory Spec.
memorySpecJsonSchemasconstantconst memorySpecJsonSchemas: Record<string, JsonSchema>Memory Spec JSON Schemas constant exported by the index module.
memorySpecSchemaconstantconst memorySpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { providers: z.ZodArray<z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["structured", "v...Runtime schema for Memory Spec.
memoryTypeSchemaconstantconst memoryTypeSchema: z.ZodEnum<["working", "episodic", "semantic", "procedural", "artifact", "governance"]>Runtime schema for Memory Type.
validateMemorySpecfunctionvalidateMemorySpec(input: unknown): MemorySpecValidate Memory Spec function with 1 public call signature; parameters and return types are listed below.
ArtifactMetainterfaceinterface ArtifactMetaArtifact Meta interface with 4 public fields or methods.
ArtifactRefinterfaceinterface ArtifactRefArtifact Ref interface with 3 public fields or methods.
ArtifactStoreProviderinterfaceinterface ArtifactStoreProviderArtifact Store Provider interface with 3 public fields or methods.
EmbeddingProviderinterfaceinterface EmbeddingProviderEmbedding Provider interface with 1 public fields or methods.
MemoryAuditOptionsinterfaceinterface MemoryAuditOptionsMemory Audit Options interface with 2 public fields or methods.
MemoryAuditReportinterfaceinterface MemoryAuditReportMemory Audit Report interface with 3 public fields or methods.
MemoryManagerOptionsinterfaceinterface MemoryManagerOptionsMemory Manager Options interface with 4 public fields or methods.
MemoryManagerRecoveryOptionsinterfaceinterface MemoryManagerRecoveryOptionsMemory Manager Recovery Options interface with 5 public fields or methods.
MemoryProviderinterfaceinterface MemoryProviderMemory Provider interface with 7 public fields or methods.
MemoryProviderProfileinterfaceinterface MemoryProviderProfileMemory Provider Profile interface with 4 public fields or methods.
MemoryReadQueryinterfaceinterface MemoryReadQueryMemory Read Query interface with 3 public fields or methods.
MemoryRecordinterfaceinterface MemoryRecordMemory Record interface with 10 public fields or methods.
MemoryRetrievalPolicyinterfaceinterface MemoryRetrievalPolicyMemory Retrieval Policy interface with 5 public fields or methods.
MemoryScopeinterfaceinterface MemoryScopeMemory Scope interface with 4 public fields or methods.
MemorySearchQueryinterfaceinterface MemorySearchQueryMemory Search Query interface with 4 public fields or methods.
MemorySearchResultinterfaceinterface MemorySearchResultMemory Search Result interface with 3 public fields or methods.
MemorySpecinterfaceinterface MemorySpec extends VersionedSpec, SpecMetadataMemory Spec interface with 23 public fields or methods.
MemorySummaryinterfaceinterface MemorySummaryMemory Summary interface with 3 public fields or methods.
MemorySummaryOptionsinterfaceinterface MemorySummaryOptionsMemory Summary Options interface with 2 public fields or methods.
MemoryTraceContextinterfaceinterface MemoryTraceContextMemory Trace Context interface with 7 public fields or methods.
MemoryWritePolicyinterfaceinterface MemoryWritePolicyMemory Write Policy interface with 4 public fields or methods.
MemoryWriteResultinterfaceinterface MemoryWriteResultMemory Write Result interface with 3 public fields or methods.
StructuredQueryinterfaceinterface StructuredQueryStructured Query interface with 3 public fields or methods.
StructuredStoreProviderinterfaceinterface StructuredStoreProviderStructured Store Provider interface with 7 public fields or methods.
VectorIndexProviderinterfaceinterface VectorIndexProviderVector Index Provider interface with 3 public fields or methods.
VectorQueryinterfaceinterface VectorQueryVector Query interface with 3 public fields or methods.
VectorRecordinterfaceinterface VectorRecordVector Record interface with 3 public fields or methods.
VectorSearchResultinterfaceinterface VectorSearchResultVector Search Result interface with 3 public fields or methods.
MemoryTypetypetype MemoryType = 'working' | 'episodic' | 'semantic' | 'procedural' | 'artifact' | 'governance'Public type alias for Memory Type; the declaration contains its complete type expression.

MemoryManager

Memory Manager class with 16 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class MemoryManager {
    constructor(provider: MemoryProvider | MemoryManagementProvider, options?: MemoryManagerOptions);
    capabilities(): Promise<MemoryManagementCapabilities>;
    add(request: MemoryAddRequest): Promise<ManagedMemoryWriteResult>;
    read(scope: MemoryScope, query: MemoryReadQuery): Promise<MemoryRecord[]>;
    search(scope: MemoryScope, query: MemorySearchQuery): Promise<MemorySearchResult[]>;
    search(request: ManagedMemorySearchRequest): Promise<ManagedMemorySearchResult[]>;
    write(scope: MemoryScope, record: MemoryRecord, policy: MemoryWritePolicy): Promise<MemoryWriteResult>;
    update(scope: MemoryScope, recordId: string, patch: Partial<MemoryRecord>): Promise<void>;
    update(request: ManagedMemoryUpdateRequest): Promise<ManagedMemoryWriteResult>;
    get(request: MemoryGetRequest): Promise<ManagedMemoryRecord | null>;
    list(request: MemoryListRequest): Promise<MemoryListResult>;
    delete(request: ManagedMemoryDeleteRequest): Promise<ManagedMemoryDeleteResult>;
    history(request: MemoryHistoryRequest): Promise<MemoryVersion[]>;
    health(): Promise<ProviderHealth>;
    close(): Promise<void>;
    invalidate(scope: MemoryScope, recordId: string, reason: string): Promise<void>;
    summarize(scope: MemoryScope, options?: MemorySummaryOptions): Promise<MemorySummary>;
    audit(scope: MemoryScope, options?: MemoryAuditOptions): Promise<MemoryAuditReport>;
}

Public members

MemberKindSignatureDescription
addmethodadd(request: MemoryAddRequest): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
auditmethodaudit(scope: MemoryScope, options?: MemoryAuditOptions): Promise<MemoryAuditReport>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(provider: MemoryProvider | MemoryManagementProvider, options?: MemoryManagerOptions): MemoryManagerCreates an instance of this class.
deletemethoddelete(request: ManagedMemoryDeleteRequest): Promise<ManagedMemoryDeleteResult>Public method; parameters and return type are shown in the signature.
getmethodget(request: MemoryGetRequest): 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): Promise<MemoryVersion[]>Public method; parameters and return type are shown in the signature.
invalidatemethodinvalidate(scope: MemoryScope, recordId: string, reason: string): Promise<void>Public method; parameters and return type are shown in the signature.
listmethodlist(request: MemoryListRequest): Promise<MemoryListResult>Public method; parameters and return type are shown in the signature.
readmethodread(scope: MemoryScope, query: MemoryReadQuery): Promise<MemoryRecord[]>Public method; parameters and return type are shown in the signature.
searchmethodsearch(scope: MemoryScope, query: MemorySearchQuery): Promise<MemorySearchResult[]> | search(request: ManagedMemorySearchRequest): Promise<ManagedMemorySearchResult[]>Public method; parameters and return type are shown in the signature.
summarizemethodsummarize(scope: MemoryScope, options?: MemorySummaryOptions): Promise<MemorySummary>Public method; parameters and return type are shown in the signature.
updatemethodupdate(scope: MemoryScope, recordId: string, patch: Partial<MemoryRecord>): Promise<void> | update(request: ManagedMemoryUpdateRequest): Promise<ManagedMemoryWriteResult>Public method; parameters and return type are shown in the signature.
writemethodwrite(scope: MemoryScope, record: MemoryRecord, policy: MemoryWritePolicy): Promise<MemoryWriteResult>Public method; parameters and return type are shown in the signature.

memoryProviderProfileSchema

Runtime schema for Memory Provider Profile.

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

Declaration

text
export declare const memoryProviderProfileSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["structured", "vector", "artifact", "hybrid"]>; providerRef: z.ZodString; configSchema: z.ZodOptional<z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>>; }, "strip", z.ZodTypeAny, { id: string; type: "artifact" | "structured" | "vector" | "hybrid"; providerRef: string; configSchema?: JsonSchema | undefined; }, { id: string; type: "artifact" | "structured" | "vector" | "hybrid"; providerRef: string; configSchema?: JsonSchema | undefined; }>;

memoryRetrievalPolicySchema

Runtime schema for Memory Retrieval Policy.

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

Declaration

text
export declare const memoryRetrievalPolicySchema: z.ZodObject<{ defaultTopK: z.ZodOptional<z.ZodNumber>; vectorWeight: z.ZodOptional<z.ZodNumber>; textWeight: z.ZodOptional<z.ZodNumber>; requireScope: z.ZodOptional<z.ZodBoolean>; allowedTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["working", "episodic", "semantic", "procedural", "artifact", "governance"]>, "many">>; }, "strip", z.ZodTypeAny, { defaultTopK?: number | undefined; vectorWeight?: number | undefined; textWeight?: number | undefined; requireScope?: boolean | undefined; allowedTypes?: ("working" | "episodic" | "semantic" | "procedural" | "artifact" | "governance")[] | undefined; }, { defaultTopK?: number | undefined; vectorWeight?: number | undefined; textWeight?: number | undefined; requireScope?: boolean | undefined; allowedTypes?: ("working" | "episodic" | "semantic" | "procedural" | "artifact" | "governance")[] | undefined; }>;

memorySpecDefinition

Runtime validation entrypoint for the Memory spec, combining its parser, example and JSON Schema.

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

Declaration

text
export declare const memorySpecDefinition: SpecSchemaDefinition<MemorySpec>;

memorySpecDefinitions

Memory Spec Definitions constant exported by the index module.

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

Declaration

text
export declare const memorySpecDefinitions: readonly [SpecSchemaDefinition<MemorySpec>];

memorySpecExample

Valid example value for Memory Spec.

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

Declaration

text
export declare const memorySpecExample: MemorySpec;

memorySpecJsonSchema

JSON Schema for Memory Spec.

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

Declaration

text
export declare const memorySpecJsonSchema: JsonSchema;

memorySpecJsonSchemas

Memory Spec JSON Schemas constant exported by the index module.

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

Declaration

text
export declare const memorySpecJsonSchemas: Record<string, JsonSchema>;

memorySpecSchema

Runtime schema for Memory Spec.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const memorySpecSchema: (typeof import('@codesoul-co/hypha-memory'))['memorySpecSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

memoryTypeSchema

Runtime schema for Memory Type.

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

Declaration

text
export declare const memoryTypeSchema: z.ZodEnum<["working", "episodic", "semantic", "procedural", "artifact", "governance"]>;

validateMemorySpec

Validate Memory Spec function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function validateMemorySpec(input: unknown): MemorySpec;

Call signature

text
validateMemorySpec(input: unknown): MemorySpec

Parameters

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

Returns

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

ArtifactMeta

Artifact Meta interface with 4 public fields or methods.

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

Declaration

text
export interface ArtifactMeta {
    contentType?: string;
    sizeBytes?: number;
    hash?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
contentTypepropertycontentType?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
hashpropertyhash?: 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.
sizeBytespropertysizeBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactRef

Artifact Ref interface with 3 public fields or methods.

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

Declaration

text
export interface ArtifactRef {
    id: string;
    path: string;
    meta?: ArtifactMeta;
}

Contract members

MemberKindSignatureDescription
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metapropertymeta?: ArtifactMetaPublic property; its type, readonly modifier and optionality are shown in the signature.
pathpropertypath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactStoreProvider

Artifact Store Provider interface with 3 public fields or methods.

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

Declaration

text
export interface ArtifactStoreProvider {
    put(path: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef>;
    get(ref: ArtifactRef): Promise<Buffer>;
    delete(ref: ArtifactRef): Promise<void>;
}

Contract members

MemberKindSignatureDescription
deletemethoddelete(ref: ArtifactRef): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget(ref: ArtifactRef): Promise<Buffer>Public method; parameters and return type are shown in the signature.
putmethodput(path: string, content: Buffer | string, meta?: ArtifactMeta): Promise<ArtifactRef>Public method; parameters and return type are shown in the signature.

EmbeddingProvider

Embedding Provider interface with 1 public fields or methods.

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

Declaration

text
export interface EmbeddingProvider {
    embed(input: string[]): Promise<number[][]>;
}

Contract members

MemberKindSignatureDescription
embedmethodembed(input: string[]): Promise<number[][]>Public method; parameters and return type are shown in the signature.

MemoryAuditOptions

Memory Audit Options interface with 2 public fields or methods.

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

Declaration

text
export interface MemoryAuditOptions {
    since?: string;
    until?: string;
}

Contract members

MemberKindSignatureDescription
sincepropertysince?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
untilpropertyuntil?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryAuditReport

Memory Audit Report interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryAuditReport {
    scope: MemoryScope;
    recordsChecked: number;
    missingProvenance: string[];
}

Contract members

MemberKindSignatureDescription
missingProvenancepropertymissingProvenance: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
recordsCheckedpropertyrecordsChecked: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: MemoryScopePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryManagerOptions

Memory Manager Options interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryManagerOptions {
    trace?: TraceRecorder;
    traceContext?: MemoryTraceContext;
    now?: () => string;
    recovery?: MemoryManagerRecoveryOptions;
}

Contract members

MemberKindSignatureDescription
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
recoverypropertyrecovery?: MemoryManagerRecoveryOptionsPublic property; its type, readonly modifier and optionality are shown in the signature.
tracepropertytrace?: TraceRecorderPublic property; its type, readonly modifier and optionality are shown in the signature.
traceContextpropertytraceContext?: MemoryTraceContextPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryManagerRecoveryOptions

Memory Manager Recovery Options interface with 5 public fields or methods.

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

Declaration

text
export interface MemoryManagerRecoveryOptions {
    providerId?: string;
    providerRevision?: string;
    specRevision?: string;
    policyRevision?: string;
    onFailure?: (failure: RecoveryFailure) => void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
onFailuremethodonFailure?(failure: RecoveryFailure): void | Promise<void>Public method; parameters and return type are shown in the signature.
policyRevisionpropertypolicyRevision?: 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.
providerRevisionpropertyproviderRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
specRevisionpropertyspecRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryProvider

Memory Provider interface with 7 public fields or methods.

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

Declaration

text
export interface MemoryProvider {
    read(scope: MemoryScope, query: MemoryReadQuery): Promise<MemoryRecord[]>;
    search(scope: MemoryScope, query: MemorySearchQuery): Promise<MemorySearchResult[]>;
    write(scope: MemoryScope, record: MemoryRecord, policy: MemoryWritePolicy): Promise<MemoryWriteResult>;
    update(scope: MemoryScope, recordId: string, patch: Partial<MemoryRecord>): Promise<void>;
    invalidate(scope: MemoryScope, recordId: string, reason: string): Promise<void>;
    summarize(scope: MemoryScope, options?: MemorySummaryOptions): Promise<MemorySummary>;
    audit(scope: MemoryScope, options?: MemoryAuditOptions): Promise<MemoryAuditReport>;
}

Contract members

MemberKindSignatureDescription
auditmethodaudit(scope: MemoryScope, options?: MemoryAuditOptions): Promise<MemoryAuditReport>Public method; parameters and return type are shown in the signature.
invalidatemethodinvalidate(scope: MemoryScope, recordId: string, reason: string): Promise<void>Public method; parameters and return type are shown in the signature.
readmethodread(scope: MemoryScope, query: MemoryReadQuery): Promise<MemoryRecord[]>Public method; parameters and return type are shown in the signature.
searchmethodsearch(scope: MemoryScope, query: MemorySearchQuery): Promise<MemorySearchResult[]>Public method; parameters and return type are shown in the signature.
summarizemethodsummarize(scope: MemoryScope, options?: MemorySummaryOptions): Promise<MemorySummary>Public method; parameters and return type are shown in the signature.
updatemethodupdate(scope: MemoryScope, recordId: string, patch: Partial<MemoryRecord>): Promise<void>Public method; parameters and return type are shown in the signature.
writemethodwrite(scope: MemoryScope, record: MemoryRecord, policy: MemoryWritePolicy): Promise<MemoryWriteResult>Public method; parameters and return type are shown in the signature.

MemoryProviderProfile

Memory Provider Profile interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryProviderProfile {
    id: string;
    type: 'structured' | 'vector' | 'artifact' | 'hybrid';
    providerRef: string;
    configSchema?: JsonSchema;
}

Contract members

MemberKindSignatureDescription
configSchemapropertyconfigSchema?: JsonSchemaPublic 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.
providerRefpropertyproviderRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "artifact" | "structured" | "vector" | "hybrid"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryReadQuery

Memory Read Query interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryReadQuery {
    ids?: string[];
    type?: MemoryType;
    limit?: number;
}

Contract members

MemberKindSignatureDescription
idspropertyids?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
limitpropertylimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype?: MemoryTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRecord

Memory Record interface with 10 public fields or methods.

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

Declaration

text
export interface MemoryRecord<TValue = unknown> {
    id: string;
    type: MemoryType;
    value: TValue;
    source?: string;
    confidence?: number;
    provenance: Record<string, unknown>;
    visibility?: 'private' | 'workspace' | 'public';
    expiresAt?: string;
    createdAt: string;
    updatedAt?: string;
}

Contract members

MemberKindSignatureDescription
confidencepropertyconfidence?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic 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.
provenancepropertyprovenance: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
sourcepropertysource?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: MemoryTypePublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
valuepropertyvalue: TValuePublic property; its type, readonly modifier and optionality are shown in the signature.
visibilitypropertyvisibility?: "workspace" | "private" | "public"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalPolicy

Memory Retrieval Policy interface with 5 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalPolicy {
    defaultTopK?: number;
    vectorWeight?: number;
    textWeight?: number;
    requireScope?: boolean;
    allowedTypes?: MemoryType[];
}

Contract members

MemberKindSignatureDescription
allowedTypespropertyallowedTypes?: MemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
defaultTopKpropertydefaultTopK?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
requireScopepropertyrequireScope?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
textWeightpropertytextWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorWeightpropertyvectorWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryScope

Memory Scope interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryScope {
    workspaceId?: string;
    sessionId?: string;
    runId?: string;
    userId?: string;
}

Contract members

MemberKindSignatureDescription
runIdpropertyrunId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemorySearchQuery

Memory Search Query interface with 4 public fields or methods.

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

Declaration

text
export interface MemorySearchQuery {
    text?: string;
    vector?: number[];
    type?: MemoryType;
    topK?: number;
}

Contract members

MemberKindSignatureDescription
textpropertytext?: stringPublic 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.
typepropertytype?: MemoryTypePublic 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.

MemorySearchResult

Memory Search Result interface with 3 public fields or methods.

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

Declaration

text
export interface MemorySearchResult {
    record: MemoryRecord;
    score?: number;
    provenance: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
provenancepropertyprovenance: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
recordpropertyrecord: MemoryRecord<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.

MemorySpec

Memory Spec interface with 23 public fields or methods.

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

Declaration

text
export interface MemorySpec extends VersionedSpec, SpecMetadata {
    providers: MemoryProviderProfile[];
    memoryTypes: MemoryType[];
    structuredStoreRef?: string;
    vectorIndexRef?: string;
    artifactStoreRef?: string;
    embeddingProviderRef?: string;
    readPolicy?: string;
    writePolicy?: string;
    freshnessPolicy?: string;
    provenancePolicy?: 'required' | 'best_effort';
    retentionPolicy?: string;
    privacyPolicy?: string;
    retrievalStrategy?: string;
    retrievalPolicy?: MemoryRetrievalPolicy;
    writePolicyConfig?: MemoryWritePolicy;
}

Contract members

MemberKindSignatureDescription
artifactStoreRefpropertyartifactStoreRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
embeddingProviderRefpropertyembeddingProviderRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
freshnessPolicypropertyfreshnessPolicy?: stringPublic 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.
memoryTypespropertymemoryTypes: MemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
privacyPolicypropertyprivacyPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
provenancePolicypropertyprovenancePolicy?: "required" | "best_effort"Public property; its type, readonly modifier and optionality are shown in the signature.
providerspropertyproviders: MemoryProviderProfile[]Public property; its type, readonly modifier and optionality are shown in the signature.
readPolicypropertyreadPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retentionPolicypropertyretentionPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retrievalPolicypropertyretrievalPolicy?: MemoryRetrievalPolicyPublic property; its type, readonly modifier and optionality are shown in the signature.
retrievalStrategypropertyretrievalStrategy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
structuredStoreRefpropertystructuredStoreRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorIndexRefpropertyvectorIndexRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
writePolicypropertywritePolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
writePolicyConfigpropertywritePolicyConfig?: MemoryWritePolicyPublic property; its type, readonly modifier and optionality are shown in the signature.

MemorySummary

Memory Summary interface with 3 public fields or methods.

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

Declaration

text
export interface MemorySummary {
    scope: MemoryScope;
    recordCount: number;
    types: Partial<Record<MemoryType, number>>;
}

Contract members

MemberKindSignatureDescription
recordCountpropertyrecordCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: MemoryScopePublic property; its type, readonly modifier and optionality are shown in the signature.
typespropertytypes: Partial<Record<MemoryType, number>>Public property; its type, readonly modifier and optionality are shown in the signature.

MemorySummaryOptions

Memory Summary Options interface with 2 public fields or methods.

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

Declaration

text
export interface MemorySummaryOptions {
    type?: MemoryType;
    limit?: number;
}

Contract members

MemberKindSignatureDescription
limitpropertylimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype?: MemoryTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryTraceContext

Memory Trace Context interface with 7 public fields or methods.

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

Declaration

text
export interface MemoryTraceContext {
    runId?: string;
    stepId?: string;
    sessionId?: string;
    userId?: string;
    agentId?: string;
    workspaceId?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: 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.
runIdpropertyrunId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stepIdpropertystepId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryWritePolicy

Memory Write Policy interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryWritePolicy {
    allowLongTerm?: boolean;
    requireProvenance?: boolean;
    decision?: PolicyDecision;
    idempotencyKey?: string;
}

Contract members

MemberKindSignatureDescription
allowLongTermpropertyallowLongTerm?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionpropertydecision?: PolicyDecisionPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requireProvenancepropertyrequireProvenance?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryWriteResult

Memory Write Result interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryWriteResult {
    recordId: string;
    vectorIndexed?: boolean;
    artifactRef?: ArtifactRef;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef?: ArtifactRefPublic property; its type, readonly modifier and optionality are shown in the signature.
recordIdpropertyrecordId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorIndexedpropertyvectorIndexed?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

StructuredQuery

Structured Query interface with 3 public fields or methods.

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

Declaration

text
export interface StructuredQuery {
    where?: Record<string, unknown>;
    limit?: number;
    orderBy?: string;
}

Contract members

MemberKindSignatureDescription
limitpropertylimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
orderBypropertyorderBy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
wherepropertywhere?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.

StructuredStoreProvider

Structured Store Provider interface with 7 public fields or methods.

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

Declaration

text
export interface StructuredStoreProvider {
    get<T>(table: string, id: string): Promise<T | null>;
    insert<T extends {
        id: string;
    }>(table: string, record: T): Promise<void>;
    update<T>(table: string, id: string, patch: Partial<T>): Promise<void>;
    compareAndSet?<T>(table: string, id: string, expected: Partial<T>, patch: Partial<T>): Promise<boolean>;
    delete(table: string, id: string): Promise<void>;
    query<T>(table: string, query: StructuredQuery): Promise<T[]>;
    transaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T>;
}

Contract members

MemberKindSignatureDescription
compareAndSetmethodcompareAndSet?<T>(table: string, id: string, expected: Partial<T>, patch: Partial<T>): Promise<boolean>Public method; parameters and return type are shown in the signature.
deletemethoddelete(table: string, id: string): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget<T>(table: string, id: string): Promise<T | null>Public method; parameters and return type are shown in the signature.
insertmethodinsert<T extends { id: string; }>(table: string, record: T): Promise<void>Public method; parameters and return type are shown in the signature.
querymethodquery<T>(table: string, query: StructuredQuery): Promise<T[]>Public method; parameters and return type are shown in the signature.
transactionmethodtransaction<T>(fn: (tx: StructuredStoreProvider) => Promise<T>): Promise<T>Public method; parameters and return type are shown in the signature.
updatemethodupdate<T>(table: string, id: string, patch: Partial<T>): Promise<void>Public method; parameters and return type are shown in the signature.

VectorIndexProvider

Vector Index Provider interface with 3 public fields or methods.

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

Declaration

text
export interface VectorIndexProvider {
    upsert(records: VectorRecord[]): Promise<void>;
    search(query: VectorQuery): Promise<VectorSearchResult[]>;
    delete(ids: string[]): Promise<void>;
}

Contract members

MemberKindSignatureDescription
deletemethoddelete(ids: string[]): Promise<void>Public method; parameters and return type are shown in the signature.
searchmethodsearch(query: VectorQuery): Promise<VectorSearchResult[]>Public method; parameters and return type are shown in the signature.
upsertmethodupsert(records: VectorRecord[]): Promise<void>Public method; parameters and return type are shown in the signature.

VectorQuery

Vector Query interface with 3 public fields or methods.

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

Declaration

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

Contract members

MemberKindSignatureDescription
filterpropertyfilter?: Record<string, unknown>Public 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.

VectorRecord

Vector Record interface with 3 public fields or methods.

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

Declaration

text
export interface VectorRecord {
    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.

VectorSearchResult

Vector Search Result interface with 3 public fields or methods.

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

Declaration

text
export interface VectorSearchResult {
    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.

MemoryType

Public type alias for Memory Type; the declaration contains its complete type expression.

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

Declaration

text
export type MemoryType = 'working' | 'episodic' | 'semantic' | 'procedural' | 'artifact' | 'governance';