pub struct ReflectService { /* private fields */ }Expand description
Deterministic reflection engine for reinforcement and contradiction detection.
Operates over perspective-aligned Explicit and Derived memories within a single
namespace. Each cycle is bounded by MAX_CANDIDATES and idempotent — pairs that
already have evidence links are skipped.
Implementations§
Source§impl ReflectService
impl ReflectService
pub fn new( config: AgentConfig, cognition: CognitionConfig, embeddings: Option<Arc<dyn EmbeddingService>>, ) -> Self
Sourcepub async fn reflect_cycle(
&self,
namespace_id: i64,
repo: &MemoryRepository,
) -> Result<ReflectionResult, AgentError>
pub async fn reflect_cycle( &self, namespace_id: i64, repo: &MemoryRepository, ) -> Result<ReflectionResult, AgentError>
Run a single bounded reflection cycle over the namespace’s memories.
Scans up to MAX_CANDIDATES non-raw memories, compares all eligible pairs,
and persists reinforcement or contradiction outputs. Returns a summary of
what was found and created.
pub async fn reflect_perspective_cycle( &self, namespace_id: i64, perspective: &PerspectiveKey, repo: &MemoryRepository, ) -> Result<ReflectionResult, AgentError>
Sourcepub fn compare_pair(left: &Memory, right: &Memory) -> Option<ReflectionCase>
pub fn compare_pair(left: &Memory, right: &Memory) -> Option<ReflectionCase>
Compare two memories and return the reflection case, if any.
This is the pure deterministic comparison logic, exposed for testing and future LLM augmentation hooks.
Auto Trait Implementations§
impl Freeze for ReflectService
impl !RefUnwindSafe for ReflectService
impl Send for ReflectService
impl Sync for ReflectService
impl Unpin for ReflectService
impl UnsafeUnpin for ReflectService
impl !UnwindSafe for ReflectService
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