ContradictionDetectionService
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:10
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ContradictionDetectionService():
ContradictionDetectionService
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:15
Returns
Section titled “Returns”ContradictionDetectionService
Methods
Section titled “Methods”annotateContradicted()
Section titled “annotateContradicted()”annotateContradicted(
metadata,counterpartId,reason):Record<string,unknown>
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:108
Annotate a memory as contradicted-but-kept (G3-T4, policy flag).
Applied symmetrically to BOTH rows of a contradicted pair; each points at
its counterpart. Unlike supersededBy, this never hides the row — the
recall filter keys on supersededBy/status === 'superseded' only, so a
contradicted row still surfaces, carrying the review fields. As with the
decay-rewritten status for superseded rows, contradictionWith is the
durable marker: status may later be recomputed by the importance/decay
pass, but the review fields are written once and never cleared.
Parameters
Section titled “Parameters”metadata
Section titled “metadata”Record<string, unknown> | null | undefined
counterpartId
Section titled “counterpartId”string
reason
Section titled “reason”string
Returns
Section titled “Returns”Record<string, unknown>
annotateContradictor()
Section titled “annotateContradictor()”annotateContradictor(
metadata,match,existingContentSummary):Record<string,unknown>
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:61
Annotate the new memory’s metadata to record the contradiction it introduces.
Parameters
Section titled “Parameters”metadata
Section titled “metadata”Record<string, unknown> | null | undefined
existingContentSummary
Section titled “existingContentSummary”string
Returns
Section titled “Returns”Record<string, unknown>
annotateSuperseded()
Section titled “annotateSuperseded()”annotateSuperseded(
metadata,supersededById,reason):Record<string,unknown>
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:85
Annotate the old memory’s metadata to record that it was superseded.
Parameters
Section titled “Parameters”metadata
Section titled “metadata”Record<string, unknown> | null | undefined
supersededById
Section titled “supersededById”string
reason
Section titled “reason”string
Returns
Section titled “Returns”Record<string, unknown>
detect()
Section titled “detect()”detect(
newContent,candidates):ContradictionMatch|null
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:41
Find the first candidate that contradicts newContent using heuristics.
Candidates are filtered to the [thresholdLow, thresholdHigh) similarity band before heuristic checks run — high similarity ensures shared subject matter while staying below the duplicate zone.
The match’s action reflects the boot-configured policy (G3-T4):
flagged under flag (default — both rows kept and marked), superseded
under supersede (latest-wins).
Parameters
Section titled “Parameters”newContent
Section titled “newContent”string
candidates
Section titled “candidates”Returns
Section titled “Returns”ContradictionMatch | null
getHighThreshold()
Section titled “getHighThreshold()”getHighThreshold():
number
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:125
Returns
Section titled “Returns”number
getLowThreshold()
Section titled “getLowThreshold()”getLowThreshold():
number
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:121
Returns
Section titled “Returns”number
getPolicy()
Section titled “getPolicy()”getPolicy():
ContradictionPolicy
Defined in: packages/memory-ltm/src/contradiction-detection.service.ts:129