pub struct KnowledgeBase {
pub storage: Storage,
/* private fields */
}Fields§
§storage: StorageImplementations§
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn appraise(&self, params: AppraiseParams<'_>) -> Result<Verdict>
Source§impl KnowledgeBase
impl KnowledgeBase
Source§impl KnowledgeBase
impl KnowledgeBase
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>
Sourcepub fn add_with_deps(
&self,
content: &str,
kind: &str,
trigger_desc: Option<&str>,
anti_trigger_desc: Option<&str>,
source: &str,
skill_name: Option<&str>,
deps: &[(String, String)],
) -> Result<String>
pub fn add_with_deps( &self, content: &str, kind: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, source: &str, skill_name: Option<&str>, deps: &[(String, String)], ) -> Result<String>
Full-form writer: persist a chunk, its vectors, and all declared
dependencies in a single transaction. Each dep is (dst_chunk_id, kind); kind ∈ {soft,hard}. Dependency targets are validated to
exist inside the transaction, so a bad dependency rolls back the whole
write — the chunk is never persisted on its own.
Sourcepub fn add_dependency(&self, src: &str, dst: &str, kind: &str) -> Result<()>
pub fn add_dependency(&self, src: &str, dst: &str, kind: &str) -> Result<()>
Declare that chunk src depends on chunk dst.
kind is "hard" (fail-closed: if dst is unavailable or archived at
recall time the whole seed is dropped) or "soft" (a recall-time
ranking bonus). Both chunks must exist. Idempotent — re-declaring the
same edge is a no-op (INSERT OR IGNORE).
pub fn spark( &self, content: &str, trigger_desc: Option<&str>, anti_trigger_desc: Option<&str>, ) -> Result<String>
pub fn mature_spark(&self, spark_id: &str, to: &str) -> Result<()>
pub fn promote_spark(&self, spark_id: &str, to: &str) -> Result<String>
pub fn drop_spark(&self, spark_id: &str, reason: &str) -> Result<()>
pub fn approve(&self, chunk_id: &str) -> Result<()>
pub fn archive(&self, chunk_id: &str, reason: &str) -> Result<()>
pub fn invalidate(&self, chunk_id: &str, reason: &str) -> Result<()>
pub fn restore(&self, chunk_id: &str) -> Result<()>
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn recall(&self, params: RecallParams<'_>) -> Result<RecallResult>
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn record(&self, params: RecordParams<'_>) -> Result<()>
Source§impl KnowledgeBase
impl KnowledgeBase
pub fn open(db_path: impl AsRef<Path>) -> Result<Self>
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>
Auto Trait Implementations§
impl !Freeze for KnowledgeBase
impl !RefUnwindSafe for KnowledgeBase
impl !Sync for KnowledgeBase
impl !UnwindSafe for KnowledgeBase
impl Send for KnowledgeBase
impl Unpin for KnowledgeBase
impl UnsafeUnpin for KnowledgeBase
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