Interface CognitiveRetrievalResult

interface CognitiveRetrievalResult {
    retrieved: ScoredMemoryTrace[];
    partiallyRetrieved: PartiallyRetrievedTrace[];
    diagnostics: {
        candidatesScanned: number;
        vectorSearchTimeMs: number;
        scoringTimeMs: number;
        totalTimeMs: number;
        policyProfile?: MemoryRetrievalProfile;
        suppressed?: "weak_hits";
        confidence?: RetrievalConfidenceSummary;
        escalations?: string[];
        hyde?: {
            hypothesis: string;
        };
        factSupersession?: {
            droppedIds: string[];
            parseOk: boolean;
            llmLatencyMs: number;
            notes?: string[];
        };
        splitOnAmbiguous?: {
            threshold: number;
            candidateCount: number;
            replacedIds: string[];
        };
        stageIds?: {
            dense: string[];
            sparse: string[];
            merged: string[];
            reranked: string[];
            final: string[];
        };
        retrievedTypedTraces?: ScoredMemoryTrace[];
    };
}

Properties

retrieved: ScoredMemoryTrace[]
partiallyRetrieved: PartiallyRetrievedTrace[]
diagnostics: {
    candidatesScanned: number;
    vectorSearchTimeMs: number;
    scoringTimeMs: number;
    totalTimeMs: number;
    policyProfile?: MemoryRetrievalProfile;
    suppressed?: "weak_hits";
    confidence?: RetrievalConfidenceSummary;
    escalations?: string[];
    hyde?: {
        hypothesis: string;
    };
    factSupersession?: {
        droppedIds: string[];
        parseOk: boolean;
        llmLatencyMs: number;
        notes?: string[];
    };
    splitOnAmbiguous?: {
        threshold: number;
        candidateCount: number;
        replacedIds: string[];
    };
    stageIds?: {
        dense: string[];
        sparse: string[];
        merged: string[];
        reranked: string[];
        final: string[];
    };
    retrievedTypedTraces?: ScoredMemoryTrace[];
}

Type declaration

  • candidatesScanned: number
  • vectorSearchTimeMs: number
  • scoringTimeMs: number
  • totalTimeMs: number
  • Optional policyProfile?: MemoryRetrievalProfile
  • Optional suppressed?: "weak_hits"
  • Optional confidence?: RetrievalConfidenceSummary
  • Optional escalations?: string[]
  • Optional hyde?: {
        hypothesis: string;
    }

    Step-4: when a HybridRetriever runs with a hydeRetriever attached, the first ~120 chars of the generated hypothesis are surfaced here for post-hoc analysis of which queries benefited from expansion.

    • hypothesis: string
  • Optional factSupersession?: {
        droppedIds: string[];
        parseOk: boolean;
        llmLatencyMs: number;
        notes?: string[];
    }

    Step-5: post-retrieve FactSupersession pass diagnostics. Populated only when a bench adapter or downstream consumer ran FactSupersession.resolve() over the retrieved traces.

    • droppedIds: string[]
    • parseOk: boolean
    • llmLatencyMs: number
    • Optional notes?: string[]
  • Optional splitOnAmbiguous?: {
        threshold: number;
        candidateCount: number;
        replacedIds: string[];
    }

    Step-6: when HybridRetriever runs with splitAmbiguousThreshold set, the bottom fraction of traces by first-pass rerank score are split at sentence boundaries and rescored. Replacements are recorded here for post-hoc analysis.

    • threshold: number
    • candidateCount: number
    • replacedIds: string[]
  • Optional stageIds?: {
        dense: string[];
        sparse: string[];
        merged: string[];
        reranked: string[];
        final: string[];
    }

    Per-stage ranked trace IDs for the hybrid retrieval pipeline (dense → sparse → merged → reranked → final). Populated by HybridRetriever so downstream consumers can compute per-stage retrieval-quality metrics (Recall@K, NDCG@K, MRR) and attribute losses to the stage that caused them. Absent for non-hybrid retrieval paths.

    • dense: string[]
    • sparse: string[]
    • merged: string[]
    • reranked: string[]
    • final: string[]
  • Optional retrievedTypedTraces?: ScoredMemoryTrace[]

    Stage E: optional Hindsight typed-network output as canonical-shaped scored traces. When the manager is configured with typedNetwork and the variant supports retrieval-side activation ('full'), the manager delegates to a TypedNetworkRetriever which performs seed-finding (proper-noun + quoted-string entity extraction, case-insensitive intersection), spreading activation, and top-K ranking. Top-K results are surfaced as ScoredMemoryTrace[] for drop-in compatibility with the canonical retrieval pipeline (bank-prefixed content, namespaced IDs typed-network:<factId>, sourceType 'typed_network').

    Absent when typed-network is not configured. Empty when the retriever found no seed matches in the typed-network store.

    Phase 4.3 MVP: surfaced in diagnostics but NOT merged into the primary retrieved ranking. Phase 4.4 fusion lands when consumers wire the merged ranking. See 2026-04-26-hindsight-4network-observer-design.md.