RAG Types
Copy
interface RAGConfig {
vectorStore?: string;
vectorStores?: Array<{
id: string;
name: string;
threshold?: number;
k?: number;
description?: string;
searchPrompt?: string;
}>;
threshold?: number;
k?: number;
searchPrompt?: string;
toolDescription?: string;
// Advanced features
onResultsFound?: (results: SearchResult[], query: string) => Promise<SearchResult[]> | SearchResult[];
rerank?: RerankConfig;
}
interface RerankConfig {
enabled?: boolean;
strategy?: 'reciprocal-rank-fusion' | 'score-boost' | 'metadata-weight' | 'custom';
boostKeywords?: string[];
metadataField?: string;
customScore?: (result: SearchResult, query: string) => number;
}
interface SearchResult {
id?: string;
content: string;
score: number;
metadata?: Record<string, any>;
}