pub struct KgSemanticProvider<E: KgExtractor + ?Sized = OllamaKgExtractor> { /* private fields */ }Expand description
KG-backed semantic provider — routes extract_concepts through the
tsift-kg extraction pipeline so memgraphrag consumes real model-backed
entity extraction (spec line 27-28 of specs/local-kg-model.md).
Generic over KgExtractor so tests can drive the pipeline with a stub and
production can use OllamaKgExtractor (default). The Ollama embedder is
a #lmlazy follow-up; embed stays on the deterministic hash fallback
until the ollama embedding profile lands, so memgraphrag’s vector path
remains online regardless of whether a GPU extractor is available.
Implementations§
Source§impl<E: KgExtractor> KgSemanticProvider<E>
impl<E: KgExtractor> KgSemanticProvider<E>
Sourcepub fn with_extractor(extractor: E) -> Self
pub fn with_extractor(extractor: E) -> Self
Build a KG semantic provider over an arbitrary extractor. Tests use this to drive the pipeline deterministically without a live model.
Trait Implementations§
Source§impl<E: KgExtractor + ?Sized> SemanticProvider for KgSemanticProvider<E>
impl<E: KgExtractor + ?Sized> SemanticProvider for KgSemanticProvider<E>
fn metadata(&self) -> SemanticProviderMetadata
fn extract_concepts( &self, input: &SemanticProviderInput, ) -> Result<Vec<SemanticConceptCandidate>>
fn embed(&self, input: &str) -> Result<SemanticEmbedding>
Auto Trait Implementations§
impl<E> Freeze for KgSemanticProvider<E>where
E: ?Sized,
impl<E> RefUnwindSafe for KgSemanticProvider<E>where
E: RefUnwindSafe + ?Sized,
impl<E> Send for KgSemanticProvider<E>
impl<E> Sync for KgSemanticProvider<E>
impl<E> Unpin for KgSemanticProvider<E>where
E: ?Sized,
impl<E> UnsafeUnpin for KgSemanticProvider<E>where
E: ?Sized,
impl<E> UnwindSafe for KgSemanticProvider<E>where
E: UnwindSafe + ?Sized,
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