Skip to main content

KnowledgeBase

Struct KnowledgeBase 

Source
pub struct KnowledgeBase {
    pub storage: Storage,
    /* private fields */
}

Fields§

§storage: Storage

Implementations§

Source§

impl KnowledgeBase

Source

pub fn open(db_path: impl AsRef<Path>) -> Result<Self>

Source

pub fn open_with( db_path: impl AsRef<Path>, embedding: Option<Arc<dyn EmbeddingProvider>>, refiner: Option<Arc<dyn Refiner>>, distiller: Option<Arc<dyn Distiller>>, curator: Option<Arc<dyn Curator>>, sanitizer: Option<Arc<dyn Sanitizer>>, ) -> Result<Self>

Source

pub fn recall( &self, query: &str, budget: usize, trace: bool, include_sparks: bool, top: Option<usize>, source: &str, expand_deps: &str, allow_trim: bool, refine_mode: &str, ) -> Result<RecallResult>

Source

pub fn record( &self, trace_id: &str, query: Option<&str>, output: Option<&str>, output_summary: Option<&str>, outcome: Option<&str>, used: Option<&[String]>, feedback_up: Option<&[String]>, feedback_down: Option<&[String]>, nomination: Option<&str>, priority: i64, source: &str, ) -> Result<()>

Source

pub fn add( &self, content: &str, kind: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, source: &str, skill_name: Option<&str>, ) -> Result<String>

Source

pub fn spark( &self, content: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, ) -> Result<String>

Source

pub fn mature_spark(&self, spark_id: &str, to: &str) -> Result<()>

Source

pub fn promote_spark(&self, spark_id: &str, to: &str) -> Result<String>

Source

pub fn drop_spark(&self, spark_id: &str, reason: &str) -> Result<()>

Source

pub fn approve(&self, chunk_id: &str) -> Result<()>

Source

pub fn archive(&self, chunk_id: &str, reason: &str) -> Result<()>

Source

pub fn invalidate(&self, chunk_id: &str, reason: &str) -> Result<()>

Source

pub fn restore(&self, chunk_id: &str) -> Result<()>

Source

pub fn evolve(&self, trigger: &str) -> Result<Value>

Source

pub fn inspect(&self) -> Result<Value>

Source

pub fn rebuild_embeddings(&self) -> Result<usize>

Source

pub fn inspect_id(&self, id: &str) -> Result<Value>

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.