pub struct StreamingGraphRag { /* private fields */ }Expand description
A live-updating GraphRAG engine that processes streaming triple events and serves subgraph queries from a cache backed by the live graph.
Implementations§
Source§impl StreamingGraphRag
impl StreamingGraphRag
Sourcepub fn new(max_depth: usize) -> Self
pub fn new(max_depth: usize) -> Self
Create a new engine.
max_depth– BFS depth for subgraph extractioncache_ttl_msis ignored if 0 (no expiry)
Sourcepub fn with_cache_ttl(max_depth: usize, cache_ttl_ms: i64) -> Self
pub fn with_cache_ttl(max_depth: usize, cache_ttl_ms: i64) -> Self
Create with an explicit cache TTL in milliseconds (0 = no expiry).
Sourcepub fn process_event(&mut self, s: &str, p: &str, o: &str)
pub fn process_event(&mut self, s: &str, p: &str, o: &str)
Process an incoming triple event (always treated as “add”).
Sourcepub fn query_live(
&mut self,
pattern: &SubgraphPattern,
) -> Vec<(String, String, String)>
pub fn query_live( &mut self, pattern: &SubgraphPattern, ) -> Vec<(String, String, String)>
Query the live graph using pattern, returning cached results when fresh.
Sourcepub fn stats(&self) -> StreamingStats
pub fn stats(&self) -> StreamingStats
Return current statistics.
Sourcepub fn drain_events(&mut self) -> Vec<SubgraphEvent>
pub fn drain_events(&mut self) -> Vec<SubgraphEvent>
Drain buffered events from the underlying extractor.
Auto Trait Implementations§
impl Freeze for StreamingGraphRag
impl RefUnwindSafe for StreamingGraphRag
impl Send for StreamingGraphRag
impl Sync for StreamingGraphRag
impl Unpin for StreamingGraphRag
impl UnsafeUnpin for StreamingGraphRag
impl UnwindSafe for StreamingGraphRag
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
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>
Converts
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>
Converts
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