import type { SearchResult, EntityRecord, RAGResult } from '../types/index.js'; import type { DocumentStore } from './store.js'; import type { LocalEmbedder } from './embedder.js'; /** * Callback type for LLM answer generation. * The RAG engine is LLM-agnostic — the caller provides the completion function. */ export type RAGCompletionFn = (prompt: string) => Promise; export interface QueryOptions { topK?: number; contextChunks?: number; docId?: string; useGraph?: boolean; graphHops?: number; } export declare class RAGQueryEngine { private store; private embedder; private llmComplete; constructor(store: DocumentStore, embedder: LocalEmbedder, llmComplete: RAGCompletionFn); /** * Answer a question using hybrid retrieval (vector + keyword + graph). * * Pipeline: * 1. Embed the query * 2. Hybrid search (vector similarity + BM25 keyword) * 3. Graph-augmented retrieval (optional) * 4. Combine and deduplicate results * 5. Build context from top chunks * 6. Generate answer with LLM */ query(question: string, options?: QueryOptions): Promise; /** * Simple retrieval without LLM generation — just return relevant chunks. * Useful for building context for external LLM calls. */ retrieve(question: string, options?: QueryOptions): Promise<{ chunks: SearchResult[]; entities: EntityRecord[]; }>; } //# sourceMappingURL=rag-query.d.ts.map