pub struct AutoPilotEngine {
pub config: AutoPilotConfig,
}Expand description
Auto-Pilot engine that runs deduplication and consolidation as background tasks.
Fields§
§config: AutoPilotConfigImplementations§
Source§impl AutoPilotEngine
impl AutoPilotEngine
pub fn new(config: AutoPilotConfig) -> Self
Sourcepub async fn run_dedup(&self, storage: &Arc<dyn VectorStorage>) -> DedupResult
pub async fn run_dedup(&self, storage: &Arc<dyn VectorStorage>) -> DedupResult
Run deduplication across all agent namespaces.
For each _dakera_agent_* namespace, compares all memory pairs using
cosine similarity on their stored embeddings. When a pair exceeds the
threshold, the memory with the lower retention score is deleted.
Sourcepub async fn run_consolidation(
&self,
storage: &Arc<dyn VectorStorage>,
) -> ConsolidationResult
pub async fn run_consolidation( &self, storage: &Arc<dyn VectorStorage>, ) -> ConsolidationResult
Run consolidation across all agent namespaces.
Finds clusters of 3+ memories sharing 2+ tags where ALL members have importance < 0.3, then merges each cluster into a single Semantic memory with combined content, union of tags, and max importance.
Sourcepub fn spawn(
config: Arc<RwLock<AutoPilotConfig>>,
storage: Arc<dyn VectorStorage>,
metrics: Arc<BackgroundMetrics>,
) -> (JoinHandle<()>, JoinHandle<()>)
pub fn spawn( config: Arc<RwLock<AutoPilotConfig>>, storage: Arc<dyn VectorStorage>, metrics: Arc<BackgroundMetrics>, ) -> (JoinHandle<()>, JoinHandle<()>)
Spawn the auto-pilot as two background tokio tasks (dedup + consolidation).
Takes a shared Arc<RwLock<AutoPilotConfig>> so that config changes made at
runtime via the PILOT-2 endpoint (PUT /admin/autopilot/config) take effect
without a server restart. Each loop iteration re-reads the config before
sleeping, so interval and threshold changes apply on the next cycle.
Auto Trait Implementations§
impl Freeze for AutoPilotEngine
impl RefUnwindSafe for AutoPilotEngine
impl Send for AutoPilotEngine
impl Sync for AutoPilotEngine
impl Unpin for AutoPilotEngine
impl UnsafeUnpin for AutoPilotEngine
impl UnwindSafe for AutoPilotEngine
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
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>
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>
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