Skip to content

@codesoul-co/hypha-memory / retrieval

Using this module

Use the Retrieval module for using the public contracts and operations for this capability boundary. It exports 4 classes, 1 function, 14 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  DefaultMemoryRetrievalPipeline,
  DenseMemoryCandidateGenerator,
  KeywordMemoryCandidateGenerator,
  StructuredMemoryCandidateGenerator,
  normalizeMemoryQuery,
} from '@codesoul-co/hypha-memory';

import type {
  DefaultMemoryRetrievalPipelineOptions,
  DenseMemoryCandidateGeneratorOptions,
  MemoryCandidate,
  MemoryCandidateGenerationRequest,
  MemoryCandidateGenerator,
  MemoryMatchedFragment,
  MemoryRankingPolicySpecV2,
  MemoryRetrievalExplanation,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

  • Use the 15 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 4 classes 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.

Public exports

SymbolKindSignatureDescription
DefaultMemoryRetrievalPipelineclassnew DefaultMemoryRetrievalPipeline(options: DefaultMemoryRetrievalPipelineOptions): DefaultMemoryRetrievalPipelineDefault Memory Retrieval Pipeline class with 3 public constructor or member entries; its exact declarations are listed below.
DenseMemoryCandidateGeneratorclassnew DenseMemoryCandidateGenerator(options: DenseMemoryCandidateGeneratorOptions): DenseMemoryCandidateGeneratorGenerates scope-fenced dense candidates from the configured vector projection.
KeywordMemoryCandidateGeneratorclassnew KeywordMemoryCandidateGenerator(store: ManagedMemoryRecordStore): KeywordMemoryCandidateGeneratorKeyword Memory Candidate Generator class with 4 public constructor or member entries; its exact declarations are listed below.
StructuredMemoryCandidateGeneratorclassnew StructuredMemoryCandidateGenerator(store: ManagedMemoryRecordStore): StructuredMemoryCandidateGeneratorStructured Memory Candidate Generator class with 4 public constructor or member entries; its exact declarations are listed below.
normalizeMemoryQueryfunctionnormalizeMemoryQuery(input: Omit<NormalizedMemoryQuery, "queryHash">): NormalizedMemoryQueryNormalize Memory Query function with 1 public call signature; parameters and return types are listed below.
DefaultMemoryRetrievalPipelineOptionsinterfaceinterface DefaultMemoryRetrievalPipelineOptionsDefault Memory Retrieval Pipeline Options interface with 4 public fields or methods.
DenseMemoryCandidateGeneratorOptionsinterfaceinterface DenseMemoryCandidateGeneratorOptionsDense Memory Candidate Generator Options interface with 2 public fields or methods.
MemoryCandidateinterfaceinterface MemoryCandidateMemory Candidate interface with 8 public fields or methods.
MemoryCandidateGenerationRequestinterfaceinterface MemoryCandidateGenerationRequestMemory Candidate Generation Request interface with 3 public fields or methods.
MemoryCandidateGeneratorinterfaceinterface MemoryCandidateGeneratorMemory Candidate Generator interface with 3 public fields or methods.
MemoryMatchedFragmentinterfaceinterface MemoryMatchedFragmentMemory Matched Fragment interface with 5 public fields or methods.
MemoryRankingPolicySpecV2interfaceinterface MemoryRankingPolicySpecV2 extends MemoryRetrievalPolicySpecMemory Ranking Policy Spec V2 interface with 19 public fields or methods.
MemoryRetrievalExplanationinterfaceinterface MemoryRetrievalExplanationMemory Retrieval Explanation interface with 8 public fields or methods.
MemoryRetrievalPipelineinterfaceinterface MemoryRetrievalPipelineMemory Retrieval Pipeline interface with 2 public fields or methods.
MemoryRetrievalRequestinterfaceinterface MemoryRetrievalRequestMemory Retrieval Request interface with 7 public fields or methods.
MemoryRetrievalResultinterfaceinterface MemoryRetrievalResultMemory Retrieval Result interface with 3 public fields or methods.
MemoryRetrievalSnapshotinterfaceinterface MemoryRetrievalSnapshotMemory Retrieval Snapshot interface with 12 public fields or methods.
MemorySearchFilterV2interfaceinterface MemorySearchFilterV2 extends MemorySearchFilterMemory Search Filter V2 interface with 25 public fields or methods.
NormalizedMemoryQueryinterfaceinterface NormalizedMemoryQueryNormalized Memory Query interface with 12 public fields or methods.
MemoryCandidateGeneratorTypetypetype MemoryCandidateGeneratorType = 'structured' | 'keyword' | 'dense' | 'sparse' | 'graph' | 'recent' | 'custom'Public type alias for Memory Candidate Generator Type; the declaration contains its complete type expression.

DefaultMemoryRetrievalPipeline

Default Memory Retrieval Pipeline class with 3 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class DefaultMemoryRetrievalPipeline implements MemoryRetrievalPipeline {
    constructor(options: DefaultMemoryRetrievalPipelineOptions);
    retrieve(request: MemoryRetrievalRequest): Promise<MemoryRetrievalResult>;
    explain(snapshotId: string): Promise<MemoryRetrievalResult | null>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: DefaultMemoryRetrievalPipelineOptions): DefaultMemoryRetrievalPipelineCreates an instance of this class.
explainmethodexplain(snapshotId: string): Promise<MemoryRetrievalResult | null>Public method; parameters and return type are shown in the signature.
retrievemethodretrieve(request: MemoryRetrievalRequest): Promise<MemoryRetrievalResult>Public method; parameters and return type are shown in the signature.

DenseMemoryCandidateGenerator

Generates scope-fenced dense candidates from the configured vector projection.

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

Declaration

text
export declare class DenseMemoryCandidateGenerator implements MemoryCandidateGenerator {
    readonly id: string;
    readonly type: "dense";
    constructor(options: DenseMemoryCandidateGeneratorOptions);
    generate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: DenseMemoryCandidateGeneratorOptions): DenseMemoryCandidateGeneratorCreates an instance of this class.
generatemethodgenerate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertyreadonly type: "dense"Public property; its type, readonly modifier and optionality are shown in the signature.

KeywordMemoryCandidateGenerator

Keyword Memory Candidate Generator class with 4 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class KeywordMemoryCandidateGenerator implements MemoryCandidateGenerator {
    readonly id = "memory.generator.keyword";
    readonly type: "keyword";
    constructor(store: ManagedMemoryRecordStore);
    generate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(store: ManagedMemoryRecordStore): KeywordMemoryCandidateGeneratorCreates an instance of this class.
generatemethodgenerate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: "memory.generator.keyword"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertyreadonly type: "keyword"Public property; its type, readonly modifier and optionality are shown in the signature.

StructuredMemoryCandidateGenerator

Structured Memory Candidate Generator class with 4 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class StructuredMemoryCandidateGenerator implements MemoryCandidateGenerator {
    readonly id = "memory.generator.structured";
    readonly type: "structured";
    constructor(store: ManagedMemoryRecordStore);
    generate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(store: ManagedMemoryRecordStore): StructuredMemoryCandidateGeneratorCreates an instance of this class.
generatemethodgenerate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: "memory.generator.structured"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertyreadonly type: "structured"Public property; its type, readonly modifier and optionality are shown in the signature.

normalizeMemoryQuery

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

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

Declaration

text
export declare function normalizeMemoryQuery(input: Omit<NormalizedMemoryQuery, 'queryHash'>): NormalizedMemoryQuery;

Call signature

text
normalizeMemoryQuery(input: Omit<NormalizedMemoryQuery, "queryHash">): NormalizedMemoryQuery

Parameters

ParameterTypeRequiredDescription
inputOmit<NormalizedMemoryQuery, "queryHash">YesRequired parameter; accepted values are defined by the type column.

Returns

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

DefaultMemoryRetrievalPipelineOptions

Default Memory Retrieval Pipeline Options interface with 4 public fields or methods.

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

Declaration

text
export interface DefaultMemoryRetrievalPipelineOptions {
    recordStore: ManagedMemoryRecordStore;
    generators: MemoryCandidateGenerator[];
    rankingPolicy: MemoryRankingPolicySpecV2;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
generatorspropertygenerators: MemoryCandidateGenerator[]Public property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
rankingPolicypropertyrankingPolicy: MemoryRankingPolicySpecV2Public property; its type, readonly modifier and optionality are shown in the signature.
recordStorepropertyrecordStore: ManagedMemoryRecordStorePublic property; its type, readonly modifier and optionality are shown in the signature.

DenseMemoryCandidateGeneratorOptions

Dense Memory Candidate Generator Options interface with 2 public fields or methods.

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

Declaration

text
export interface DenseMemoryCandidateGeneratorOptions {
    store: ManagedVectorStoreAdapter;
    embeddings: EmbeddingProvider;
}

Contract members

MemberKindSignatureDescription
embeddingspropertyembeddings: EmbeddingProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
storepropertystore: ManagedVectorStoreAdapterPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryCandidate

Memory Candidate interface with 8 public fields or methods.

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

Declaration

text
export interface MemoryCandidate {
    memoryId: string;
    generatorId: string;
    generatorType?: MemoryCandidateGeneratorType;
    rawScore?: number;
    normalizedScore?: number;
    matchedFields?: string[];
    matchedFragments?: MemoryMatchedFragment[];
    reasons?: string[];
}

Contract members

MemberKindSignatureDescription
generatorIdpropertygeneratorId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
generatorTypepropertygeneratorType?: MemoryCandidateGeneratorTypePublic property; its type, readonly modifier and optionality are shown in the signature.
matchedFieldspropertymatchedFields?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
matchedFragmentspropertymatchedFragments?: MemoryMatchedFragment[]Public property; its type, readonly modifier and optionality are shown in the signature.
memoryIdpropertymemoryId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
normalizedScorepropertynormalizedScore?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
rawScorepropertyrawScore?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonspropertyreasons?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryCandidateGenerationRequest

Memory Candidate Generation Request interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryCandidateGenerationRequest {
    query: NormalizedMemoryQuery;
    filter?: MemorySearchFilterV2;
    limit: number;
}

Contract members

MemberKindSignatureDescription
filterpropertyfilter?: MemorySearchFilterV2Public 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.
querypropertyquery: NormalizedMemoryQueryPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryCandidateGenerator

Memory Candidate Generator interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryCandidateGenerator {
    readonly id: string;
    readonly type: MemoryCandidateGeneratorType;
    generate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>;
}

Contract members

MemberKindSignatureDescription
generatemethodgenerate(request: MemoryCandidateGenerationRequest): Promise<MemoryCandidate[]>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertyreadonly type: MemoryCandidateGeneratorTypePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryMatchedFragment

Memory Matched Fragment interface with 5 public fields or methods.

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

Declaration

text
export interface MemoryMatchedFragment {
    field: string;
    text?: string;
    start?: number;
    end?: number;
    fragmentHash?: string;
}

Contract members

MemberKindSignatureDescription
endpropertyend?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
fieldpropertyfield: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fragmentHashpropertyfragmentHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
startpropertystart?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
textpropertytext?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRankingPolicySpecV2

Memory Ranking Policy Spec V2 interface with 19 public fields or methods.

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

Declaration

text
export interface MemoryRankingPolicySpecV2 extends MemoryRetrievalPolicySpec {
    normalization: 'min_max' | 'z_score' | 'rank' | 'provider_normalized';
    weights: {
        semantic?: number;
        keyword?: number;
        exact?: number;
        graph?: number;
        recency?: number;
        importance?: number;
        confidence?: number;
        authority?: number;
        verified?: number;
        reinforcement?: number;
    };
    freshnessHalfLifeSeconds?: number;
    diversity?: {
        method: 'none' | 'mmr' | 'per_entity_cap' | 'per_source_cap';
        lambda?: number;
        maxPerEntity?: number;
        maxPerSource?: number;
    };
    stableTieBreak: 'memory_id' | 'updated_at_then_id' | 'created_at_then_id';
}

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.
diversitypropertydiversity?: { method: "none" | "mmr" | "per_entity_cap" | "per_source_cap"; lambda?: number; maxPerEntity?: number; maxPerSource?: number; }Public property; its type, readonly modifier and optionality are shown in the signature.
freshnessHalfLifeSecondspropertyfreshnessHalfLifeSeconds?: 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.
normalizationpropertynormalization: "min_max" | "z_score" | "rank" | "provider_normalized"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.
stableTieBreakpropertystableTieBreak: "memory_id" | "updated_at_then_id" | "created_at_then_id"Public property; its type, readonly modifier and optionality are shown in the signature.
weightspropertyweights: { semantic?: number; keyword?: number; exact?: number; graph?: number; recency?: number; importance?: number; confidence?: number; authority?: number; verified?: number; reinforcement?: number; }Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalExplanation

Memory Retrieval Explanation interface with 8 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalExplanation {
    memoryId: string;
    finalRank: number;
    finalScore: number;
    componentScores: Record<string, number>;
    filtersPassed: string[];
    filtersRejected?: string[];
    selectedBecause: string[];
    conflictMarkers?: string[];
}

Contract members

MemberKindSignatureDescription
componentScorespropertycomponentScores: Record<string, number>Public property; its type, readonly modifier and optionality are shown in the signature.
conflictMarkerspropertyconflictMarkers?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
filtersPassedpropertyfiltersPassed: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
filtersRejectedpropertyfiltersRejected?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
finalRankpropertyfinalRank: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
finalScorepropertyfinalScore: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryIdpropertymemoryId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
selectedBecausepropertyselectedBecause: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalPipeline

Memory Retrieval Pipeline interface with 2 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalPipeline {
    retrieve(request: MemoryRetrievalRequest): Promise<MemoryRetrievalResult>;
    explain(snapshotId: string): Promise<MemoryRetrievalResult | null>;
}

Contract members

MemberKindSignatureDescription
explainmethodexplain(snapshotId: string): Promise<MemoryRetrievalResult | null>Public method; parameters and return type are shown in the signature.
retrievemethodretrieve(request: MemoryRetrievalRequest): Promise<MemoryRetrievalResult>Public method; parameters and return type are shown in the signature.

MemoryRetrievalRequest

Memory Retrieval Request interface with 7 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalRequest {
    query: NormalizedMemoryQuery;
    profileRef: MemoryContractSpecRef;
    filter?: MemorySearchFilterV2;
    topK: number;
    scoreThreshold?: number;
    includeSuperseded?: boolean;
    includeInvalidated?: boolean;
}

Contract members

MemberKindSignatureDescription
filterpropertyfilter?: MemorySearchFilterV2Public property; its type, readonly modifier and optionality are shown in the signature.
includeInvalidatedpropertyincludeInvalidated?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includeSupersededpropertyincludeSuperseded?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
querypropertyquery: NormalizedMemoryQueryPublic property; its type, readonly modifier and optionality are shown in the signature.
scoreThresholdpropertyscoreThreshold?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
topKpropertytopK: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalResult

Memory Retrieval Result interface with 3 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalResult {
    results: ManagedMemorySearchResult[];
    snapshot: MemoryRetrievalSnapshot;
    explanations: MemoryRetrievalExplanation[];
}

Contract members

MemberKindSignatureDescription
explanationspropertyexplanations: MemoryRetrievalExplanation[]Public property; its type, readonly modifier and optionality are shown in the signature.
resultspropertyresults: ManagedMemorySearchResult[]Public property; its type, readonly modifier and optionality are shown in the signature.
snapshotpropertysnapshot: MemoryRetrievalSnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryRetrievalSnapshot

Memory Retrieval Snapshot interface with 12 public fields or methods.

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

Declaration

text
export interface MemoryRetrievalSnapshot {
    id: string;
    operationId: string;
    queryHash: string;
    profileRef: MemoryContractSpecRef;
    profileRevision: string;
    filterHash: string;
    generatorIds: string[];
    candidateCount: number;
    rankingPolicyHash: string;
    rerankerRef?: MemoryContractSpecRef;
    resultMemoryIds: string[];
    createdAt: string;
}

Contract members

MemberKindSignatureDescription
candidateCountpropertycandidateCount: 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.
filterHashpropertyfilterHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
generatorIdspropertygeneratorIds: string[]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.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRevisionpropertyprofileRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
queryHashpropertyqueryHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rankingPolicyHashpropertyrankingPolicyHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rerankerRefpropertyrerankerRef?: MemoryContractSpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
resultMemoryIdspropertyresultMemoryIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemorySearchFilterV2

Memory Search Filter V2 interface with 25 public fields or methods.

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

Declaration

text
export interface MemorySearchFilterV2 extends MemorySearchFilter {
    excludeTags?: string[];
    authorities?: NonNullable<MemoryExtractionSourceRef['authority']>[];
    validAt?: string;
    validFromBefore?: string;
    validToAfter?: string;
    relationTypes?: MemoryRelation['type'][];
    legalHoldOnly?: boolean;
}

Contract members

MemberKindSignatureDescription
authoritiespropertyauthorities?: NonNullable<"verified" | "unverified" | "user_asserted" | "system_observed" | "authoritative">[]Public property; its type, readonly modifier and optionality are shown in the signature.
canonicalKeyspropertycanonicalKeys?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
confidenceGtepropertyconfidenceGte?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
conflictFreeOnlypropertyconflictFreeOnly?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAfterpropertycreatedAfter?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdBeforepropertycreatedBefore?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
entityIdspropertyentityIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
excludeIdspropertyexcludeIds?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
excludeTagspropertyexcludeTags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
expiresAfterpropertyexpiresAfter?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idspropertyids?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
importanceGtepropertyimportanceGte?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
legalHoldOnlypropertylegalHoldOnly?: booleanPublic 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.
relationTypespropertyrelationTypes?: ("supports" | "contradicts" | "supersedes" | "derived_from" | "related_to" | "same_as" | "part_of")[]Public property; its type, readonly modifier and optionality are shown in the signature.
sourceTypespropertysourceTypes?: ("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.
statusespropertystatuses?: MemoryStatus[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagsAllpropertytagsAll?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
tagsAnypropertytagsAny?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAfterpropertyupdatedAfter?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
validAtpropertyvalidAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
validFromBeforepropertyvalidFromBefore?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
validToAfterpropertyvalidToAfter?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
verifiedOnlypropertyverifiedOnly?: booleanPublic 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.

NormalizedMemoryQuery

Normalized Memory Query interface with 12 public fields or methods.

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

Declaration

text
export interface NormalizedMemoryQuery {
    operationId: string;
    scope: ManagedMemoryScope;
    principal: MemoryPrincipal;
    rawQuery?: string;
    normalizedQuery?: string;
    queryEmbedding?: number[];
    entities?: MemoryEntityRef[];
    temporalIntent?: {
        at?: string;
        from?: string;
        to?: string;
    };
    requestedTypes?: ManagedMemoryType[];
    mode?: 'structured' | 'semantic' | 'keyword' | 'hybrid' | 'graph';
    profileRevision: string;
    queryHash: string;
}

Contract members

MemberKindSignatureDescription
entitiespropertyentities?: MemoryEntityRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode?: "structured" | "hybrid" | "semantic" | "keyword" | "graph"Public property; its type, readonly modifier and optionality are shown in the signature.
normalizedQuerypropertynormalizedQuery?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: MemoryPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRevisionpropertyprofileRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
queryEmbeddingpropertyqueryEmbedding?: number[]Public property; its type, readonly modifier and optionality are shown in the signature.
queryHashpropertyqueryHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rawQuerypropertyrawQuery?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedTypespropertyrequestedTypes?: ManagedMemoryType[]Public 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.
temporalIntentpropertytemporalIntent?: { at?: string; from?: string; to?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryCandidateGeneratorType

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

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

Declaration

text
export type MemoryCandidateGeneratorType = 'structured' | 'keyword' | 'dense' | 'sparse' | 'graph' | 'recent' | 'custom';