/** * HyDE Graph state: cache-aware hypothetical document generation. * Used by the HyDE graph for infer_lenses → check_cache → generate_missing → embed → cache_results. */ import type { Id } from '../interfaces/database.interface.js'; import type { Lens, HydeTargetCorpus } from './lens.inferrer.js'; import type { HydeSourceFrame } from './hyde.frame.js'; import type { DebugMetaAgent } from '../../chat/chat-streaming.types.js'; export type HydeDocumentOrigin = 'cache' | 'db' | 'generated'; export type HydeValidationStatus = 'valid' | 'invalid' | 'failed_open'; /** Single HyDE document (text + embedding) for one lens. */ export interface HydeDocumentState { lens: string; targetCorpus: HydeTargetCorpus; hydeText: string; hydeEmbedding: number[]; origin?: HydeDocumentOrigin; validationStatus?: HydeValidationStatus; hydeGenerationVersion?: 'frame-v1'; frameFingerprint?: string; sourceTextHash?: string; generatedAt?: string; } /** State for the HyDE generation graph. */ export declare const HydeGraphState: import("@langchain/langgraph").AnnotationRoot<{ /** Source type: intent, profile, user context, or ad-hoc query. */ sourceType: { (annotation: import("@langchain/langgraph").SingleReducer<"intent" | "context" | "query", "intent" | "context" | "query">): import("@langchain/langgraph").BaseChannel<"intent" | "context" | "query", "intent" | "context" | "query" | import("@langchain/langgraph").OverwriteValue<"intent" | "context" | "query">, unknown>; (): import("@langchain/langgraph").LastValue<"intent" | "context" | "query">; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; /** Source entity ID (e.g. intent ID, user ID). Omitted for ad-hoc query. */ sourceId: import("@langchain/langgraph").BaseChannel | Id<"intents"> | undefined, Id<"users"> | Id<"intents"> | import("@langchain/langgraph").OverwriteValue | Id<"intents"> | undefined> | undefined, unknown>; /** Source text to generate HyDE from (intent payload, profile summary, or query). */ sourceText: { (annotation: import("@langchain/langgraph").SingleReducer): import("@langchain/langgraph").BaseChannel, unknown>; (): import("@langchain/langgraph").LastValue; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; /** Optional profile context for lens inference (user's profile summary). */ profileContext: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** Maximum number of lenses to infer (default 3). */ maxLenses: import("@langchain/langgraph").BaseChannel, unknown>; /** When true, skip cache/DB and regenerate all lenses. */ forceRegenerate: import("@langchain/langgraph").BaseChannel, unknown>; /** Inferred lenses from the LensInferrer agent. */ lenses: import("@langchain/langgraph").BaseChannel, unknown>; /** Sanitized source-grounded frame produced by frame-v1 inference. */ sourceFrame: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** Exact sourceText + sanitized sourceFrame identity for frame-v1 reuse. */ frameFingerprint: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** Hash of the exact source text for persisted frame-v1 freshness checks. */ sourceTextHash: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** Shared cohort marker assigned when this run generates any missing document. */ generatedAt: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** * Complete HyDE document snapshot keyed by lens label. Writers replace the * snapshot so rejected documents can be removed before embedding. */ hydeDocuments: import("@langchain/langgraph").BaseChannel, Record | import("@langchain/langgraph").OverwriteValue>, unknown>; /** * Final embeddings per lens (convenience output for search). * Populated by embed node; used by opportunity graph. */ hydeEmbeddings: import("@langchain/langgraph").BaseChannel, Record | import("@langchain/langgraph").OverwriteValue>, unknown>; /** Non-fatal error message. */ error: import("@langchain/langgraph").BaseChannel | undefined, unknown>; /** Timing records for each agent invocation within this graph run. */ agentTimings: import("@langchain/langgraph").BaseChannel, unknown>; }>;