<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>Frinko</name>
  </author>
  <generator uri="https://hexo.io/">Hexo</generator>
  <id>http://47.100.94.22/</id>
  <link href="http://47.100.94.22/" rel="alternate"/>
  <link href="http://47.100.94.22/atom.xml" rel="self"/>
  <rights>All rights reserved 2026, Frinko</rights>
  <subtitle>Building Towards The Future</subtitle>
  <title>Frinko Lab</title>
  <updated>2026-06-18T01:00:00.000Z</updated>
  <entry>
    <author>
      <name>Frinko</name>
    </author>
    <category term="Artificial Intelligence" scheme="http://47.100.94.22/categories/artificial-intelligence/"/>
    <category term="RAG" scheme="http://47.100.94.22/tags/rag/"/>
    <category term="LLM" scheme="http://47.100.94.22/tags/llm/"/>
    <category term="AI Engineering" scheme="http://47.100.94.22/tags/ai-engineering/"/>
    <category term="Architecture" scheme="http://47.100.94.22/tags/architecture/"/>
    <content>
      <![CDATA[<p>RAG demos are easy. Reliable RAG systems are not. The difference lives in the unglamorous layers: data quality, retrieval evaluation, observability, latency budgets and explicit failure handling.</p><span id="more"></span><h2 id="the-production-loop"><a class="markdownIt-Anchor" href="#the-production-loop"></a> The production loop</h2><pre><code class="highlight mermaid">flowchart LR    A[Source data] --&gt; B[Parse and clean]    B --&gt; C[Chunk and enrich]    C --&gt; D[(Vector index)]    Q[User query] --&gt; R[Retrieve and rerank]    D --&gt; R    R --&gt; G[Grounded generation]    G --&gt; E[Evaluation and traces]    E -. feedback .-&gt; B</code></pre><p>The architecture is a loop, not a pipeline. Every answer creates evidence that should improve ingestion, retrieval and evaluation.</p><h2 id="retrieval-before-generation"><a class="markdownIt-Anchor" href="#retrieval-before-generation"></a> Retrieval before generation</h2><p>For a query <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span></span></span></span> and candidate chunk <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathnormal">d</span></span></span></span>, a hybrid score can combine semantic and lexical signals:</p><p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>S</mi><mo stretchy="false">(</mo><mi>q</mi><mo separator="true">,</mo><mi>d</mi><mo stretchy="false">)</mo><mo>=</mo><mi>α</mi><msub><mi>S</mi><mrow><mi>d</mi><mi>e</mi><mi>n</mi><mi>s</mi><mi>e</mi></mrow></msub><mo stretchy="false">(</mo><mi>q</mi><mo separator="true">,</mo><mi>d</mi><mo stretchy="false">)</mo><mo>+</mo><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>α</mi><mo stretchy="false">)</mo><msub><mi>S</mi><mrow><mi>B</mi><mi>M</mi><mn>25</mn></mrow></msub><mo stretchy="false">(</mo><mi>q</mi><mo separator="true">,</mo><mi>d</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">S(q,d)=\alpha S_{dense}(q,d)+(1-\alpha)S_{BM25}(q,d)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">d</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.33610799999999996em;"><span style="top:-2.5500000000000003em;margin-left:-0.05764em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">d</span><span class="mord mathnormal mtight">e</span><span class="mord mathnormal mtight">n</span><span class="mord mathnormal mtight">s</span><span class="mord mathnormal mtight">e</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">d</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span><span class="mclose">)</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.32833099999999993em;"><span style="top:-2.5500000000000003em;margin-left:-0.05764em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.05017em;">B</span><span class="mord mathnormal mtight" style="margin-right:0.10903em;">M</span><span class="mord mtight">2</span><span class="mord mtight">5</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">q</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">d</span><span class="mclose">)</span></span></span></span></span></p><p>The exact value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.0037em;">α</span></span></span></span> matters less than measuring performance on a representative evaluation set.</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="keyword">record</span> <span class="title class_">RetrievalResult</span><span class="params">(</span></span><br><span class="line"><span class="params">    String documentId,</span></span><br><span class="line"><span class="params">    String content,</span></span><br><span class="line"><span class="params">    <span class="type">double</span> score,</span></span><br><span class="line"><span class="params">    Map&lt;String, String&gt; metadata</span></span><br><span class="line"><span class="params">)</span> &#123;&#125;</span><br></pre></td></tr></table></figure><h2 id="what-to-measure"><a class="markdownIt-Anchor" href="#what-to-measure"></a> What to measure</h2><ol><li><strong>Context recall</strong> — did retrieval include the evidence required to answer?</li><li><strong>Context precision</strong> — how much retrieved material was actually relevant?</li><li><strong>Faithfulness</strong> — is the answer supported by the supplied context?</li><li><strong>End-to-end latency</strong> — p50 is pleasant; p95 is reality.</li><li><strong>Abstention quality</strong> — does the system know when it does not know?</li></ol><p>Reliability begins when “I don’t have enough evidence” is treated as a valid product outcome.</p>]]>
    </content>
    <id>http://47.100.94.22/posts/building-reliable-rag-systems/</id>
    <link href="http://47.100.94.22/posts/building-reliable-rag-systems/"/>
    <published>2026-06-18T01:00:00.000Z</published>
    <summary>A production-minded map for retrieval, evaluation, observability and failure handling in RAG systems.</summary>
    <title>Building Reliable RAG Systems Beyond the Demo</title>
    <updated>2026-06-18T01:00:00.000Z</updated>
  </entry>
  <entry>
    <author>
      <name>Frinko</name>
    </author>
    <category term="Backend Engineering" scheme="http://47.100.94.22/categories/backend-engineering/"/>
    <category term="MySQL" scheme="http://47.100.94.22/tags/mysql/"/>
    <category term="Database" scheme="http://47.100.94.22/tags/database/"/>
    <category term="Performance" scheme="http://47.100.94.22/tags/performance/"/>
    <category term="Java" scheme="http://47.100.94.22/tags/java/"/>
    <content>
      <![CDATA[<p>An index is not a sticker we attach to a slow query. It is a physical access path with a write cost, a memory footprint and an ordering model.</p><span id="more"></span><h2 id="start-from-the-access-pattern"><a class="markdownIt-Anchor" href="#start-from-the-access-pattern"></a> Start from the access pattern</h2><p>Consider a query that finds the latest paid orders for one customer:</p><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> id, total_amount, paid_at</span><br><span class="line"><span class="keyword">FROM</span> orders</span><br><span class="line"><span class="keyword">WHERE</span> customer_id <span class="operator">=</span> ?</span><br><span class="line">  <span class="keyword">AND</span> status <span class="operator">=</span> <span class="string">&#x27;PAID&#x27;</span></span><br><span class="line"><span class="keyword">ORDER</span> <span class="keyword">BY</span> paid_at <span class="keyword">DESC</span></span><br><span class="line">LIMIT <span class="number">20</span>;</span><br></pre></td></tr></table></figure><p>A useful candidate is:</p><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">CREATE</span> INDEX idx_orders_customer_status_paid</span><br><span class="line"><span class="keyword">ON</span> orders (customer_id, status, paid_at <span class="keyword">DESC</span>);</span><br></pre></td></tr></table></figure><p>The equality predicates lead, followed by the column that provides ordering. But the index is only a hypothesis until the query plan and production distribution confirm it.</p><h2 id="read-the-plan-as-evidence"><a class="markdownIt-Anchor" href="#read-the-plan-as-evidence"></a> Read the plan as evidence</h2><p>Pay attention to estimated rows, the chosen access type, extra sorting and whether the optimizer’s assumptions match real cardinality. A clean-looking <code>EXPLAIN</code> can still hide skewed data and p99 pain.</p><p>The durable habit is simple: <strong>measure the query, understand the access path, change one thing, measure again.</strong></p>]]>
    </content>
    <id>http://47.100.94.22/posts/mysql-index-field-notes/</id>
    <link href="http://47.100.94.22/posts/mysql-index-field-notes/"/>
    <published>2026-06-12T12:30:00.000Z</published>
    <summary>Practical notes on composite indexes, selectivity and reading EXPLAIN without cargo culting rules.</summary>
    <title>MySQL Index Design — Field Notes from the Query Plan</title>
    <updated>2026-06-18T08:15:51.152Z</updated>
  </entry>
  <entry>
    <author>
      <name>Frinko</name>
    </author>
    <category term="Investing Journal" scheme="http://47.100.94.22/categories/investing-journal/"/>
    <category term="Semiconductors" scheme="http://47.100.94.22/tags/semiconductors/"/>
    <category term="US Stocks" scheme="http://47.100.94.22/tags/us-stocks/"/>
    <category term="Future Technology" scheme="http://47.100.94.22/tags/future-technology/"/>
    <category term="Investing" scheme="http://47.100.94.22/tags/investing/"/>
    <content>
      <![CDATA[<p>Semiconductors are not one market. They are an interdependent stack of design software, intellectual property, manufacturing, equipment, materials, packaging and end demand.</p><span id="more"></span><h2 id="map-the-bottlenecks"><a class="markdownIt-Anchor" href="#map-the-bottlenecks"></a> Map the bottlenecks</h2><pre><code class="highlight mermaid">flowchart TB    A[EDA and IP] --&gt; B[Chip design]    B --&gt; C[Wafer fabrication]    D[Equipment and materials] --&gt; C    C --&gt; E[Advanced packaging]    E --&gt; F[Cloud · Edge · Devices]</code></pre><p>The most attractive business is not always the one with the loudest product launch. Long-term research asks where technical difficulty, switching costs, capital intensity and ecosystem lock-in create durable bottlenecks.</p><h2 id="research-questions"><a class="markdownIt-Anchor" href="#research-questions"></a> Research questions</h2><ul><li>Which layer captures value when compute demand grows?</li><li>Where does capacity take years rather than quarters to add?</li><li>Which tools are deeply embedded in customers’ workflows?</li><li>What breaks the thesis: substitution, geopolitics, cyclicality or valuation?</li></ul><p>This journal records a research process, not financial advice. A good thesis must include the conditions under which it is wrong.</p>]]>
    </content>
    <id>http://47.100.94.22/posts/semiconductors-long-term-map/</id>
    <link href="http://47.100.94.22/posts/semiconductors-long-term-map/"/>
    <published>2026-06-01T10:00:00.000Z</published>
    <summary>A systems view of the semiconductor value chain, from design tools and IP to fabs, equipment and advanced packaging.</summary>
    <title>The Semiconductor Stack — A Long-Term Investor's Map</title>
    <updated>2026-06-18T08:15:51.153Z</updated>
  </entry>
</feed>
