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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright 2026 Mahmoud Harmouch.
//
// Licensed under the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! # `Reflector` - reward-gated introspection.
//!
//! The `Reflector` serves two roles in the ThinkLoop:
//!
//! 1. **Query formulation** - generates the next DuckDuckGo search query by
//! fusing the goal with the most relevant hot-store context.
//! 2. **Memory consolidation** - promotes high-reward hot entries to cold at
//! the end of each loop run.
//!
//! ## Examples
//!
//! ```rust
//! use lmm_agent::cognition::reflect::Reflector;
//! use lmm_agent::cognition::memory::{HotStore, MemoryEntry};
//!
//! let mut hot = HotStore::new(10);
//! hot.push(MemoryEntry::new("Rust ownership semantics".into(), 0.9, 0));
//! let query = Reflector::formulate_query("How does Rust manage memory?", &hot);
//! assert!(!query.is_empty());
//! ```
//!
//! ## See Also
//!
//! * [Metacognition - Wikipedia](https://en.wikipedia.org/wiki/Metacognition)
//! * [Self-reflection - Wikipedia](https://en.wikipedia.org/wiki/Self-reflection)
use crate;
/// Stateless utility that formulates queries and consolidates memory.
;
// Copyright 2026 Mahmoud Harmouch.
//
// Licensed under the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.