/**
 * src/rag/search.ts
 * البحث الدلالي — Semantic search over document chunks using pgvector
 */
export interface SearchResult {
    content: string;
    similarity: number;
    documentId: string;
    chunkIndex: number;
    metadata: Record<string, unknown>;
}
export interface ContextResult {
    context: string;
    sources: string[];
    chunkCount: number;
}
/**
 * Search document chunks using pgvector similarity.
 * Calls a Supabase RPC function `match_documents` for vector search.
 */
export declare function searchDocuments(tenantId: string, query: string, topK?: number): Promise<SearchResult[]>;
/**
 * Combines document search with workspace file context.
 * Returns a formatted context string to inject into the agent prompt.
 */
export declare function getRelevantContext(tenantId: string, query: string, maxTokens?: number): Promise<ContextResult>;
//# sourceMappingURL=search.d.ts.map