{
  "type": "excalidraw",
  "version": 2,
  "source": "claude",
  "elements": [
    {
      "type": "text",
      "id": "title",
      "x": 200,
      "y": 20,
      "width": 500,
      "height": 70,
      "text": "Base Coat Memory Lookup Hierarchy",
      "fontSize": 28,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "text",
      "id": "subtitle",
      "x": 200,
      "y": 90,
      "width": 500,
      "height": 35,
      "text": "L0 → L4 with shared tiers L2s / L3s",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "rectangle",
      "id": "l0-box",
      "x": 80,
      "y": 140,
      "width": 760,
      "height": 70,
      "strokeColor": "#1864ab",
      "backgroundColor": "#a5d8ff",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l0-text" }]
    },
    {
      "type": "text",
      "id": "l0-text",
      "x": 80,
      "y": 140,
      "width": 760,
      "height": 70,
      "text": "L0 — Agent Frontmatter\nAlways loaded · compiled into agent definition · invariants only",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l0-box"
    },
    {
      "type": "rectangle",
      "id": "l1-box",
      "x": 80,
      "y": 240,
      "width": 760,
      "height": 70,
      "strokeColor": "#2f9e44",
      "backgroundColor": "#b2f2bb",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l1-text" }]
    },
    {
      "type": "text",
      "id": "l1-text",
      "x": 80,
      "y": 240,
      "width": 760,
      "height": 70,
      "text": "L1 — Scoped Instructions (applyTo glob)\nLoaded when active file matches · instructions/*.instructions.md",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l1-box"
    },
    {
      "type": "rectangle",
      "id": "l2-box",
      "x": 80,
      "y": 340,
      "width": 370,
      "height": 70,
      "strokeColor": "#e67700",
      "backgroundColor": "#fff3bf",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l2-text" }]
    },
    {
      "type": "text",
      "id": "l2-text",
      "x": 80,
      "y": 340,
      "width": 370,
      "height": 70,
      "text": "L2 — Hot Cache Index\nmemory-index.instructions.md · every session",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l2-box"
    },
    {
      "type": "rectangle",
      "id": "l2s-box",
      "x": 470,
      "y": 340,
      "width": 370,
      "height": 70,
      "strokeColor": "#862e9c",
      "backgroundColor": "#f3d9fa",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l2s-text" }]
    },
    {
      "type": "text",
      "id": "l2s-text",
      "x": 470,
      "y": 340,
      "width": 370,
      "height": 70,
      "text": "L2s — Shared Hot Index\nbasecoat-memory/hot-index.md · org-wide",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l2s-box"
    },
    {
      "type": "rectangle",
      "id": "l3-box",
      "x": 80,
      "y": 440,
      "width": 370,
      "height": 70,
      "strokeColor": "#0c8599",
      "backgroundColor": "#99e9f2",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l3-text" }]
    },
    {
      "type": "text",
      "id": "l3-text",
      "x": 80,
      "y": 440,
      "width": 370,
      "height": 70,
      "text": "L3 — Session Store (DuckDB)\ncross-session turns, files, refs · on demand",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l3-box"
    },
    {
      "type": "rectangle",
      "id": "l3s-box",
      "x": 470,
      "y": 440,
      "width": 370,
      "height": 70,
      "strokeColor": "#862e9c",
      "backgroundColor": "#f3d9fa",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l3s-text" }]
    },
    {
      "type": "text",
      "id": "l3s-text",
      "x": 470,
      "y": 440,
      "width": 370,
      "height": 70,
      "text": "L3s — Shared Domain Cache\nbasecoat-memory/memories/*.md · org-wide",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l3s-box"
    },
    {
      "type": "rectangle",
      "id": "l4-box",
      "x": 80,
      "y": 540,
      "width": 760,
      "height": 70,
      "strokeColor": "#495057",
      "backgroundColor": "#dee2e6",
      "fillStyle": "hachure",
      "strokeWidth": 2,
      "roundness": { "type": 3 },
      "boundElements": [{ "type": "text", "id": "l4-text" }]
    },
    {
      "type": "text",
      "id": "l4-text",
      "x": 80,
      "y": 540,
      "width": 760,
      "height": 70,
      "text": "L4 — Long-term Memory\nstore_memory tool + docs/ · persistent facts with citations",
      "fontSize": 14,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "center",
      "verticalAlign": "middle",
      "containerId": "l4-box"
    },
    {
      "type": "arrow",
      "id": "arr-l0-l1",
      "x": 460,
      "y": 210,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]],
      "id": "arr-l0-l1"
    },
    {
      "type": "arrow",
      "id": "arr-l1-l2",
      "x": 460,
      "y": 310,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]],
      "id": "arr-l1-l2"
    },
    {
      "type": "arrow",
      "id": "arr-l2-l3",
      "x": 265,
      "y": 410,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]],
      "id": "arr-l2-l3"
    },
    {
      "type": "arrow",
      "id": "arr-l2s-l3s",
      "x": 655,
      "y": 410,
      "width": 0,
      "height": 30,
      "strokeColor": "#862e9c",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]],
      "id": "arr-l2s-l3s"
    },
    {
      "type": "arrow",
      "id": "arr-l3-l4",
      "x": 265,
      "y": 510,
      "width": 0,
      "height": 30,
      "strokeColor": "#495057",
      "strokeWidth": 2,
      "points": [[0,0],[0,30]],
      "id": "arr-l3-l4"
    },
    {
      "type": "text",
      "id": "legend-personal",
      "x": 80,
      "y": 640,
      "width": 300,
      "height": 35,
      "text": "Blue/Green/Orange/Teal = Personal tiers",
      "fontSize": 12,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "text",
      "id": "legend-shared",
      "x": 400,
      "y": 640,
      "width": 300,
      "height": 35,
      "text": "Purple = Shared org tiers (L2s / L3s)",
      "fontSize": 12,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    },
    {
      "type": "text",
      "id": "promo-label",
      "x": 80,
      "y": 680,
      "width": 620,
      "height": 60,
      "text": "Promotion: 3× access → L2   |   5 sessions → L1   |   50% sessions → L0\nDemotion: not accessed in 10+ sessions → removed from hot cache",
      "fontSize": 12,
      "fontFamily": 1,
      "strokeColor": "#000000",
      "textAlign": "left",
      "verticalAlign": "top"
    }
  ],
  "appState": { "viewBackgroundColor": "#ffffff" }
}
