> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runflow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# RAG Types

> TypeScript types for RAG/Knowledge system

## RAG Types

```typescript theme={null}
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>;
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Tool Types" icon="wrench" href="/api-reference/types/tool-types">
    View tool types
  </Card>

  <Card title="Workflow Types" icon="diagram-project" href="/api-reference/types/workflow-types">
    View workflow types
  </Card>
</CardGroup>
