pub struct SemanticDeduplicationEngine { /* private fields */ }Expand description
Main semantic deduplication engine with production-ready safety and concurrency controls
Implementations§
Source§impl SemanticDeduplicationEngine
impl SemanticDeduplicationEngine
pub fn new( config: SemanticDeduplicationConfig, repository: Arc<MemoryRepository>, embedding_service: Arc<dyn EmbeddingService>, ) -> Self
Sourcepub async fn deduplicate_batch(
&self,
memory_ids: &[Uuid],
) -> Result<DeduplicationResult>
pub async fn deduplicate_batch( &self, memory_ids: &[Uuid], ) -> Result<DeduplicationResult>
Perform semantic deduplication on a batch of memories with distributed locking and transaction safety
Sourcepub fn calculate_cosine_similarity(&self, a: &Vector, b: &Vector) -> Result<f32>
pub fn calculate_cosine_similarity(&self, a: &Vector, b: &Vector) -> Result<f32>
Calculate cosine similarity between two embeddings
Sourcepub async fn run_auto_pruning(&self) -> Result<PruningResult>
pub async fn run_auto_pruning(&self) -> Result<PruningResult>
Run auto-pruning based on recall probability thresholds
Sourcepub async fn maintain_memory_headroom(
&self,
) -> Result<HeadroomMaintenanceResult>
pub async fn maintain_memory_headroom( &self, ) -> Result<HeadroomMaintenanceResult>
Check and maintain memory headroom
Sourcepub async fn get_memory_statistics(&self) -> Result<MemoryStatistics>
pub async fn get_memory_statistics(&self) -> Result<MemoryStatistics>
Get comprehensive memory statistics
Sourcepub async fn get_metrics(&self) -> DeduplicationMetrics
pub async fn get_metrics(&self) -> DeduplicationMetrics
Get current deduplication metrics
Sourcepub async fn deduplicate_large_batch(
&self,
memory_ids: &[Uuid],
) -> Result<DeduplicationResult>
pub async fn deduplicate_large_batch( &self, memory_ids: &[Uuid], ) -> Result<DeduplicationResult>
Process large memory batches with intelligent batching and concurrency control
Auto Trait Implementations§
impl Freeze for SemanticDeduplicationEngine
impl !RefUnwindSafe for SemanticDeduplicationEngine
impl Send for SemanticDeduplicationEngine
impl Sync for SemanticDeduplicationEngine
impl Unpin for SemanticDeduplicationEngine
impl !UnwindSafe for SemanticDeduplicationEngine
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> 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