Skip to content

@codesoul-co/hypha-memory / contracts

Using this module

Use the Contracts module for declaring and runtime-validating contracts. It exports 28 interfaces, 2 types.

Import from the package entrypoint

ts
import type {
  EmbeddingProviderSpec,
  ManagedMemoryRecord,
  ManagedMemoryScope,
  MemoryConflictPolicySpec,
  MemoryConsolidationPolicySpec,
  MemoryContractSpecRef,
  MemoryEntityRef,
  MemoryFallbackPolicySpec,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

  • Use the 30 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.

Public exports

SymbolKindSignatureDescription
EmbeddingProviderSpecinterfaceinterface EmbeddingProviderSpecEmbedding Provider Spec interface with 11 public fields or methods.
ManagedMemoryRecordinterfaceinterface ManagedMemoryRecordManaged Memory Record interface with 38 public fields or methods.
ManagedMemoryScopeinterfaceinterface ManagedMemoryScopeManaged Memory Scope interface with 8 public fields or methods.
MemoryConflictPolicySpecinterfaceinterface MemoryConflictPolicySpecMemory Conflict Policy Spec interface with 4 public fields or methods.
MemoryConsolidationPolicySpecinterfaceinterface MemoryConsolidationPolicySpecMemory Consolidation Policy Spec interface with 8 public fields or methods.
MemoryContractSpecRefinterfaceinterface MemoryContractSpecRef extends SpecRefMemory Contract Spec Ref interface with 3 public fields or methods.
MemoryEntityRefinterfaceinterface MemoryEntityRefMemory Entity Ref interface with 4 public fields or methods.
MemoryFallbackPolicySpecinterfaceinterface MemoryFallbackPolicySpecMemory Fallback Policy Spec interface with 4 public fields or methods.
MemoryIndexingPolicySpecinterfaceinterface MemoryIndexingPolicySpecMemory Indexing Policy Spec interface with 6 public fields or methods.
MemoryIndexStatusinterfaceinterface MemoryIndexStatusMemory Index Status interface with 4 public fields or methods.
MemoryManagementCapabilitiesinterfaceinterface MemoryManagementCapabilitiesMemory Management Capabilities interface with 17 public fields or methods.
MemoryManagementProviderSpecinterfaceinterface MemoryManagementProviderSpecMemory Management Provider Spec interface with 14 public fields or methods.
MemoryPrincipalinterfaceinterface MemoryPrincipalMemory Principal interface with 8 public fields or methods.
MemoryPrivacyPolicySpecinterfaceinterface MemoryPrivacyPolicySpecMemory Privacy Policy Spec interface with 6 public fields or methods.
MemoryProfileSpecinterfaceinterface MemoryProfileSpecMemory Profile Spec interface with 25 public fields or methods.
MemoryProvenanceinterfaceinterface MemoryProvenanceMemory Provenance interface with 9 public fields or methods.
MemoryRecordStoreSpecinterfaceinterface MemoryRecordStoreSpecMemory Record Store Spec interface with 10 public fields or methods.
MemoryRelationinterfaceinterface MemoryRelationMemory Relation interface with 4 public fields or methods.
MemoryRetentionPolicySpecinterfaceinterface MemoryRetentionPolicySpecMemory Retention Policy Spec interface with 8 public fields or methods.
MemoryRetrievalPolicySpecinterfaceinterface MemoryRetrievalPolicySpecMemory Retrieval Policy Spec interface with 14 public fields or methods.
MemoryScopePolicySpecinterfaceinterface MemoryScopePolicySpecMemory Scope Policy Spec interface with 7 public fields or methods.
MemorySourceinterfaceinterface MemorySourceMemory Source interface with 6 public fields or methods.
MemoryVectorRefinterfaceinterface MemoryVectorRefMemory Vector Ref interface with 8 public fields or methods.
MemoryWritePolicySpecinterfaceinterface MemoryWritePolicySpecMemory Write Policy Spec interface with 9 public fields or methods.
NormalizedMemoryErrorinterfaceinterface NormalizedMemoryErrorNormalized Memory Error interface with 6 public fields or methods.
VectorStoreCapabilitiesinterfaceinterface VectorStoreCapabilitiesVector Store Capabilities interface with 12 public fields or methods.
VectorStoreSpecinterfaceinterface VectorStoreSpecVector Store Spec interface with 12 public fields or methods.
WorkingMemoryStoreSpecinterfaceinterface WorkingMemoryStoreSpecWorking Memory Store Spec interface with 10 public fields or methods.
ManagedMemoryTypetypetype ManagedMemoryType = 'working' | 'episodic' | 'semantic' | 'procedural' | 'preference' | 'artifact' | 'governance' | 'reflection' | 'custom'Public type alias for Managed Memory Type; the declaration contains its complete type expression.
MemoryStatustypetype MemoryStatus = 'pending' | 'active' | 'dormant' | 'superseded' | 'invalidated' | 'deletion_pending' | 'deleted' | 'failed'Public type alias for Memory Status; the declaration contains its complete type expression.

EmbeddingProviderSpec

Embedding Provider Spec interface with 11 public fields or methods.

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

Declaration

text
export interface EmbeddingProviderSpec {
    id: string;
    version: string;
    provider: string;
    model: string;
    dimensions?: number;
    normalized?: boolean;
    maxBatchSize?: number;
    maxInputTokens?: number;
    connectionRef?: string;
    timeoutMs?: number;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
connectionRefpropertyconnectionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dimensionspropertydimensions?: numberPublic 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.
maxBatchSizepropertymaxBatchSize?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxInputTokenspropertymaxInputTokens?: numberPublic 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.
modelpropertymodel: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
normalizedpropertynormalized?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: stringPublic 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.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ManagedMemoryRecord

Managed Memory Record interface with 38 public fields or methods.

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

Declaration

text
export interface ManagedMemoryRecord<TContent = unknown> {
    id: string;
    versionId: string;
    revision: number;
    type: ManagedMemoryType;
    subtype?: string;
    content: TContent;
    canonicalText?: string;
    summary?: string;
    language?: string;
    scope: ManagedMemoryScope;
    visibility: 'private' | 'session' | 'workspace' | 'tenant' | 'shared';
    source: MemorySource;
    provenance: MemoryProvenance;
    confidence?: number;
    importance?: number;
    strength?: number;
    salience?: number;
    accessCount: number;
    lastAccessedAt?: string;
    lastReinforcedAt?: string;
    decayScore?: number;
    status: MemoryStatus;
    immutable?: boolean;
    humanVerified?: boolean;
    sensitive?: boolean;
    tags?: string[];
    entities?: MemoryEntityRef[];
    relations?: MemoryRelation[];
    indexStatus: MemoryIndexStatus;
    vectorRefs?: MemoryVectorRef[];
    artifactRefs?: string[];
    contentHash: string;
    scopeHash: string;
    createdAt: string;
    updatedAt: string;
    expiresAt?: string;
    deletedAt?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
accessCountpropertyaccessCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
artifactRefspropertyartifactRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
canonicalTextpropertycanonicalText?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
confidencepropertyconfidence?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
contentpropertycontent: TContentPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash: 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.
decayScorepropertydecayScore?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deletedAtpropertydeletedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
entitiespropertyentities?: MemoryEntityRef[]Public 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.
humanVerifiedpropertyhumanVerified?: booleanPublic 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.
immutablepropertyimmutable?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
importancepropertyimportance?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
indexStatuspropertyindexStatus: MemoryIndexStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
languagepropertylanguage?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastAccessedAtpropertylastAccessedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastReinforcedAtpropertylastReinforcedAt?: 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.
provenancepropertyprovenance: MemoryProvenancePublic property; its type, readonly modifier and optionality are shown in the signature.
relationspropertyrelations?: MemoryRelation[]Public property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
saliencepropertysalience?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: ManagedMemoryScopePublic 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.
sensitivepropertysensitive?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
sourcepropertysource: MemorySourcePublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: MemoryStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
strengthpropertystrength?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
subtypepropertysubtype?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
summarypropertysummary?: 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.
typepropertytype: ManagedMemoryTypePublic 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.
vectorRefspropertyvectorRefs?: MemoryVectorRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
versionIdpropertyversionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
visibilitypropertyvisibility: "workspace" | "session" | "private" | "shared" | "tenant"Public property; its type, readonly modifier and optionality are shown in the signature.

ManagedMemoryScope

Managed Memory Scope interface with 8 public fields or methods.

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

Declaration

text
export interface ManagedMemoryScope {
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    projectId?: string;
    sessionId?: string;
    runId?: string;
    agentId?: string;
    domainPackId?: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
domainPackIdpropertydomainPackId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
projectIdpropertyprojectId?: stringPublic 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.
tenantIdpropertytenantId?: 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.

MemoryConflictPolicySpec

Memory Conflict Policy Spec interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryConflictPolicySpec {
    detectOnWrite: boolean;
    matchingMode: 'same_key' | 'semantic' | 'entity_relation' | 'custom';
    resolution: 'keep_both' | 'prefer_latest' | 'prefer_verified' | 'require_human' | 'custom';
    markRelations?: boolean;
}

Contract members

MemberKindSignatureDescription
detectOnWritepropertydetectOnWrite: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
markRelationspropertymarkRelations?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
matchingModepropertymatchingMode: "custom" | "semantic" | "same_key" | "entity_relation"Public property; its type, readonly modifier and optionality are shown in the signature.
resolutionpropertyresolution: "custom" | "prefer_latest" | "prefer_verified" | "keep_both" | "require_human"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryConsolidationPolicySpec

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

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

Declaration

text
export interface MemoryConsolidationPolicySpec {
    enabled: boolean;
    trigger: 'scheduled' | 'count' | 'token_pressure' | 'manual';
    minRecords?: number;
    intervalSeconds?: number;
    similarityThreshold?: number;
    preserveSourceRecords?: boolean;
    summaryMemoryType?: ManagedMemoryType;
    requireVerification?: boolean;
}

Contract members

MemberKindSignatureDescription
enabledpropertyenabled: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
intervalSecondspropertyintervalSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
minRecordspropertyminRecords?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
preserveSourceRecordspropertypreserveSourceRecords?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
requireVerificationpropertyrequireVerification?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
similarityThresholdpropertysimilarityThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
summaryMemoryTypepropertysummaryMemoryType?: ManagedMemoryTypePublic property; its type, readonly modifier and optionality are shown in the signature.
triggerpropertytrigger: "manual" | "scheduled" | "count" | "token_pressure"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryContractSpecRef

Memory Contract Spec Ref interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryContractSpecRef extends SpecRef {
    revision?: string;
}

Contract members

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

MemoryEntityRef

Memory Entity Ref interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryEntityRef {
    entityId: string;
    label?: string;
    type?: string;
    confidence?: number;
}

Contract members

MemberKindSignatureDescription
confidencepropertyconfidence?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
entityIdpropertyentityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
labelpropertylabel?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryFallbackPolicySpec

Memory Fallback Policy Spec interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryFallbackPolicySpec {
    onProviderUnavailable: 'fail' | 'native' | 'record_store_only' | 'skip';
    onVectorUnavailable: 'structured_only' | 'keyword' | 'fail';
    onRerankerUnavailable: 'score_fusion' | 'no_rerank' | 'fail';
    maxFallbackDepth?: number;
}

Contract members

MemberKindSignatureDescription
maxFallbackDepthpropertymaxFallbackDepth?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
onProviderUnavailablepropertyonProviderUnavailable: "fail" | "native" | "record_store_only" | "skip"Public property; its type, readonly modifier and optionality are shown in the signature.
onRerankerUnavailablepropertyonRerankerUnavailable: "fail" | "score_fusion" | "no_rerank"Public property; its type, readonly modifier and optionality are shown in the signature.
onVectorUnavailablepropertyonVectorUnavailable: "fail" | "keyword" | "structured_only"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryIndexingPolicySpec

Memory Indexing Policy Spec interface with 6 public fields or methods.

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

Declaration

text
export interface MemoryIndexingPolicySpec {
    mode: 'sync' | 'async_outbox' | 'disabled';
    batchSize?: number;
    maxAttempts?: number;
    retryDelayMs?: number;
    deadLetterAfterAttempts?: number;
    rebuildable: boolean;
}

Contract members

MemberKindSignatureDescription
batchSizepropertybatchSize?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deadLetterAfterAttemptspropertydeadLetterAfterAttempts?: 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.
modepropertymode: "disabled" | "sync" | "async_outbox"Public property; its type, readonly modifier and optionality are shown in the signature.
rebuildablepropertyrebuildable: booleanPublic 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.

MemoryIndexStatus

Memory Index Status interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryIndexStatus {
    state: 'none' | 'pending' | 'indexing' | 'indexed' | 'partial' | 'failed' | 'deleted';
    attempts: number;
    lastAttemptAt?: string;
    lastError?: NormalizedMemoryError;
}

Contract members

MemberKindSignatureDescription
attemptspropertyattempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
lastAttemptAtpropertylastAttemptAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastErrorpropertylastError?: NormalizedMemoryErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate: "none" | "failed" | "deleted" | "pending" | "indexing" | "indexed" | "partial"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryManagementCapabilities

Memory Management Capabilities interface with 17 public fields or methods.

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

Declaration

text
export interface MemoryManagementCapabilities {
    add: boolean;
    search: boolean;
    get: boolean;
    list: boolean;
    update: boolean;
    delete: boolean;
    deleteByFilter: boolean;
    history: boolean;
    summarize: boolean;
    consolidate: boolean;
    decay: boolean;
    reinforce: boolean;
    conflictDetection: boolean;
    hybridSearch: boolean;
    graphRelations: boolean;
    asyncWrite: boolean;
    batchOperations: boolean;
}

Contract members

MemberKindSignatureDescription
addpropertyadd: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
asyncWritepropertyasyncWrite: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
batchOperationspropertybatchOperations: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
conflictDetectionpropertyconflictDetection: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
consolidatepropertyconsolidate: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
decaypropertydecay: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deletepropertydelete: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deleteByFilterpropertydeleteByFilter: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
getpropertyget: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
graphRelationspropertygraphRelations: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
historypropertyhistory: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
hybridSearchpropertyhybridSearch: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
listpropertylist: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
reinforcepropertyreinforce: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
searchpropertysearch: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
summarizepropertysummarize: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
updatepropertyupdate: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryManagementProviderSpec

Memory Management Provider Spec interface with 14 public fields or methods.

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

Declaration

text
export interface MemoryManagementProviderSpec {
    id: string;
    version: string;
    revision?: string;
    name?: string;
    type: 'native' | 'mem0' | 'memorybank' | 'custom';
    deployment: 'embedded' | 'local' | 'self_hosted' | 'managed' | 'remote';
    connectionRef?: string;
    config?: Record<string, unknown>;
    capabilities: MemoryManagementCapabilities;
    timeoutPolicy?: {
        timeoutMs: number;
        operationTimeouts?: Partial<Record<'add' | 'search' | 'get' | 'list' | 'update' | 'delete', number>>;
    };
    retryPolicy?: {
        maxAttempts: number;
        initialDelayMs?: number;
        maxDelayMs?: number;
        backoff?: 'fixed' | 'exponential';
    };
    circuitBreakerPolicy?: {
        failureThreshold: number;
        resetAfterMs: number;
    };
    healthCheckPolicy?: {
        intervalMs?: number;
        timeoutMs?: number;
    };
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
capabilitiespropertycapabilities: MemoryManagementCapabilitiesPublic property; its type, readonly modifier and optionality are shown in the signature.
circuitBreakerPolicypropertycircuitBreakerPolicy?: { failureThreshold: number; resetAfterMs: number; }Public property; its type, readonly modifier and optionality are shown in the signature.
configpropertyconfig?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
connectionRefpropertyconnectionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deploymentpropertydeployment: "local" | "self_hosted" | "managed" | "embedded" | "remote"Public property; its type, readonly modifier and optionality are shown in the signature.
healthCheckPolicypropertyhealthCheckPolicy?: { intervalMs?: number; timeoutMs?: number; }Public 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.
metadatapropertymetadata?: Record<string, unknown>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.
retryPolicypropertyretryPolicy?: { maxAttempts: number; initialDelayMs?: number; maxDelayMs?: number; backoff?: "fixed" | "exponential"; }Public property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutPolicypropertytimeoutPolicy?: { timeoutMs: number; operationTimeouts?: Partial<Record<"add" | "search" | "get" | "list" | "update" | "delete", number>>; }Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "custom" | "native" | "mem0" | "memorybank"Public 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.

MemoryPrincipal

Memory Principal interface with 8 public fields or methods.

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

Declaration

text
export interface MemoryPrincipal {
    principalId: string;
    type: 'user' | 'agent' | 'service' | 'system';
    tenantId?: string;
    userId?: string;
    agentId?: string;
    roles?: string[];
    permissionScopes: 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.
permissionScopespropertypermissionScopes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rolespropertyroles?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "system" | "agent" | "user" | "service"Public 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.

MemoryPrivacyPolicySpec

Memory Privacy Policy Spec interface with 6 public fields or methods.

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

Declaration

text
export interface MemoryPrivacyPolicySpec {
    sensitiveDataMode: 'reject' | 'redact' | 'encrypt' | 'allow_by_policy';
    encryptionRef?: MemoryContractSpecRef;
    redactFields?: string[];
    allowCrossUserRead?: boolean;
    allowCrossWorkspaceRead?: boolean;
    complianceDelete?: boolean;
}

Contract members

MemberKindSignatureDescription
allowCrossUserReadpropertyallowCrossUserRead?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowCrossWorkspaceReadpropertyallowCrossWorkspaceRead?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
complianceDeletepropertycomplianceDelete?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
encryptionRefpropertyencryptionRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
redactFieldspropertyredactFields?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
sensitiveDataModepropertysensitiveDataMode: "reject" | "redact" | "encrypt" | "allow_by_policy"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryProfileSpec

Memory Profile Spec interface with 25 public fields or methods.

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

Declaration

text
export interface MemoryProfileSpec {
    id: string;
    version: string;
    revision?: string;
    name?: string;
    description?: string;
    enabled?: boolean;
    managementProviderRef: MemoryContractSpecRef;
    workingStoreRef?: MemoryContractSpecRef;
    recordStoreRef: MemoryContractSpecRef;
    vectorStoreRefs?: MemoryContractSpecRef[];
    artifactStoreRef?: MemoryContractSpecRef;
    embeddingProviderRef?: MemoryContractSpecRef;
    rerankerProviderRef?: MemoryContractSpecRef;
    scopePolicy: MemoryScopePolicySpec;
    retrievalPolicy: MemoryRetrievalPolicySpec;
    writePolicy: MemoryWritePolicySpec;
    retentionPolicy: MemoryRetentionPolicySpec;
    consolidationPolicy?: MemoryConsolidationPolicySpec;
    conflictPolicy?: MemoryConflictPolicySpec;
    fallbackPolicy?: MemoryFallbackPolicySpec;
    privacyPolicy?: MemoryPrivacyPolicySpec;
    indexingPolicy?: MemoryIndexingPolicySpec;
    contextProfileRef?: MemoryContractSpecRef;
    tags?: string[];
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
artifactStoreRefpropertyartifactStoreRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
conflictPolicypropertyconflictPolicy?: MemoryConflictPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
consolidationPolicypropertyconsolidationPolicy?: MemoryConsolidationPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
contextProfileRefpropertycontextProfileRef?: MemoryContractSpecRefPublic 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?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
enabledpropertyenabled?: booleanPublic 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.
indexingPolicypropertyindexingPolicy?: MemoryIndexingPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
managementProviderRefpropertymanagementProviderRef: MemoryContractSpecRefPublic 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.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
privacyPolicypropertyprivacyPolicy?: MemoryPrivacyPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
recordStoreRefpropertyrecordStoreRef: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
rerankerProviderRefpropertyrerankerProviderRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
retentionPolicypropertyretentionPolicy: MemoryRetentionPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
retrievalPolicypropertyretrievalPolicy: MemoryRetrievalPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopePolicypropertyscopePolicy: MemoryScopePolicySpecPublic 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.
vectorStoreRefspropertyvectorStoreRefs?: MemoryContractSpecRef[]Public 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.
workingStoreRefpropertyworkingStoreRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
writePolicypropertywritePolicy: MemoryWritePolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryProvenance

Memory Provenance interface with 9 public fields or methods.

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

Declaration

text
export interface MemoryProvenance {
    createdBy: string;
    providerId: string;
    extractorVersion?: string;
    sourceEventIds?: string[];
    sourceMemoryIds?: string[];
    transformation?: string;
    humanDecisionId?: string;
    createdAt: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdBypropertycreatedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
extractorVersionpropertyextractorVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
humanDecisionIdpropertyhumanDecisionId?: 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.
sourceEventIdspropertysourceEventIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
sourceMemoryIdspropertysourceMemoryIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
transformationpropertytransformation?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRecordStoreSpec

Memory Record Store Spec interface with 10 public fields or methods.

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

Declaration

text
export interface MemoryRecordStoreSpec {
    id: string;
    version: string;
    type: 'mongodb' | 'sqlite' | 'postgres' | 'custom';
    connectionRef?: string;
    database?: string;
    collectionOrTable?: string;
    transactional?: boolean;
    historyMode?: 'embedded_versions' | 'separate_versions' | 'event_projection';
    encryptionRef?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
collectionOrTablepropertycollectionOrTable?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
connectionRefpropertyconnectionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
databasepropertydatabase?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
encryptionRefpropertyencryptionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
historyModepropertyhistoryMode?: "embedded_versions" | "separate_versions" | "event_projection"Public 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.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
transactionalpropertytransactional?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "custom" | "sqlite" | "postgres" | "mongodb"Public 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.

MemoryRelation

Memory Relation interface with 4 public fields or methods.

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

Declaration

text
export interface MemoryRelation {
    type: 'supports' | 'contradicts' | 'supersedes' | 'derived_from' | 'related_to' | 'same_as' | 'part_of';
    targetMemoryId: string;
    confidence?: number;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
confidencepropertyconfidence?: numberPublic 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.
targetMemoryIdpropertytargetMemoryId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "supports" | "contradicts" | "supersedes" | "derived_from" | "related_to" | "same_as" | "part_of"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetentionPolicySpec

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

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

Declaration

text
export interface MemoryRetentionPolicySpec {
    defaultTtlSeconds?: number;
    ttlByType?: Partial<Record<ManagedMemoryType, number>>;
    archiveAfterSeconds?: number;
    deleteAfterSeconds?: number;
    retainHistory?: boolean;
    maxVersions?: number;
    legalHoldSupported?: boolean;
    deletionMode?: 'soft' | 'hard';
}

Contract members

MemberKindSignatureDescription
archiveAfterSecondspropertyarchiveAfterSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
defaultTtlSecondspropertydefaultTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deleteAfterSecondspropertydeleteAfterSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deletionModepropertydeletionMode?: "soft" | "hard"Public property; its type, readonly modifier and optionality are shown in the signature.
legalHoldSupportedpropertylegalHoldSupported?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
maxVersionspropertymaxVersions?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
retainHistorypropertyretainHistory?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
ttlByTypepropertyttlByType?: Partial<Record<ManagedMemoryType, number>>Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalPolicySpec

Memory Retrieval Policy Spec interface with 14 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalPolicySpec {
    defaultMode: 'structured' | 'semantic' | 'keyword' | 'hybrid';
    maxCandidates: number;
    defaultTopK: number;
    scoreThreshold?: number;
    memoryTypePriority?: Partial<Record<ManagedMemoryType, number>>;
    sourcePriority?: Partial<Record<MemorySource['type'], number>>;
    recencyWeight?: number;
    importanceWeight?: number;
    confidenceWeight?: number;
    reinforcementWeight?: number;
    deduplication: 'none' | 'id' | 'hash' | 'semantic';
    semanticDedupThreshold?: number;
    conflictHandling?: 'include_marked' | 'prefer_latest' | 'prefer_verified' | 'exclude_conflicts';
    rerank?: 'none' | 'score_fusion' | 'provider' | 'custom';
}

Contract members

MemberKindSignatureDescription
confidenceWeightpropertyconfidenceWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
conflictHandlingpropertyconflictHandling?: "include_marked" | "prefer_latest" | "prefer_verified" | "exclude_conflicts"Public property; its type, readonly modifier and optionality are shown in the signature.
deduplicationpropertydeduplication: "none" | "id" | "semantic" | "hash"Public property; its type, readonly modifier and optionality are shown in the signature.
defaultModepropertydefaultMode: "structured" | "hybrid" | "semantic" | "keyword"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.
importanceWeightpropertyimportanceWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxCandidatespropertymaxCandidates: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryTypePrioritypropertymemoryTypePriority?: Partial<Record<ManagedMemoryType, number>>Public property; its type, readonly modifier and optionality are shown in the signature.
recencyWeightpropertyrecencyWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
reinforcementWeightpropertyreinforcementWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
rerankpropertyrerank?: "none" | "provider" | "custom" | "score_fusion"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.
semanticDedupThresholdpropertysemanticDedupThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
sourcePrioritypropertysourcePriority?: Partial<Record<"human_review" | "artifact" | "system" | "derived" | "user_message" | "assistant_message" | "tool_result" | "workflow_state" | "import", number>>Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryScopePolicySpec

Memory Scope Policy Spec interface with 7 public fields or methods.

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

Declaration

text
export interface MemoryScopePolicySpec {
    requiredDimensions: Array<keyof ManagedMemoryScope>;
    allowedReadScopes: Array<keyof ManagedMemoryScope>;
    allowedWriteScopes: Array<keyof ManagedMemoryScope>;
    inheritanceOrder?: Array<keyof ManagedMemoryScope>;
    crossUserRead?: 'deny' | 'policy';
    crossWorkspaceRead?: 'deny' | 'policy';
    enforceTenantBoundary?: boolean;
}

Contract members

MemberKindSignatureDescription
allowedReadScopespropertyallowedReadScopes: (keyof ManagedMemoryScope)[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedWriteScopespropertyallowedWriteScopes: (keyof ManagedMemoryScope)[]Public property; its type, readonly modifier and optionality are shown in the signature.
crossUserReadpropertycrossUserRead?: "deny" | "policy"Public property; its type, readonly modifier and optionality are shown in the signature.
crossWorkspaceReadpropertycrossWorkspaceRead?: "deny" | "policy"Public property; its type, readonly modifier and optionality are shown in the signature.
enforceTenantBoundarypropertyenforceTenantBoundary?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
inheritanceOrderpropertyinheritanceOrder?: (keyof ManagedMemoryScope)[]Public property; its type, readonly modifier and optionality are shown in the signature.
requiredDimensionspropertyrequiredDimensions: (keyof ManagedMemoryScope)[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemorySource

Memory Source interface with 6 public fields or methods.

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

Declaration

text
export interface MemorySource {
    type: 'user_message' | 'assistant_message' | 'tool_result' | 'artifact' | 'workflow_state' | 'human_review' | 'import' | 'derived' | 'system';
    sourceId?: string;
    sourceEventId?: string;
    sourceRunId?: string;
    sourceMessageId?: string;
    sourceArtifactId?: string;
}

Contract members

MemberKindSignatureDescription
sourceArtifactIdpropertysourceArtifactId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceEventIdpropertysourceEventId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceIdpropertysourceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceMessageIdpropertysourceMessageId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceRunIdpropertysourceRunId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "human_review" | "artifact" | "system" | "derived" | "user_message" | "assistant_message" | "tool_result" | "workflow_state" | "import"Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryVectorRef

Memory Vector Ref interface with 8 public fields or methods.

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

Declaration

text
export interface MemoryVectorRef {
    vectorStoreId: string;
    indexName: string;
    vectorId: string;
    embeddingProviderId: string;
    embeddingModel: string;
    embeddingRevision?: string;
    dimensions?: number;
    indexedAt: string;
}

Contract members

MemberKindSignatureDescription
dimensionspropertydimensions?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
embeddingModelpropertyembeddingModel: stringPublic 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.
embeddingRevisionpropertyembeddingRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
indexedAtpropertyindexedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
indexNamepropertyindexName: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorIdpropertyvectorId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
vectorStoreIdpropertyvectorStoreId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryWritePolicySpec

Memory Write Policy Spec interface with 9 public fields or methods.

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

Declaration

text
export interface MemoryWritePolicySpec {
    allowedTypes: ManagedMemoryType[];
    autoCaptureSources?: MemorySource['type'][];
    requireHumanVerificationFor?: ManagedMemoryType[];
    minConfidence?: number;
    deduplicateBeforeWrite?: boolean;
    conflictDetection?: boolean;
    immutableTypes?: ManagedMemoryType[];
    maxContentBytes?: number;
    sensitiveDataMode?: 'reject' | 'redact' | 'encrypt' | 'allow_by_policy';
}

Contract members

MemberKindSignatureDescription
allowedTypespropertyallowedTypes: ManagedMemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
autoCaptureSourcespropertyautoCaptureSources?: ("human_review" | "artifact" | "system" | "derived" | "user_message" | "assistant_message" | "tool_result" | "workflow_state" | "import")[]Public property; its type, readonly modifier and optionality are shown in the signature.
conflictDetectionpropertyconflictDetection?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deduplicateBeforeWritepropertydeduplicateBeforeWrite?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
immutableTypespropertyimmutableTypes?: ManagedMemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
maxContentBytespropertymaxContentBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
minConfidencepropertyminConfidence?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
requireHumanVerificationForpropertyrequireHumanVerificationFor?: ManagedMemoryType[]Public property; its type, readonly modifier and optionality are shown in the signature.
sensitiveDataModepropertysensitiveDataMode?: "reject" | "redact" | "encrypt" | "allow_by_policy"Public property; its type, readonly modifier and optionality are shown in the signature.

NormalizedMemoryError

Normalized Memory Error interface with 6 public fields or methods.

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

Declaration

text
export interface NormalizedMemoryError {
    code: 'MEMORY_INVALID_INPUT' | 'MEMORY_EXTRACTION_SOURCE_UNAVAILABLE' | 'MEMORY_EXTRACTION_FAILED' | 'MEMORY_EXTRACTION_CURSOR_CONFLICT' | 'MEMORY_MAINTENANCE_CONFLICT' | 'MEMORY_RANKING_FAILED' | 'MEMORY_IDEMPOTENCY_CONFLICT' | 'MEMORY_SCOPE_DENIED' | 'MEMORY_PERMISSION_DENIED' | 'MEMORY_NOT_FOUND' | 'MEMORY_REVISION_CONFLICT' | 'MEMORY_PROVIDER_NOT_INSTALLED' | 'MEMORY_PROVIDER_UNAVAILABLE' | 'MEMORY_PROVIDER_TIMEOUT' | 'MEMORY_STORE_UNAVAILABLE' | 'MEMORY_VECTOR_UNAVAILABLE' | 'MEMORY_INDEX_FAILED' | 'MEMORY_DELETE_PARTIAL' | 'MEMORY_POLICY_REJECTED' | 'MEMORY_CONTEXT_BUDGET_EXCEEDED' | 'MEMORY_INTERNAL_ERROR';
    message: string;
    retryable: boolean;
    providerCode?: string;
    details?: Record<string, unknown>;
    causeRef?: string;
}

Contract members

MemberKindSignatureDescription
causeRefpropertycauseRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
codepropertycode: "MEMORY_INVALID_INPUT" | "MEMORY_EXTRACTION_SOURCE_UNAVAILABLE" | "MEMORY_EXTRACTION_FAILED" | "MEMORY_EXTRACTION_CURSOR_CONFLICT" | "MEMORY_MAINTENANCE_CONFLICT" | "MEMORY_RANKING_FAILED" | "MEMORY_IDEMPOTENCY_CONFLICT" | "MEMORY_SCOPE_DENIED" | "MEMORY_PERMISSION_DENIED" | "MEMORY_NOT_FOUND" | "MEMORY_REVISION_CONFLICT" | "MEMORY_PROVIDER_NOT_INSTALLED" | "MEMORY_PROVIDER_UNAVAILABLE" | "MEMORY_PROVIDER_TI...Public property; its type, readonly modifier and optionality are shown in the signature.
detailspropertydetails?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerCodepropertyproviderCode?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retryablepropertyretryable: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

VectorStoreCapabilities

Vector Store Capabilities interface with 12 public fields or methods.

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

Declaration

text
export interface VectorStoreCapabilities {
    denseSearch: boolean;
    sparseSearch: boolean;
    hybridSearch: boolean;
    metadataFilter: boolean;
    fullTextFilter: boolean;
    namespaces: boolean;
    multiVector: boolean;
    batchUpsert: boolean;
    deleteByFilter: boolean;
    payloadUpdate: boolean;
    scoreThreshold: boolean;
    localDeployment: boolean;
}

Contract members

MemberKindSignatureDescription
batchUpsertpropertybatchUpsert: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deleteByFilterpropertydeleteByFilter: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
denseSearchpropertydenseSearch: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
fullTextFilterpropertyfullTextFilter: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
hybridSearchpropertyhybridSearch: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
localDeploymentpropertylocalDeployment: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
metadataFilterpropertymetadataFilter: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
multiVectorpropertymultiVector: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
namespacespropertynamespaces: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
payloadUpdatepropertypayloadUpdate: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
scoreThresholdpropertyscoreThreshold: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
sparseSearchpropertysparseSearch: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

VectorStoreSpec

Vector Store Spec interface with 12 public fields or methods.

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

Declaration

text
export interface VectorStoreSpec {
    id: string;
    version: string;
    type: 'local' | 'qdrant' | 'milvus' | 'chroma' | 'pinecone' | 'pgvector' | 'custom';
    connectionRef?: string;
    collection: string;
    namespaceStrategy?: 'scope_hash' | 'metadata_filter' | 'collection_per_tenant';
    dimensions?: number;
    distance?: 'cosine' | 'dot' | 'l2';
    indexType?: string;
    capabilities: VectorStoreCapabilities;
    writeMode?: 'sync' | 'async_outbox' | 'dual_write';
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
capabilitiespropertycapabilities: VectorStoreCapabilitiesPublic property; its type, readonly modifier and optionality are shown in the signature.
collectionpropertycollection: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
connectionRefpropertyconnectionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dimensionspropertydimensions?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
distancepropertydistance?: "cosine" | "dot" | "l2"Public 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.
indexTypepropertyindexType?: 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.
namespaceStrategypropertynamespaceStrategy?: "metadata_filter" | "scope_hash" | "collection_per_tenant"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "local" | "custom" | "pgvector" | "qdrant" | "milvus" | "chroma" | "pinecone"Public 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.
writeModepropertywriteMode?: "sync" | "async_outbox" | "dual_write"Public property; its type, readonly modifier and optionality are shown in the signature.

WorkingMemoryStoreSpec

Working Memory Store Spec interface with 10 public fields or methods.

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

Declaration

text
export interface WorkingMemoryStoreSpec {
    id: string;
    version: string;
    type: 'in_memory' | 'redis' | 'custom';
    connectionRef?: string;
    namespace?: string;
    defaultTtlSeconds?: number;
    maxItemBytes?: number;
    serialization?: 'json' | 'msgpack';
    encryptionRef?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
connectionRefpropertyconnectionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
defaultTtlSecondspropertydefaultTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
encryptionRefpropertyencryptionRef?: 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.
maxItemBytespropertymaxItemBytes?: numberPublic 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.
namespacepropertynamespace?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
serializationpropertyserialization?: "json" | "msgpack"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "custom" | "redis" | "in_memory"Public 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.

ManagedMemoryType

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

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

Declaration

text
export type ManagedMemoryType = 'working' | 'episodic' | 'semantic' | 'procedural' | 'preference' | 'artifact' | 'governance' | 'reflection' | 'custom';

MemoryStatus

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

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

Declaration

text
export type MemoryStatus = 'pending' | 'active' | 'dormant' | 'superseded' | 'invalidated' | 'deletion_pending' | 'deleted' | 'failed';