Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
RAGConfig
Defined in the RAG module.
Rust AI Agent SDK
Configuration for RAG pipeline.
Fields
| Name | Type | Description |
|---|
top_k | usize | Maximum number of chunks to retrieve |
score_threshold | f32 | Minimum relevance score threshold |
max_context_tokens | usize | Maximum context tokens |
strategy | RetrievalStrategy | Retrieval strategy |
citations_mode | CitationsMode | Citations mode |
rerank | bool | Enable reranking |
compress | bool | Enable context compression |
chunk_overlap | usize | Chunk overlap for splitting |
chunk_size | usize | Chunk size for splitting |
Methods
new
Create a new RAGConfig
top_k
fn top_k(mut self, k: usize) -> Self
Set top_k
Parameters:
score_threshold
fn score_threshold(mut self, threshold: f32) -> Self
Set score threshold
Parameters:
max_context_tokens
fn max_context_tokens(mut self, tokens: usize) -> Self
Set max context tokens
Parameters:
strategy
fn strategy(mut self, strategy: RetrievalStrategy) -> Self
Set retrieval strategy
Parameters:
| Name | Type |
|---|
strategy | RetrievalStrategy |
citations_mode
fn citations_mode(mut self, mode: CitationsMode) -> Self
Set citations mode
Parameters:
| Name | Type |
|---|
mode | CitationsMode |
rerank
fn rerank(mut self, enable: bool) -> Self
Enable reranking
Parameters:
compress
fn compress(mut self, enable: bool) -> Self
Enable compression
Parameters:
Source
View on GitHub
praisonai/src/rag/mod.rs at line 202