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.
RetrievalResult
Defined in the RAG module.
Rust AI Agent SDK
Result of a retrieval operation.
Fields
| Name | Type | Description |
|---|
chunks | Vec<ContextChunk> | Retrieved chunks |
query | String | Query used |
strategy | RetrievalStrategy | Strategy used |
total_searched | usize | Total documents searched |
Methods
new
fn new(query: impl Into<String>, strategy: RetrievalStrategy) -> Self
Create a new retrieval result
Parameters:
| Name | Type |
|---|
query | impl Into<String> |
strategy | RetrievalStrategy |
add_chunk
fn add_chunk(&mut self, chunk: ContextChunk) -> ()
Add a chunk
Parameters:
| Name | Type |
|---|
chunk | ContextChunk |
top_chunks
fn top_chunks(&self, n: usize) -> Vec<&ContextChunk>
Get top chunks by score
Parameters:
Source
View on GitHub
praisonai/src/rag/mod.rs at line 426