Skip to main content

KgSemanticProvider

Struct KgSemanticProvider 

Source
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 KgSemanticProvider<OllamaKgExtractor>

Source

pub fn ollama(model: impl Into<String>) -> Self

Build an Ollama-backed KG semantic provider for a specific model tag (e.g. hf.co/Qwen/Qwen3-32B-GGUF:Q4_K_M). Honors OLLAMA_HOST via the underlying extractor.

Source§

impl<E: KgExtractor> KgSemanticProvider<E>

Source

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§

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>
where E: Send + ?Sized,

§

impl<E> Sync for KgSemanticProvider<E>
where E: Sync + ?Sized,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.