pub struct RagConfig {
pub vector_weight: f64,
pub graph_weight: f64,
pub top_k_candidates: usize,
pub top_k_rerank: usize,
pub enable_graph_expansion: bool,
pub graph_depth: u32,
pub context_depth: u32,
pub max_context_entities: usize,
pub min_vector_score: f32,
pub min_combined_score: f64,
pub vector_dimension: usize,
}Expand description
Configuration knobs for the RAG pipeline. All fields have defaults tuned to the paper recommendations.
Fields§
§vector_weight: f64Weight applied to the vector (semantic) score. Default: 0.6.
graph_weight: f64Weight applied to the graph connectivity score. Default: 0.4.
top_k_candidates: usizeStage-1: how many ANN candidates to fetch from TurboQuant. Default: 50.
top_k_rerank: usizeStage-2: how many candidates survive after exact rerank. Default: 20.
enable_graph_expansion: boolWhether to expand candidates via BFS neighbours. Default: true.
graph_depth: u32BFS depth for graph-score neighbour collection. Default: 1.
context_depth: u32BFS depth for context collection. Default: 2.
max_context_entities: usizeMaximum context entities attached to each result. Default: 5.
min_vector_score: f32Minimum vector score for a candidate to survive. Default: 0.0 (off).
min_combined_score: f64Minimum combined score for a result to survive. Default: 0.0 (off).
vector_dimension: usizeVector dimension; set to match your embedding model. Default: 384.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RagConfig
impl RefUnwindSafe for RagConfig
impl Send for RagConfig
impl Sync for RagConfig
impl Unpin for RagConfig
impl UnsafeUnpin for RagConfig
impl UnwindSafe for RagConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.