pub struct Config {Show 21 fields
pub output_dir: String,
pub chunk_size: usize,
pub chunk_overlap: usize,
pub max_entities_per_chunk: Option<usize>,
pub top_k_results: Option<usize>,
pub similarity_threshold: Option<f32>,
pub approach: String,
pub embeddings: EmbeddingConfig,
pub graph: GraphConfig,
pub text: TextConfig,
pub entities: EntityConfig,
pub retrieval: RetrievalConfig,
pub parallel: ParallelConfig,
pub ollama: OllamaConfig,
pub gliner: GlinerConfig,
pub enhancements: EnhancementsConfig,
pub auto_save: AutoSaveConfig,
pub summarization: HierarchicalConfig,
pub zero_cost_approach: ZeroCostApproachConfig,
pub advanced_features: AdvancedFeaturesConfig,
pub suppress_progress_bars: bool,
}Expand description
Configuration for the GraphRAG system
Fields§
§output_dir: StringOutput directory for storing graphs and data
chunk_size: usizeChunk size for text processing
chunk_overlap: usizeOverlap between chunks
max_entities_per_chunk: Option<usize>Maximum entities per chunk
top_k_results: Option<usize>Top-k results for retrieval
similarity_threshold: Option<f32>Similarity threshold for retrieval
approach: StringPipeline approach: “semantic”, “algorithmic”, or “hybrid” Determines which implementation strategy to use for entity extraction and retrieval
embeddings: EmbeddingConfigVector embedding configuration
graph: GraphConfigGraph construction parameters
text: TextConfigText processing settings
entities: EntityConfigEntity extraction settings
retrieval: RetrievalConfigRetrieval system configuration
parallel: ParallelConfigParallel processing configuration
ollama: OllamaConfigOllama integration configuration
gliner: GlinerConfigGLiNER-Relex extractor configuration
enhancements: EnhancementsConfigLatest enhancements configuration
auto_save: AutoSaveConfigAuto-save configuration for workspace persistence
summarization: HierarchicalConfigHierarchical summarization configuration
zero_cost_approach: ZeroCostApproachConfigZero-cost approach configuration
advanced_features: AdvancedFeaturesConfigAdvanced features configuration (Phases 2-3)
suppress_progress_bars: boolSuppress indicatif progress bars (use hidden draw target).
Set to true when running inside a TUI to avoid corrupting the terminal.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load configuration with hierarchical merging (stub for when feature is disabled)
When the hierarchical-config feature is not enabled, this falls back to Config::default().
Sourcepub fn from_toml_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_toml_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a TOML file with environment variable overrides
This is the preferred method for loading configuration from a specific file while still allowing environment variable overrides.
§Example
use graphrag_core::Config;
let config = Config::from_toml_file("./my-config.toml")?;Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Validatable for Config
impl Validatable for Config
Source§fn validate(&self) -> ValidationResult
fn validate(&self) -> ValidationResult
Source§fn validate_strict(&self) -> ValidationResult
fn validate_strict(&self) -> ValidationResult
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more