Skip to main content

validateAndDedupe

@forge/monorepo


@forge/monorepo / backend/src / validateAndDedupe

Function: validateAndDedupe()

validateAndDedupe(candidates, existing): readonly MemoryCandidate[]

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[]