<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ANN on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/ann/</link>
    <description>Recent content in ANN on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 07 Sep 2026 11:00:00 +0000</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/ann/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>From Similarity to Search</title>
      <link>http://programmer.ie/books/embeddings-from-first-principles/09-chapter/</link>
      <pubDate>Mon, 07 Sep 2026 11:00:00 +0000</pubDate>
      <guid>http://programmer.ie/books/embeddings-from-first-principles/09-chapter/</guid>
      <description>&lt;p&gt;&lt;em&gt;Part III — Retrieval Is an Experiment&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;retrieval-in-four-lines&#34;&gt;Retrieval in four lines&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;query_vec &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; embed(query)                       &lt;span style=&#34;color:#75715e&#34;&gt;# one vector&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;scores    &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; corpus_vecs &lt;span style=&#34;color:#f92672&#34;&gt;@&lt;/span&gt; query_vec            &lt;span style=&#34;color:#75715e&#34;&gt;# one dot product per document&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;order     &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;argsort(&lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;scores)                &lt;span style=&#34;color:#75715e&#34;&gt;# sort, descending&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;results   &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; [corpus[i] &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; i &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; order[:k]]     &lt;span style=&#34;color:#75715e&#34;&gt;# take the top k&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That is the entire primitive. Everything a vector database adds — indexes, quantization, sharding, filtering — is an optimization or an operational convenience around these four lines. Understand them completely before adding anything.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;What exactly is a retrieval system deciding, and which of its parameters change the answer rather than just the speed?&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
