<mxfile host="app.diagrams.net" agent="Claude" version="24.7.17">
  <diagram id="flow-search-answer" name="สองเส้นทาง">
    <mxGraphModel dx="1500" dy="1260" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="1260" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="title" value="ระบบทำงานยังไง — &lt;b&gt;ค้นหา (search)&lt;/b&gt; กับ &lt;b&gt;ถาม-ตอบ (answer)&lt;/b&gt;" style="text;html=1;align=center;verticalAlign=middle;fontSize=22;fontColor=#0F172A;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="60" y="20" width="1380" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="คำถามเดียวกัน ส่งได้ 2 เส้นทาง — ต่างกันที่ &quot;สิ่งที่ได้กลับมา&quot; ไม่ใช่ความแม่นของการค้น" style="text;html=1;align=center;verticalAlign=middle;fontSize=14;fontColor=#475569;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="60" y="58" width="1380" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="q1" value="&lt;b&gt;คำถามของผู้ใช้&lt;/b&gt;&lt;br/&gt;พิมพ์เป็นภาษาธรรมดา ไม่ต้องรู้คำเป๊ะ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;fontSize=15;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="530" y="100" width="440" height="64" as="geometry"/>
        </mxCell>

        <!-- ===== panel: search ===== -->
        <mxCell id="leftbg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8FAFC;strokeColor=#CBD5E1;arcSize=4;" vertex="1" parent="1">
          <mxGeometry x="60" y="200" width="650" height="800" as="geometry"/>
        </mxCell>
        <mxCell id="lefthd" value="เส้นทางที่ 1 · &lt;b&gt;POST /api/v1/search&lt;/b&gt; — คืน &quot;รายการมาตรา&quot;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#0369A1;strokeColor=none;fontColor=#FFFFFF;fontSize=15;fontFamily=Sarabun;arcSize=10;" vertex="1" parent="1">
          <mxGeometry x="60" y="200" width="650" height="46" as="geometry"/>
        </mxCell>

        <mxCell id="s0" value="&lt;b&gt;(ตัวเลือก) analyze=true&lt;/b&gt; — LLM 1 ครั้ง: กรองคำถามนอกคลัง + เขียนคำค้นใหม่เป็นศัพท์กฎหมาย&lt;br/&gt;&lt;font style=&quot;font-size:11.5px&quot;&gt;ค่าเริ่มต้น &lt;b&gt;ปิด&lt;/b&gt; — ปิดอยู่ = ไม่มี LLM ในเส้นทางนี้เลย&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#FEF3C7;strokeColor=#B45309;fontSize=13;fontColor=#78350F;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="258" width="520" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="s1" value="&lt;b&gt;1. แปลงคำถาม&lt;/b&gt;&lt;br/&gt;ตัดคำไทย (newmm) + ทำ embedding" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="320" width="520" height="52" as="geometry"/>
        </mxCell>
        <mxCell id="s2a" value="&lt;b&gt;2. ค้นด้วยความหมาย&lt;/b&gt;&lt;br/&gt;&lt;font style=&quot;font-size:12px&quot;&gt;vector · เข้าใจคำถามชาวบ้าน&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ECFDF5;strokeColor=#059669;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="404" width="250" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="s2b" value="&lt;b&gt;2. ค้นด้วยคำตรง&lt;/b&gt;&lt;br/&gt;&lt;font style=&quot;font-size:12px&quot;&gt;keyword · แม่นเมื่อรู้คำเป๊ะ&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF6FF;strokeColor=#0369A1;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="395" y="404" width="250" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="s3" value="&lt;b&gt;3. รวมอันดับสองทาง (RRF)&lt;/b&gt;&lt;br/&gt;&lt;font style=&quot;font-size:12px&quot;&gt;ติดอันดับทั้งสองฝั่ง = ได้คะแนนสูงสุด&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="506" width="520" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="s4" value="&lt;b&gt;ได้: รายการมาตราที่เกี่ยวข้อง&lt;/b&gt;&lt;br/&gt;10 รายการ/หน้า · เรียงลำดับได้ · มีตัวกรองประเภท/ปี" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DBEAFE;strokeColor=#1E3A8A;strokeWidth=2;fontSize=15;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="594" width="520" height="76" as="geometry"/>
        </mxCell>
        <mxCell id="s5" value="ผู้ใช้ต้อง &lt;b&gt;อ่านเอง&lt;/b&gt; ว่ามาตราไหนตอบคำถาม" style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#475569;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="702" width="520" height="48" as="geometry"/>
        </mxCell>
        <mxCell id="sbadge" value="⏱ ~0.6 วินาที&#160;&#160;·&#160;&#160;💰 ไม่มีค่า LLM (ถ้าไม่เปิด analyze)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ECFDF5;strokeColor=#059669;fontSize=15;fontColor=#065F46;fontFamily=Sarabun;fontStyle=1;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="125" y="780" width="520" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="snote" value="ถ้า embedding ใช้ไม่ได้ → ค้นคำตรงอย่างเดียว (degraded) ระบบยังตอบได้ ไม่ล่ม" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFBEB;strokeColor=#D97706;fontSize=13;fontColor=#78350F;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="125" y="846" width="520" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="suse" value="&lt;b&gt;เหมาะกับ&lt;/b&gt; หน้าค้นหา · ให้ผู้ใช้เลือกเอง · autocomplete" style="text;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#475569;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="125" y="920" width="520" height="28" as="geometry"/>
        </mxCell>

        <!-- ===== panel: answer ===== -->
        <mxCell id="rightbg" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8FAFC;strokeColor=#CBD5E1;arcSize=4;" vertex="1" parent="1">
          <mxGeometry x="790" y="200" width="650" height="800" as="geometry"/>
        </mxCell>
        <mxCell id="righthd" value="เส้นทางที่ 2 · &lt;b&gt;POST /api/v1/answer&lt;/b&gt; — คืน &quot;คำตอบ&quot;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1E3A8A;strokeColor=none;fontColor=#FFFFFF;fontSize=15;fontFamily=Sarabun;arcSize=10;" vertex="1" parent="1">
          <mxGeometry x="790" y="200" width="650" height="46" as="geometry"/>
        </mxCell>

        <mxCell id="a0" value="&lt;b&gt;ขั้นที่ 1 — ค้นหา&lt;/b&gt;&lt;br/&gt;ใช้โค้ดชุดเดียวกับ /search &lt;b&gt;เป๊ะ&lt;/b&gt; (ขั้นตอน 1–3 ทางซ้าย)&lt;br/&gt;&lt;font style=&quot;font-size:12px&quot;&gt;ได้ &quot;ฉบับ&quot; ที่ติดอันดับต้น · ขั้น analyze &lt;b&gt;เปิดเป็นค่าเริ่มต้น&lt;/b&gt; ที่เส้นทางนี้&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF6FF;strokeColor=#0369A1;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="280" width="520" height="96" as="geometry"/>
        </mxCell>
        <mxCell id="a1" value="&lt;b&gt;ขั้นที่ 2.1&lt;/b&gt; เลือกกฎหมาย 1–3 ฉบับแรก (max_laws)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="404" width="520" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="a2" value="&lt;b&gt;ขั้นที่ 2.2&lt;/b&gt; โหลดตัวบท &lt;b&gt;ทั้งฉบับ&lt;/b&gt; ไม่ใช่แค่มาตราที่ค้นเจอ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="486" width="520" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="a3" value="&lt;b&gt;ขั้นที่ 2.3&lt;/b&gt; LLM อ่านทั้งฉบับ → เลือกมาตราที่ตอบได้ + เรียบเรียงคำตอบ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;strokeWidth=2;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="568" width="520" height="62" as="geometry"/>
        </mxCell>
        <mxCell id="a4" value="&lt;b&gt;ขั้นที่ 2.4 กันอ้างมั่ว&lt;/b&gt; — มาตราที่โมเดลอ้างแต่ไม่มีในตัวบทจริง ถูกตัดทิ้ง" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="662" width="520" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="a5" value="&lt;b&gt;ได้: คำตอบภาษาไทย + ปุ่มอ้างอิงมาตรา&lt;/b&gt;&lt;br/&gt;กดปุ่มไปอ่านตัวบทเต็มได้ทันที" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DBEAFE;strokeColor=#1E3A8A;strokeWidth=2;fontSize=15;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="855" y="750" width="520" height="72" as="geometry"/>
        </mxCell>
        <mxCell id="abadge" value="⏱ ~2–5 วินาที&#160;&#160;·&#160;&#160;💰 ~0.08 บาท/คำถาม" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;fontSize=15;fontColor=#78350F;fontFamily=Sarabun;fontStyle=1;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="855" y="846" width="520" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="ause" value="&lt;b&gt;เหมาะกับ&lt;/b&gt; หน้าถาม-ตอบ · แชตบอต · ผู้ใช้ที่ไม่อยากอ่านเอง" style="text;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#475569;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="855" y="910" width="520" height="30" as="geometry"/>
        </mxCell>

        <!-- ===== special cases ===== -->
        <mxCell id="spectitle" value="&lt;b&gt;กรณีที่ตอบไม่ได้ — ระบบไม่เดา&lt;/b&gt;" style="text;html=1;align=center;verticalAlign=middle;fontSize=16;fontColor=#0F172A;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="60" y="1020" width="1380" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="sp1" value="&lt;b&gt;คำถามไม่เกี่ยวกับกฎหมายในระบบ&lt;/b&gt;&lt;br/&gt;ตัดตั้งแต่ขั้นแรก → ตอบทันที &lt;b&gt;ไม่เสียค่า LLM&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F1F5F9;strokeColor=#94A3B8;fontSize=13;fontColor=#334155;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="60" y="1060" width="440" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="sp2" value="&lt;b&gt;ค้นเจอฉบับ แต่ไม่มีมาตราที่ตอบได้&lt;/b&gt;&lt;br/&gt;บอกตรง ๆ ว่า &quot;ไม่พบคำตอบ&quot; (found = false)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F1F5F9;strokeColor=#94A3B8;fontSize=13;fontColor=#334155;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="530" y="1060" width="440" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="sp3" value="&lt;b&gt;โมเดลภาษาใช้ไม่ได้ (degraded)&lt;/b&gt;&lt;br/&gt;ไม่ error — คืนรายการมาตราให้ผู้ใช้อ่านเองแทน" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFBEB;strokeColor=#D97706;fontSize=13;fontColor=#78350F;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="1000" y="1060" width="440" height="70" as="geometry"/>
        </mxCell>

        <mxCell id="noagent" value="&lt;b&gt;ทั้งสองเส้นทางไม่ใช่ agent&lt;/b&gt; — ไม่มีการวนค้นซ้ำหรือให้โมเดลตัดสินใจเองว่าจะทำอะไรต่อ · จำนวนรอบคงที่ (search 0–1 ครั้ง · answer 2 ครั้ง) &lt;b&gt;เวลาและค่าใช้จ่ายจึงคาดเดาได้&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F1F5F9;strokeColor=#94A3B8;fontSize=14;fontColor=#334155;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="60" y="1160" width="1380" height="52" as="geometry"/>
        </mxCell>

        <!-- ===== edges ===== -->
        <mxCell id="e0" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;exitX=0.25;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="q1" target="lefthd">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e0b" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="lefthd" target="s0">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e0c" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s0" target="s1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;exitX=0.75;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="q1" target="righthd">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e1b" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="righthd" target="a0">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s1" target="s2a">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s1" target="s2b">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e4" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s2a" target="s3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e5" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s2b" target="s3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e6" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="s3" target="s4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e7" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;dashed=1;strokeColor=#94A3B8;strokeWidth=2;" edge="1" parent="1" source="s4" target="s5">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e8" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="a0" target="a1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e9" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="a1" target="a2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e10" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="a2" target="a3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="a3" target="a4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="a4" target="a5">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>

  <diagram id="flow-why-answer" name="ทำไม answer ถึงตรงกว่า">
    <mxGraphModel dx="1500" dy="1000" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="1000" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <mxCell id="t2" value="ตัวอย่างจริง — คำถามเดียวกัน ผลต่างกันตรงไหน" style="text;html=1;align=center;verticalAlign=middle;fontSize=22;fontColor=#0F172A;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="60" y="20" width="1380" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="q2" value="&lt;b&gt;&quot;เจ้าหน้าที่ต้องพิจารณาคำขอเปิดสถานพยาบาลสัตว์ภายในกี่วัน&quot;&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;fontSize=16;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="440" y="76" width="620" height="52" as="geometry"/>
        </mxCell>

        <!-- search side -->
        <mxCell id="lb2" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8FAFC;strokeColor=#CBD5E1;arcSize=4;" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="650" height="600" as="geometry"/>
        </mxCell>
        <mxCell id="lh2" value="&lt;b&gt;/search&lt;/b&gt; — คำตอบอยู่ในรายการ แต่อยู่ &lt;b&gt;อันดับ 9&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#0369A1;strokeColor=none;fontColor=#FFFFFF;fontSize=15;fontFamily=Sarabun;arcSize=10;" vertex="1" parent="1">
          <mxGeometry x="60" y="180" width="650" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="lwhy" value="คำว่า &quot;กี่วัน&quot; ตรงกับหลายมาตราที่มีกำหนดเวลา — ทุกอันดูเข้าเค้าหมด" style="text;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#475569;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="90" y="234" width="590" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="r1" value="อันดับ 1&#160;&#160;·&#160;&#160;มาตราที่มีกำหนดเวลาอื่น" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontSize=13;fontColor=#475569;fontFamily=Sarabun;align=left;spacingLeft=14;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="110" y="272" width="550" height="38" as="geometry"/>
        </mxCell>
        <mxCell id="r2" value="อันดับ 2&#160;&#160;·&#160;&#160;มาตราที่มีกำหนดเวลาอื่น" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontSize=13;fontColor=#475569;fontFamily=Sarabun;align=left;spacingLeft=14;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="110" y="318" width="550" height="38" as="geometry"/>
        </mxCell>
        <mxCell id="r3" value="อันดับ 3&#160;&#160;·&#160;&#160;มาตราที่มีกำหนดเวลาอื่น" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#CBD5E1;fontSize=13;fontColor=#475569;fontFamily=Sarabun;align=left;spacingLeft=14;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="110" y="364" width="550" height="38" as="geometry"/>
        </mxCell>
        <mxCell id="rdots" value="อันดับ 4–8 · · ·" style="text;html=1;align=center;verticalAlign=middle;fontSize=14;fontColor=#94A3B8;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="110" y="408" width="550" height="34" as="geometry"/>
        </mxCell>
        <mxCell id="r9" value="&lt;b&gt;อันดับ 9&#160;&#160;·&#160;&#160;มาตรา 12 — คำตอบอยู่ตรงนี้&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF08A;strokeColor=#B45309;strokeWidth=2;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;align=left;spacingLeft=14;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="110" y="448" width="550" height="44" as="geometry"/>
        </mxCell>
        <mxCell id="lres" value="ผู้ใช้ต้องไล่อ่านลงมา 9 รายการกว่าจะเจอ" style="rounded=1;whiteSpace=wrap;html=1;dashed=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#475569;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="110" y="524" width="550" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="lstat" value="&lt;b&gt;วัดจากชุดข้อสอบ 50 ข้อ&lt;/b&gt;&lt;br/&gt;หา &quot;ฉบับ&quot; ถูก 100% (DocHit@5 = 1.00) แต่อันดับ 1 เป็นมาตราที่ใช่แค่ 68% (Hit@1 = 0.68)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF6FF;strokeColor=#0369A1;fontSize=13;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="110" y="600" width="550" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="lcost" value="⏱ ~0.6 วินาที&#160;&#160;·&#160;&#160;💰 0 บาท" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ECFDF5;strokeColor=#059669;fontSize=14;fontColor=#065F46;fontFamily=Sarabun;fontStyle=1;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="110" y="694" width="550" height="42" as="geometry"/>
        </mxCell>

        <!-- answer side -->
        <mxCell id="rb2" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F8FAFC;strokeColor=#CBD5E1;arcSize=4;" vertex="1" parent="1">
          <mxGeometry x="790" y="180" width="650" height="600" as="geometry"/>
        </mxCell>
        <mxCell id="rh2" value="&lt;b&gt;/answer&lt;/b&gt; — อ่านทั้งฉบับ แล้วชี้มาตราที่ใช่" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1E3A8A;strokeColor=none;fontColor=#FFFFFF;fontSize=15;fontFamily=Sarabun;arcSize=10;" vertex="1" parent="1">
          <mxGeometry x="790" y="180" width="650" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="rwhy" value="เพราะค้น &quot;ฉบับ&quot; แม่นอยู่แล้ว จึงเอาทั้งฉบับให้โมเดลอ่านทีเดียว" style="text;html=1;align=center;verticalAlign=middle;fontSize=13;fontColor=#475569;fontFamily=Sarabun;" vertex="1" parent="1">
          <mxGeometry x="820" y="234" width="590" height="26" as="geometry"/>
        </mxCell>

        <mxCell id="d1" value="&lt;b&gt;1.&lt;/b&gt; ค้นเจอฉบับที่ใช่ — พ.ร.บ. สถานพยาบาลสัตว์ พ.ศ. 2533" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="840" y="272" width="550" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="d2" value="&lt;b&gt;2.&lt;/b&gt; อ่าน &lt;b&gt;ทุกมาตรา&lt;/b&gt; ในฉบับนั้นทีเดียว (กฎหมายยาวสุด ~19,000 tokens ใส่ได้หมด)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#94A3B8;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="840" y="338" width="550" height="56" as="geometry"/>
        </mxCell>
        <mxCell id="d3" value="&lt;b&gt;3.&lt;/b&gt; เลือก &lt;b&gt;มาตรา 12&lt;/b&gt; — ตรงประเด็นที่สุด" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;strokeWidth=2;fontSize=14;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="840" y="410" width="550" height="46" as="geometry"/>
        </mxCell>
        <mxCell id="d4" value="&lt;b&gt;ตอบ:&lt;/b&gt; ต้องพิจารณาภายใน &lt;b&gt;สี่สิบห้าวัน&lt;/b&gt; นับแต่วันที่ได้รับคำขอที่ถูกต้องครบถ้วน&lt;br/&gt;&lt;font style=&quot;font-size:12px&quot;&gt;อ้างอิง: มาตรา 12 (กดไปอ่านตัวบทได้)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#DBEAFE;strokeColor=#1E3A8A;strokeWidth=2;fontSize=15;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="840" y="480" width="550" height="90" as="geometry"/>
        </mxCell>
        <mxCell id="rstat" value="&lt;b&gt;ชุดข้อสอบเดียวกัน 50 ข้อ&lt;/b&gt;&lt;br/&gt;อ้างอิงมีมาตราที่เป็นเฉลย 96% (CiteHit) · ตรงเป๊ะไม่มีเกิน 94% · มาจากฉบับที่ถูกเสมอ 100%" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#EFF6FF;strokeColor=#0369A1;fontSize=13;fontColor=#0F172A;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="840" y="600" width="550" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="rcost" value="⏱ p50 2.8 วิ / p95 6.9 วิ&#160;&#160;·&#160;&#160;💰 ~0.078 บาท/คำถาม" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FEF3C7;strokeColor=#B45309;fontSize=14;fontColor=#78350F;fontFamily=Sarabun;fontStyle=1;arcSize=20;" vertex="1" parent="1">
          <mxGeometry x="840" y="694" width="550" height="42" as="geometry"/>
        </mxCell>

        <mxCell id="foot" value="สรุป: การค้นหาไม่ได้แย่ — มันหา &quot;ฉบับ&quot; ถูกเสมอ ที่ยากคือเลือก &quot;มาตรา&quot; · /answer จึงเอาทั้งฉบับให้โมเดลอ่านแทนที่จะเดาจากอันดับ" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#F1F5F9;strokeColor=#94A3B8;fontSize=14;fontColor=#334155;fontFamily=Sarabun;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="60" y="820" width="1380" height="52" as="geometry"/>
        </mxCell>

        <mxCell id="ee1" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;exitX=0.25;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="q2" target="lh2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee2" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;exitX=0.75;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="q2" target="rh2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="d1" target="d2">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee4" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="d2" target="d3">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="ee5" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;endArrow=blockThin;endFill=1;strokeColor=#64748B;strokeWidth=2;" edge="1" parent="1" source="d3" target="d4">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
