import type { EntityTypeConfig } from '../entities/entity-type-config.js'; import type { EntityIndex } from '../entities/entity-index.js'; import type { CatalogNode } from '../feral/catalog/catalog-node.js'; export interface RelevanceResult { /** Keywords extracted from the user's query (stop words removed) */ keywords: string[]; /** Entity types that are relevant, with match details */ relevantTypes: RelevantType[]; /** Entity types mentioned by name in the query */ mentionedTypes: string[]; /** Compact summary for the LLM (e.g. "Bob → person:1, game:1") */ relevanceHint: string; /** Number of catalog nodes that can be skipped */ filteredNodeCount: number; /** Total catalog nodes before filtering */ totalNodeCount: number; } export interface RelevantType { type: string; /** Why this type is relevant */ reason: 'mentioned' | 'entity_match' | 'action_hint' | 'always'; /** Number of matching entities (0 if type match only) */ matchCount: number; /** Sample entity titles that matched */ matchSamples: string[]; } /** * Extract keywords from user input after removing stop words. */ export declare function extractKeywords(input: string): string[]; /** * Determine which entity types are relevant to the user's query. * Uses a deterministic (no LLM) approach: * 1. Extract keywords from query * 2. Check if any keywords match entity type names/plurals * 3. Search entity index for keyword matches, group by type * 4. Check action words for type hints * 5. Use vector similarity (local embeddings) to surface types with relevance config */ export declare function analyzeQueryRelevance(userInput: string, entityTypes: EntityTypeConfig[], entityIndex: EntityIndex): Promise; /** * Filter catalog nodes to only include those relevant to the query. * Keeps all non-entity nodes (system, flow, genai, etc.) and only * filters entity-type-specific nodes based on relevance. */ export declare function filterCatalogNodes(allNodes: CatalogNode[], relevantTypes: RelevantType[], entityTypes: EntityTypeConfig[]): CatalogNode[]; //# sourceMappingURL=query-relevance.d.ts.map