pub struct GraphRetrievalBuilder { /* private fields */ }Expand description
Builder for creating graph-based retrieval systems
Implementations§
Source§impl GraphRetrievalBuilder
impl GraphRetrievalBuilder
Sourcepub fn with_config(self, config: GraphBuildConfig) -> Self
pub fn with_config(self, config: GraphBuildConfig) -> Self
Set the build configuration
Sourcepub fn with_entity_extractor(self, extractor: Box<dyn EntityExtractor>) -> Self
pub fn with_entity_extractor(self, extractor: Box<dyn EntityExtractor>) -> Self
Set the entity extractor
Sourcepub fn with_rule_based_entity_extractor(
self,
config: EntityExtractionConfig,
) -> RragResult<Self>
pub fn with_rule_based_entity_extractor( self, config: EntityExtractionConfig, ) -> RragResult<Self>
Use rule-based entity extractor with custom config
Sourcepub fn with_storage(self, storage: Box<dyn GraphStorage>) -> Self
pub fn with_storage(self, storage: Box<dyn GraphStorage>) -> Self
Set the graph storage backend
Sourcepub fn with_in_memory_storage(self, config: GraphStorageConfig) -> Self
pub fn with_in_memory_storage(self, config: GraphStorageConfig) -> Self
Use in-memory storage with custom config
Sourcepub fn with_embedding_service(self) -> Self
pub fn with_embedding_service(self) -> Self
Set the embedding service (placeholder)
Sourcepub fn with_retrieval_config(self, config: GraphRetrievalConfig) -> Self
pub fn with_retrieval_config(self, config: GraphRetrievalConfig) -> Self
Set the retrieval configuration
Sourcepub fn with_query_expansion(self, enabled: bool) -> Self
pub fn with_query_expansion(self, enabled: bool) -> Self
Enable/disable query expansion
Sourcepub fn with_pagerank_scoring(self, enabled: bool) -> Self
pub fn with_pagerank_scoring(self, enabled: bool) -> Self
Enable/disable PageRank scoring
Sourcepub fn with_scoring_weights(
self,
graph_weight: f32,
similarity_weight: f32,
) -> Self
pub fn with_scoring_weights( self, graph_weight: f32, similarity_weight: f32, ) -> Self
Set graph vs similarity scoring weights
Sourcepub fn with_max_graph_hops(self, max_hops: usize) -> Self
pub fn with_max_graph_hops(self, max_hops: usize) -> Self
Set maximum graph traversal hops
Sourcepub fn with_expansion_strategies(
self,
strategies: Vec<ExpansionStrategy>,
) -> Self
pub fn with_expansion_strategies( self, strategies: Vec<ExpansionStrategy>, ) -> Self
Set expansion strategies
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set batch size for document processing
Sourcepub fn with_parallel_processing(self, enabled: bool) -> Self
pub fn with_parallel_processing(self, enabled: bool) -> Self
Enable/disable parallel processing
Sourcepub async fn build_from_documents(
self,
documents: Vec<Document>,
progress_callback: Option<Box<dyn ProgressCallback>>,
) -> RragResult<GraphRetriever>
pub async fn build_from_documents( self, documents: Vec<Document>, progress_callback: Option<Box<dyn ProgressCallback>>, ) -> RragResult<GraphRetriever>
Build graph retriever from documents
Sourcepub async fn build_from_chunks(
self,
chunks: Vec<DocumentChunk>,
progress_callback: Option<Box<dyn ProgressCallback>>,
) -> RragResult<GraphRetriever>
pub async fn build_from_chunks( self, chunks: Vec<DocumentChunk>, progress_callback: Option<Box<dyn ProgressCallback>>, ) -> RragResult<GraphRetriever>
Build graph retriever from document chunks
Sourcepub async fn build_empty(self) -> RragResult<GraphRetriever>
pub async fn build_empty(self) -> RragResult<GraphRetriever>
Create an empty graph retriever for incremental building
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphRetrievalBuilder
impl !RefUnwindSafe for GraphRetrievalBuilder
impl Send for GraphRetrievalBuilder
impl Sync for GraphRetrievalBuilder
impl Unpin for GraphRetrievalBuilder
impl !UnwindSafe for GraphRetrievalBuilder
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