{
  "schema": "vedokrok.public-item.v1",
  "release_id": "MHC-RPUB-20260920-75ad787a",
  "url": "/knowledge/retrieve-context-just-in-time-instead-of-preloading-the-whole-project",
  "id": "MHC-D-RESEARCH-0953",
  "version": "0.1.0",
  "title": "Retrieve context just in time instead of preloading the whole project",
  "summary": "Relevant context is valuable; irrelevant context taxes every token after it.",
  "kind": "principle",
  "body": "Load the stable rules and task essentials up front, then retrieve project details, documents or memory when the current step needs them. This reduces context pollution and keeps attention focused. Add retrieval cues or source indexes so the agent knows what can be fetched later.",
  "limits": [
    "Just-in-time retrieval fails if indexing is weak or the agent does not know important information exists."
  ],
  "topics": [
    "union-agent-loop-reliability"
  ],
  "intents": [],
  "source_ids": [
    "RS-23629BCC74F3AC0C"
  ],
  "evidence": [
    {
      "claim": "Anthropic's context-engineering guidance recommends treating context as finite and using just-in-time retrieval instead of indiscriminate preloading.",
      "source_id": "RS-23629BCC74F3AC0C",
      "role": "supports",
      "note": "Just-in-time retrieval fails if indexing is weak or the agent does not know important information exists.",
      "locator": "See source record"
    }
  ],
  "use_when": [
    "An agent starts every task with huge documentation, memory and historical transcripts loaded into context."
  ],
  "avoid_when": [
    "Just-in-time retrieval fails if indexing is weak or the agent does not know important information exists."
  ],
  "example": "Load repository rules and task goals at start; fetch a specific design document only when modifying that component.",
  "check": "Most loaded context is relevant to the current stage rather than merely potentially useful someday.",
  "sources": [
    {
      "id": "RS-23629BCC74F3AC0C",
      "title": "Effective context engineering for AI agents",
      "url": "https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents"
    }
  ],
  "relations": [],
  "collections": [
    {
      "id": "RC-043A908C9263BF6A",
      "title": "Make the agent loop finish, recover and stay inspectable",
      "url": "/collections/make-the-agent-loop-finish-recover-and-stay-inspectable"
    }
  ]
}
