validateAndDedupe
@forge/monorepo / backend/src / validateAndDedupe
Function: validateAndDedupe()
validateAndDedupe(
candidates,existing): readonlyMemoryCandidate[]
Defined in: backend/src/principal-memory/index.ts:73
The deterministic gate between model output and durable memory: trims, enforces bounds, and dedupes candidates against each other and existing entries by normalized text. Returns the accepted candidates to commit — so raw model output is never stored, only validated, unique memories.
Parameters
candidates
readonly MemoryCandidate[]
existing
readonly PrincipalMemoryEntry[]
Returns
readonly MemoryCandidate[]