1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! # mentedb-cognitive: Cognitive Engine for MenteDB
//!
//! This crate implements the seven cognitive features that distinguish MenteDB
//! from a conventional vector database. These features run at write time and
//! read time, giving the engine awareness of the knowledge it holds.
//!
//! ## Modules
//!
//! - [`interference`]: Detects pairs of memories similar enough to confuse an LLM,
//! generates disambiguation text, and reorders context to maximize separation.
//!
//! - [`pain`]: Records negative experiences (failed actions, user corrections) as
//! pain signals with intensity and decay. Surfaces warnings during context assembly.
//!
//! - [`phantom`]: Detects references to entities not present in the knowledge base
//! (phantom memories). Flags gaps so the agent can acquire missing knowledge.
//!
//! - [`speculative`]: Pre-assembles context windows for predicted upcoming queries
//! based on conversation trajectory. Uses Jaccard keyword overlap for cache hits.
//!
//! - [`stream`]: Monitors the LLM's output token stream in real time, comparing
//! against stored facts to detect contradictions, forgotten knowledge, corrections,
//! and reinforcements mid-generation.
//!
//! - [`trajectory`]: Tracks the reasoning arc of a conversation as a sequence of
//! decision states. Supports resume context generation and next-topic prediction.
//!
//! - [`write_inference`]: Runs inference at write time to detect contradictions,
//! create relationship edges, mark obsolete memories, adjust confidence, and
//! trigger belief propagation automatically.
/// Interference detection between confusable memories.
/// Pain signal registry for negative experience tracking.
/// Phantom memory detection for knowledge gaps.
/// Speculative context pre assembly cache.
/// Real time LLM output stream monitoring.
/// Conversation trajectory tracking and prediction.
/// Write time inference engine for automatic relationship discovery.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;