Conflict Resolution

Automatic detection and resolution of contradictory memories.

Cortex automatically detects when new memories conflict with existing ones. Conflicts are resolved by authority or recency, with dissent retained.

How Conflicts Are Detected

When a new memory is written, Cortex:

  1. Generates an embedding for the content
  2. Searches for near-neighbours with similarity > 0.75
  3. Classifies each neighbour as a potential conflict
graph LR
    A[New Memory] -->|embed| B[Vector Search]
    B -->|similarity > 0.75| C[Conflict Candidates]
    C -->|classify| D[Conflict Types]

Conflict Types

TypeDescription
contradictionConflicting information (e.g., "rate limit is 100" vs "rate limit is 200")
duplicateSame information from different sources
staleOutdated information replaced by newer data

Resolution Strategy

Conflicts are resolved using authority-based rules:

Authority Hierarchy

Authority is the memory's author's clearance level (not their role):

LevelAuthority
SeniorHighest
JuniorMiddle
ContractorLowest

Resolution Rules

  1. contradiction — higher-level author wins, resolution: "authority". A Senior's memory supersedes a Contractor's even if the Contractor's is newer — a lower-authority author cannot override a fact by simply writing something more recent.
  2. stale — the newer memory always wins, resolution: "recency", regardless of either author's level (it's an update, not a rank contest).
  3. Same level, contradiction — newer memory wins (tie broken by recency).
  4. Dissent retained — the loser is marked superseded, never deleted, and linked via supersedes so recall can flag "history available".

Conflict Data Structure

{
  "id": "uuid",
  "memory_a": "uuid",
  "memory_b": "uuid",
  "kind": "contradiction",
  "resolution": "authority",
  "winner": "uuid",
  "dissent_retained": true,
  "resolved_by": "uuid",
  "created_at": "2025-01-15T10:30:00Z"
}

Memory Lifecycle with Conflicts

stateDiagram-v2
    [*] --> Active: remember()
    Active --> Superseded: Conflict resolved (lost)
    Active --> Active: Conflict resolved (won)
    Superseded --> [*]: Retained but not recalled
StatusDescription
activeCurrently searchable
supersededReplaced by a more authoritative memory

Example

{
  "memory_id": "new-uuid",
  "conflict_candidates": [
    {
      "memory_id": "old-uuid",
      "score": 0.82
    }
  ],
  "conflicts": [
    {
      "id": "conflict-uuid",
      "kind": "contradiction",
      "resolution": "authority",
      "winner": "new-uuid"
    }
  ]
}

Conflicts are a feature, not a bug. They ensure Cortex stays consistent as new information arrives, while preserving the full history of decisions.