Skip to main content

KnowledgeBase

Trait KnowledgeBase 

Source
pub trait KnowledgeBase: Send + Sync {
Show 15 methods // Required methods fn record(&mut self, experiment: ExperimentRecord) -> Result<()>; fn all(&self) -> Result<Vec<ExperimentRecord>>; fn len(&self) -> usize; // Provided methods fn refresh(&mut self) -> Result<usize> { ... } fn is_empty(&self) -> bool { ... } fn get(&self, id: &str) -> Result<Option<ExperimentRecord>> { ... } fn search( &self, query: &str, max_results: usize, ) -> Result<Vec<ExperimentRecord>> { ... } fn retrieve(&self, query: &RetrievalQuery) -> Result<Vec<ScoredRecord>> { ... } fn lineage(&self, id: &str) -> Result<Option<Lineage>> { ... } fn experiments_in_line(&self, line: &str) -> Result<Vec<ExperimentRecord>> { ... } fn research_lines(&self) -> Result<Vec<ResearchLine>> { ... } fn promising_lines(&self, metric: &str) -> Result<Vec<ResearchLine>> { ... } fn trajectory(&self, line: &str, metric: &str) -> Result<Vec<(String, f64)>> { ... } fn change_points( &self, line: &str, metric: &str, threshold: f64, ) -> Result<Vec<ChangePoint>> { ... } fn children(&self, experiment_id: &str) -> Result<Vec<ExperimentRecord>> { ... }
}
Expand description

Trait for knowledge base backends.

Required Methods§

Source

fn record(&mut self, experiment: ExperimentRecord) -> Result<()>

Store a new experiment record.

Source

fn all(&self) -> Result<Vec<ExperimentRecord>>

Every record this base holds, in insertion order.

Source

fn len(&self) -> usize

Total number of experiments.

Provided Methods§

Source

fn refresh(&mut self) -> Result<usize>

Pick up records another process appended since this handle was opened. Returns how many were newly loaded.

Defaults to a no-op for bases with nothing behind them. A long-lived reader (the MCP server) must call this before a read, or it answers from a snapshot that gets staler by the hour.

Source

fn is_empty(&self) -> bool

Whether the base holds no records at all.

Source

fn get(&self, id: &str) -> Result<Option<ExperimentRecord>>

Get an experiment by ID.

Source

fn search( &self, query: &str, max_results: usize, ) -> Result<Vec<ExperimentRecord>>

Substring search over name, hypothesis, notes, tags and pipeline.

Kept as a cheap literal filter; retrieve is the ranked one.

Source

fn retrieve(&self, query: &RetrievalQuery) -> Result<Vec<ScoredRecord>>

Rank records against a query by relevance, structure, recency and importance. See crate::retrieval for the formula.

Source

fn lineage(&self, id: &str) -> Result<Option<Lineage>>

An experiment with its ancestors and descendants.

Source

fn experiments_in_line(&self, line: &str) -> Result<Vec<ExperimentRecord>>

List experiments in a research line, ordered chronologically.

Source

fn research_lines(&self) -> Result<Vec<ResearchLine>>

Get all research lines with trend analysis.

Source

fn promising_lines(&self, metric: &str) -> Result<Vec<ResearchLine>>

Find promising research lines (improving trend, high metric values).

Source

fn trajectory(&self, line: &str, metric: &str) -> Result<Vec<(String, f64)>>

Get the metric trajectory for a research line.

Source

fn change_points( &self, line: &str, metric: &str, threshold: f64, ) -> Result<Vec<ChangePoint>>

Detect change points where metrics shifted significantly.

Source

fn children(&self, experiment_id: &str) -> Result<Vec<ExperimentRecord>>

Direct children of an experiment.

Implementors§