{
  "schemaVersion": 1,
  "id": "atlas-lesson-context-memory-provenance",
  "title": "Context, retrieval and durable memory",
  "category": "learning",
  "format": "Atlas lesson",
  "description": "Separate context window, retrieved passages, workflow state, durable user data and model parameters.",
  "canonicalUrl": "https://semiaifoundry.com/learn/atlas/context-memory-provenance/",
  "publishedDate": null,
  "revisionDate": "2026-10-07",
  "author": null,
  "topic": "Authority, context and execution boundaries",
  "series": null,
  "license": null,
  "rightsUrl": "https://semiaifoundry.com/ai-atlas/licenses.html",
  "version": "1.3.0",
  "status": "Published educational lesson",
  "evidenceScope": "This is a worked explanation, not an executing external platform, model or robot. The quantities and fixtures are authored. Source scope is recorded in the automation learning review manifest; no source benchmark or private system behavior is claimed. The example declares one accounting convention and tokenizer. Real services can impose additional or different input/output limits; words are not substituted for tokens.",
  "contentCoverage": "published-lesson",
  "artifactUrl": "https://semiaifoundry.com/ai-atlas/lesson-data/context-memory-provenance-a709dfd8c8eaeb5f.json",
  "interactiveUrl": "https://semiaifoundry.com/ai-atlas/#context-memory-provenance",
  "related": [],
  "supersedes": [],
  "supersededBy": [],
  "contentHash": "1175bd13068c3be277d644927b6208cf1d18826ef4ade24a6abe15644b65ac21",
  "contentLength": 6425,
  "jsonUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-context-memory-provenance.json",
  "markdownUrl": "https://semiaifoundry.com/agents/publications/atlas-lesson-context-memory-provenance.md",
  "sections": [
    {
      "id": "section-1",
      "title": "Context, retrieval and durable memory",
      "start": 60,
      "end": 511
    },
    {
      "id": "section-2",
      "title": "The mechanism",
      "start": 511,
      "end": 1772
    },
    {
      "id": "section-3",
      "title": "Science and assumptions",
      "start": 1772,
      "end": 1800
    },
    {
      "id": "section-4",
      "title": "Context, retrieval and durable memory · explicit relationship",
      "start": 1800,
      "end": 3040
    },
    {
      "id": "section-5",
      "title": "Engineering example",
      "start": 3040,
      "end": 3603
    },
    {
      "id": "section-6",
      "title": "Distinctions and tradeoffs",
      "start": 3603,
      "end": 3959
    },
    {
      "id": "section-7",
      "title": "Specifications and interfaces",
      "start": 3959,
      "end": 4414
    },
    {
      "id": "section-8",
      "title": "Interfaces",
      "start": 4414,
      "end": 4727
    },
    {
      "id": "section-9",
      "title": "Check your understanding",
      "start": 4727,
      "end": 4756
    },
    {
      "id": "section-10",
      "title": "Which action changes this invocation’s context without necessarily changing its model parameters?",
      "start": 4756,
      "end": 5131
    },
    {
      "id": "section-11",
      "title": "Evidence and scope",
      "start": 5131,
      "end": 5712
    },
    {
      "id": "section-12",
      "title": "Sources",
      "start": 5712,
      "end": 6123
    },
    {
      "id": "section-13",
      "title": "Continue exploring",
      "start": 6123,
      "end": 6146
    },
    {
      "id": "section-14",
      "title": "Foundations",
      "start": 6146,
      "end": 6318
    },
    {
      "id": "section-15",
      "title": "Related lessons",
      "start": 6318,
      "end": 6425
    }
  ],
  "citations": [
    {
      "title": "Explore in Atlas",
      "url": "https://semiaifoundry.com/ai-atlas/#context-memory-provenance"
    },
    {
      "title": "LangGraph persistence",
      "url": "https://docs.langchain.com/oss/python/langgraph/persistence"
    },
    {
      "title": "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks",
      "url": "https://arxiv.org/abs/2005.11401"
    },
    {
      "title": "Published lesson data",
      "url": "https://semiaifoundry.com/ai-atlas/lesson-data/context-memory-provenance-a709dfd8c8eaeb5f.json"
    },
    {
      "title": "Atlas releases and licensing",
      "url": "https://semiaifoundry.com/ai-atlas/licenses.html"
    },
    {
      "title": "Tools, memory & agent loop",
      "url": "https://semiaifoundry.com/learn/atlas/tool-loop/"
    },
    {
      "title": "Key–value cache",
      "url": "https://semiaifoundry.com/learn/atlas/kv-cache/"
    },
    {
      "title": "Evaluation & the AGI frontier",
      "url": "https://semiaifoundry.com/learn/atlas/evaluation/"
    }
  ],
  "recordHash": "900e18f338ca1698d5c603179bee33dfd90c7243314ac7e085e6088a6c740658",
  "contentFormat": "text/markdown",
  "content": "Authority, context and execution boundaries · Atlas v1.3.0\n\n# Context, retrieval and durable memory\n\nSeparate context window, retrieved passages, workflow state, durable user data and model parameters.\n\n[Explore in Atlas](https://semiaifoundry.com/ai-atlas/#context-memory-provenance)Logical state, task evidence and declared units; no physical assembly scale\n\nLearning objectiveClassify each retained object by lifetime and reproduce a context budget without confusing tokens, facts, journals and parameters.\n\n## The mechanism\n\nThe word memory can refer to several objects with different lifetimes. A model context contains the tokens supplied to a particular invocation. Retrieved passages are selected external data with source identities. A workflow journal stores execution events. Durable user or application records can survive sessions, while model parameters change only through an actual training or adaptation process. KV cache is another representation of computation for a particular sequence and model, not a database of verified facts. Confusing these objects leads to claims such as a retrieved note teaching the weights or an old conversation proving that an action committed. Context construction should therefore expose which items are present, omitted or summarized, where they came from, and who is permitted to read them.\n\n1.  The application identifies task instructions, history, retrieved evidence and tool observations separately.\n2.  Each included item retains provenance, applicability and access scope before it enters the current context.\n3.  The declared tokenizer and context budget determine how much input and reserved output can fit.\n4.  Durable records and model weights remain separate from the transient invocation and its KV cache.\n\n## Science and assumptions\n\n### Context, retrieval and durable memory · explicit relationship\n\n$$\nL_{\\mathrm{task}}+L_{\\mathrm{history}}+L_{\\mathrm{evidence}}+L_{\\mathrm{tools}}+L_{\\mathrm{output}}\\le C\n$$\n\nThe sum of included input-token counts and reserved output tokens must fit the stated context capacity.\n\nSymbols and units\n\nLtask, Lhistory, Levidence, Ltools\n\nToken counts of the named input components under one tokenizer\n\ntokens\n\nLoutput\n\nReserved output-token capacity in this example\n\ntokens\n\nC\n\nStated total context capacity\n\ntokens\n\nA synthetic context capacity is 2,048 tokens under one declared tokenizer. System/task text uses 256, conversation history 512, retrieved evidence 640, tool descriptions 128 and reserved output 512: the total is exactly 2,048. Adding a 256-token duplicate passage would exceed the budget unless another item is removed or the reservation changes. Removing that duplicate can restore capacity, but it does not prove that all needed evidence remains. These counts are hypothetical tokenizer counts, not words or a provider’s billing claim.\n\nAssumptions The example declares one accounting convention and tokenizer. Real services can impose additional or different input/output limits; words are not substituted for tokens.\n\n## Engineering example\n\nA synthetic context capacity is 2,048 tokens under one declared tokenizer. System/task text uses 256, conversation history 512, retrieved evidence 640, tool descriptions 128 and reserved output 512: the total is exactly 2,048. Adding a 256-token duplicate passage would exceed the budget unless another item is removed or the reservation changes. Removing that duplicate can restore capacity, but it does not prove that all needed evidence remains. These counts are hypothetical tokenizer counts, not words or a provider’s billing claim.\n\n## Distinctions and tradeoffs\n\nPersisting a conversation or retrieving a fact does not by itself update model weights.\n\nMore retained context can preserve useful evidence but increases capacity use and can retain stale, irrelevant or unauthorized data.\n\nReliable tool loops need explicit context assembly rather than an undifferentiated notion of memory.\n\n## Specifications and interfaces\n\nMechanism boundary\n\nWhat survives between two model calls?\n\nThe example declares one accounting convention and tokenizer. Real services can impose additional or different input/output limits; words are not substituted for tokens.\n\nEvidence type\n\nAuthored worked example\n\nWorked explanation with a bounded numeric or state example. This lesson does not claim an executing implementation of an external model or platform.\n\n### Interfaces\n\nDeclared input and state Input\n\nThe application identifies task instructions, history, retrieved evidence and tool observations separately.\n\nChecked outcome Output\n\nClassify each retained object by lifetime and reproduce a context budget without confusing tokens, facts, journals and parameters.\n\n## Check your understanding\n\n### Which action changes this invocation’s context without necessarily changing its model parameters?\n\n1.  Including a retrieved passage\n2.  Changing a training gradient update\n3.  Replacing the stored model weights\n\nAnswer and reasoning\n\nIncluding a retrieved passage\n\nContext assembly supplies different inference input; parameter changes require a separate model update.\n\n## Evidence and scope\n\nThis is a worked explanation, not an executing external platform, model or robot. The quantities and fixtures are authored. Source scope is recorded in the automation learning review manifest; no source benchmark or private system behavior is claimed. The example declares one accounting convention and tokenizer. Real services can impose additional or different input/output limits; words are not substituted for tokens.\n\nThe worked example explains this mechanism. General numerical labs are a reference; they do not execute this lesson’s full mechanism.\n\n## Sources\n\n-   [LangGraph persistence](https://docs.langchain.com/oss/python/langgraph/persistence)\n-   [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401)\n\n[Published lesson data](https://semiaifoundry.com/ai-atlas/lesson-data/context-memory-provenance-a709dfd8c8eaeb5f.json) · [Atlas releases and licensing](https://semiaifoundry.com/ai-atlas/licenses.html)\n\n## Continue exploring\n\n### Foundations\n\n-   [Tools, memory & agent loop](https://semiaifoundry.com/learn/atlas/tool-loop/)\n-   [Key–value cache](https://semiaifoundry.com/learn/atlas/kv-cache/)\n\n### Related lessons\n\n-   [Evaluation & the AGI frontier](https://semiaifoundry.com/learn/atlas/evaluation/)"
}
