{
  "schema_version": "1.3.0",
  "slug": "what-memory-validity-invariants-must-survive-a-base-model-upgrade-that-changes-embedding-semantics",
  "title": "What memory validity invariants must survive a base model upgrade that changes embedding semantics?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** Memory is stored as embeddings, the embedding model can be upgraded, and the upgrade can change embedding semantics. * **Does not apply when:** Memory is stored in raw text/token form, or the embedding function is strict",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-memory-validity-invariants-must-survive-a-base-model-upgrade-that-changes-embedding-semantics.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-memory-validity-invariants-must-survive-a-base-model-upgrade-that-changes-embedding-semantics.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-memory-validity-invariants-must-survive-a-base-model-upgrade-that-changes-embedding-semantics.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1105,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **memory content preservation** (the stored memories were not lost during upgrade) and **memory retrievability preservation** (the stored memories can still be retrieved with equivalent semantics under the new embedding function). Relying on content preservation creates the **Embedding Semantic Gap**: the memories are all present in th...",
    "what_was_observed": "In memory-based agent architectures, failing to account for embedding semantic shift produces three primary failure modes: 1. **Retrieval Quality Collapse:** The agent queries \"relevant context for customer X\" and the vector store returns irrelevant memories because the query embedding is in the new space, and the stored vectors are in the old space. 2. **Silent Semantic Drift:** The agent retrieves memories that wer...",
    "condition_of_validity": "* **Applies when:** Memory is stored as embeddings, the embedding model can be upgraded, and the upgrade can change embedding semantics. * **Does not apply when:** Memory is stored in raw text/token form, or the embedding function is strictly immutable.",
    "decision_boundary": "1. **Has the base model's embedding function changed?** If no, standard memory retrieval applies. If yes, proceed. 2. **Does the `embedding_semantic_compatibility_receipt` show that old and new embeddings are compatible?** If yes, the memories are retrievable without re-embedding. If no, the memories are semantically drifted. 3. **Is the `query_embedding_rec...",
    "operational_effect": "1. **Retrieval Quality Preservation:** Ensures the agent can still retrieve relevant memories despite model upgrade. 2. **Migration Planning:** Provides a clear signal for when full re-embedding is required vs. when reconciliation is sufficient. 3. **Silent Drift Detection:** Prevents the agent from acting on irrelevant memories that were retrieved due to se..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "7e3102e965b81505e3d6ad774a2b1fadacb5f00b072c5e536cebb24558214417",
    "verified_classes": [
      "MemoryValidityVerdict",
      "MemoryState",
      "MemoryPolicy",
      "MemoryManifest",
      "MemoryEmbeddingGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_memory"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
