<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="720" viewBox="0 0 1200 720">
  <rect x="0" y="0" width="1200" height="720" fill="#f6f9ff"/>
  <rect x="40" y="30" width="1120" height="660" rx="22" fill="#ffffff" stroke="#d8e2f1"/>
  <text x="600" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="32" fill="#1f2d3d">Context Window 与 RAG 路径对比</text>

  <rect x="80" y="118" width="500" height="534" rx="18" fill="#ffe9b3"/>
  <text x="330" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="28" fill="#1f2d3d">方案 A：全量直输（Direct Input）</text>
  <rect x="120" y="192" width="420" height="120" rx="12" fill="#fff3d1"/>
  <text x="330" y="236" text-anchor="middle" font-family="Arial, sans-serif" font-size="21" fill="#33475f">原始语料：文档库 / 对话历史 / 结构化数据</text>
  <text x="330" y="266" text-anchor="middle" font-family="Arial, sans-serif" font-size="19" fill="#556c87">问题：总 Token 快速增长，易触发窗口上限</text>
  <rect x="120" y="334" width="420" height="286" rx="12" fill="#fff8e5"/>
  <text x="145" y="370" font-family="Arial, sans-serif" font-size="20" fill="#33475f">常见后果：</text>
  <text x="145" y="402" font-family="Arial, sans-serif" font-size="19" fill="#33475f">- 成本高：无关内容同样参与推理</text>
  <text x="145" y="434" font-family="Arial, sans-serif" font-size="19" fill="#33475f">- 时延高：序列更长，推理更慢</text>
  <text x="145" y="466" font-family="Arial, sans-serif" font-size="19" fill="#33475f">- 噪声高：关键信息被稀释</text>
  <text x="145" y="498" font-family="Arial, sans-serif" font-size="19" fill="#33475f">- 更新难：新增知识需重写上下文</text>

  <rect x="620" y="118" width="500" height="534" rx="18" fill="#dff3ff"/>
  <text x="870" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="28" fill="#1f2d3d">方案 B：RAG（Retrieval-Augmented Generation）</text>

  <rect x="660" y="194" width="420" height="78" rx="12" fill="#bcd4ff"/>
  <text x="870" y="242" text-anchor="middle" font-family="Arial, sans-serif" font-size="22" fill="#1f2d3d">Step 1: Chunk + Embedding + Index</text>

  <rect x="660" y="292" width="420" height="78" rx="12" fill="#9ee9d7"/>
  <text x="870" y="340" text-anchor="middle" font-family="Arial, sans-serif" font-size="22" fill="#1f2d3d">Step 2: Query -> Vector Search</text>

  <rect x="660" y="390" width="420" height="78" rx="12" fill="#ffd0dd"/>
  <text x="870" y="438" text-anchor="middle" font-family="Arial, sans-serif" font-size="22" fill="#1f2d3d">Step 3: Top-K Evidence Chunks</text>

  <rect x="660" y="488" width="420" height="132" rx="12" fill="#eef3fb"/>
  <text x="870" y="530" text-anchor="middle" font-family="Arial, sans-serif" font-size="21" fill="#33475f">Step 4: 组装 Prompt 进入 Context Window</text>
  <text x="870" y="560" text-anchor="middle" font-family="Arial, sans-serif" font-size="19" fill="#556c87">收益：更低成本、更低时延、更高可更新性</text>
  <text x="870" y="590" text-anchor="middle" font-family="Arial, sans-serif" font-size="19" fill="#556c87">注意：召回质量与重排序策略决定上限</text>

  <line x1="870" y1="272" x2="870" y2="292" stroke="#8aa0bf" stroke-width="4"/>
  <line x1="870" y1="370" x2="870" y2="390" stroke="#8aa0bf" stroke-width="4"/>
  <line x1="870" y1="468" x2="870" y2="488" stroke="#8aa0bf" stroke-width="4"/>
</svg>
