Class: RetrievalFeedbackSignal
Defined in: packages/agentos/src/cognition/memory/retrieval/feedback/RetrievalFeedbackSignal.ts:112
Detects which injected memory traces were used vs ignored by the LLM,
persists those signals to the retrieval_feedback table, and applies a
best-effort trace-strength update in memory_traces.
Lifecycle:
- Before generation: retrieve relevant traces and inject them into the prompt.
- After response delivery (non-blocking): call
detect(injectedTraces, response). - The signal is recorded immediately and the underlying trace is nudged toward reinforcement or decay.
- The consolidation pipeline can still read
getStats(traceId)later for broader aggregate decisions.
Constructors
Constructor
new RetrievalFeedbackSignal(
brain,similarityFn?):RetrievalFeedbackSignal
Defined in: packages/agentos/src/cognition/memory/retrieval/feedback/RetrievalFeedbackSignal.ts:120
Parameters
brain
The agent's SQLite brain; used to persist and query feedback rows.
similarityFn?
(a, b) => Promise<number>
Optional semantic similarity function for higher-fidelity detection. Receives two strings and returns a promise of a similarity score in [0, 1]. When provided, the score supplements the keyword heuristic, but the current implementation uses the keyword path only (reserved for future use).
Returns
RetrievalFeedbackSignal