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.
RAG
Defined in the RAG module.
Rust AI Agent SDK
Main RAG pipeline.
Fields
| Name | Type | Description |
|---|
config | RAGConfig | Configuration |
model | String | LLM model for generation |
sources | Vec<String> | Knowledge sources |
Methods
new
Create a new RAG builder
query
fn query(&self, question: &str) -> Result<RAGResult>
Query the RAG pipeline (placeholder)
Parameters:
add_source
fn add_source(&mut self, source: impl Into<String>) -> ()
Add a knowledge source
Parameters:
| Name | Type |
|---|
source | impl Into<String> |
build_context
fn build_context(&self, chunks: &[ContextChunk]) -> String
Build context from chunks
Parameters:
| Name | Type |
|---|
chunks | &[ContextChunk] |
truncate_context
fn truncate_context(&self, context: &str, max_tokens: usize) -> String
Truncate context to fit token budget
Parameters:
| Name | Type |
|---|
context | &str |
max_tokens | usize |
Source
View on GitHub
praisonai/src/rag/mod.rs at line 467