pub struct GraphRAGConfig {
pub max_entities_per_doc: usize,
pub max_relations_per_doc: usize,
pub community_max_levels: usize,
pub max_context_tokens: Option<usize>,
pub entity_matcher: Option<Box<dyn EntityMatcher>>,
}Expand description
Configuration for GraphRAG.
Fields§
§max_entities_per_doc: usize§max_relations_per_doc: usize§community_max_levels: usize§max_context_tokens: Option<usize>Maximum number of tokens for context in query prompts. When set, community summaries or subgraph context is truncated to fit.
entity_matcher: Option<Box<dyn EntityMatcher>>Custom entity matcher for local/hybrid queries. When None, uses the default KeywordMatcher.
Implementations§
Source§impl GraphRAGConfig
impl GraphRAGConfig
pub fn new() -> Self
pub fn with_max_entities_per_doc(self, n: usize) -> Self
pub fn with_max_relations_per_doc(self, n: usize) -> Self
pub fn with_community_max_levels(self, n: usize) -> Self
Sourcepub fn with_max_context_tokens(self, tokens: usize) -> Self
pub fn with_max_context_tokens(self, tokens: usize) -> Self
Sets the maximum number of tokens for context in query prompts.
When set, community summaries (Global/Hybrid) or subgraph context (Local/Hybrid) are truncated from lowest-priority items to fit within this budget.
Sourcepub fn with_entity_matcher(self, matcher: Box<dyn EntityMatcher>) -> Self
pub fn with_entity_matcher(self, matcher: Box<dyn EntityMatcher>) -> Self
Sets a custom entity matcher for local/hybrid queries.
When set, the matcher is used instead of the default keyword-based matching to find relevant entities.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphRAGConfig
impl !UnwindSafe for GraphRAGConfig
impl Freeze for GraphRAGConfig
impl Send for GraphRAGConfig
impl Sync for GraphRAGConfig
impl Unpin for GraphRAGConfig
impl UnsafeUnpin for GraphRAGConfig
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
Mutably borrows from an owned value. Read more