pub struct PersistentIntelligenceEngine {
pub pkg: PersonalKnowledgeGraph,
pub stm: SourceTrustMemory,
pub fpm: FailurePatternMemory,
pub qpm: QueryPredictionModel,
}Expand description
The 4-layer Persistent Intelligence Engine.
Fields§
§pkg: PersonalKnowledgeGraph§stm: SourceTrustMemory§fpm: FailurePatternMemory§qpm: QueryPredictionModelImplementations§
Source§impl PersistentIntelligenceEngine
impl PersistentIntelligenceEngine
Sourcepub fn new() -> Result<Self, FetchiumError>
pub fn new() -> Result<Self, FetchiumError>
Open all 4 layers from the default intelligence data directory.
Sourcepub fn observe_search(
&self,
query: &str,
result_domains: &[&str],
topic: &str,
) -> Result<(), FetchiumError>
pub fn observe_search( &self, query: &str, result_domains: &[&str], topic: &str, ) -> Result<(), FetchiumError>
Observe a completed search: update STM for each result domain and log the query.
Sourcepub fn observe_fetch(
&self,
domain: &str,
url: &str,
layer: u8,
success: bool,
error: Option<&str>,
duration_ms: u64,
relevance: f64,
) -> Result<(), FetchiumError>
pub fn observe_fetch( &self, domain: &str, url: &str, layer: u8, success: bool, error: Option<&str>, duration_ms: u64, relevance: f64, ) -> Result<(), FetchiumError>
Observe a fetch attempt and record in both STM and FPM.
Sourcepub fn stats(&self) -> Result<PieStats, FetchiumError>
pub fn stats(&self) -> Result<PieStats, FetchiumError>
Aggregate statistics across all 4 layers.
Sourcepub fn reset_all(&self) -> Result<(), FetchiumError>
pub fn reset_all(&self) -> Result<(), FetchiumError>
Reset all learned data across all layers.
Sourcepub fn export_json(&self) -> Result<String, FetchiumError>
pub fn export_json(&self) -> Result<String, FetchiumError>
Export a human-readable JSON summary of all layers.
Auto Trait Implementations§
impl !Freeze for PersistentIntelligenceEngine
impl RefUnwindSafe for PersistentIntelligenceEngine
impl Send for PersistentIntelligenceEngine
impl Sync for PersistentIntelligenceEngine
impl Unpin for PersistentIntelligenceEngine
impl UnsafeUnpin for PersistentIntelligenceEngine
impl UnwindSafe for PersistentIntelligenceEngine
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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