<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vector Search on AIBussin — AI applications, systems and books</title><link>https://aibussin.com/tags/vector-search/</link><description>Recent content in Vector Search on AIBussin — AI applications, systems and books</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 07 Sep 2026 11:00:00 +0000</lastBuildDate><atom:link href="https://aibussin.com/tags/vector-search/index.xml" rel="self" type="application/rss+xml"/><item><title>Similarity Is a Decision</title><link>https://aibussin.com/books/embeddings-from-first-principles/04-chapter/</link><pubDate>Mon, 07 Sep 2026 09:30:00 +0000</pubDate><guid>https://aibussin.com/books/embeddings-from-first-principles/04-chapter/</guid><description>&lt;p&gt;&lt;em&gt;Part I — A Vector Is Not Meaning&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="two-vectors-four-answers"&gt;Two vectors, four answers&lt;/h2&gt;&#10;&lt;p&gt;Here are three document vectors, kept to three dimensions so every number is checkable:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;x = ( 2.0, 0.0, 0.0 ) a short doc, one strong topic&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;y = ( 6.0, 0.1, 0.0 ) a long doc, same topic, much more of it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;z = ( 0.0, 2.0, 0.0 ) a short doc, a different topic&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Before computing anything, look at the geometry. &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; point in almost exactly the same direction but have very different lengths (norm 2 versus about 6). &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;z&lt;/code&gt; have the same length but point ninety degrees apart. So &amp;ldquo;is &lt;code&gt;x&lt;/code&gt; more like &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;z&lt;/code&gt;?&amp;rdquo; comes down to a prior question: &lt;strong&gt;which kind of difference should count — a difference in direction, or a difference in size?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Memory and Selective Recall</title><link>https://aibussin.com/books/agents-from-first-principles/08-chapter/</link><pubDate>Sat, 08 Aug 2026 17:14:00 +0100</pubDate><guid>https://aibussin.com/books/agents-from-first-principles/08-chapter/</guid><description>&lt;p&gt;The capability boundary gave the agent a defined action space and a rule for which capabilities are eligible at each step. Runtime state gave it an explicit working representation of what this run has established so far and how it reached that point. Together they govern the current execution, but neither gives information from an earlier run a controlled way to influence this one. There is a family of failures that requires exactly that.&lt;/p&gt;</description></item><item><title>From Similarity to Search</title><link>https://aibussin.com/books/embeddings-from-first-principles/09-chapter/</link><pubDate>Mon, 07 Sep 2026 11:00:00 +0000</pubDate><guid>https://aibussin.com/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;&#10;&lt;h2 id="retrieval-in-four-lines"&gt;Retrieval in four lines&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# assume embed() returns L2-normalized vectors, so dot product == cosine (Chapter 4)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;query_vec &lt;span style="color:#f92672"&gt;=&lt;/span&gt; embed(query) &lt;span style="color:#75715e"&gt;# one unit vector&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;scores &lt;span style="color:#f92672"&gt;=&lt;/span&gt; corpus_vecs &lt;span style="color:#f92672"&gt;@&lt;/span&gt; query_vec &lt;span style="color:#75715e"&gt;# a cosine score for every document&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;order &lt;span style="color:#f92672"&gt;=&lt;/span&gt; np&lt;span style="color:#f92672"&gt;.&lt;/span&gt;argsort(&lt;span style="color:#f92672"&gt;-&lt;/span&gt;scores) &lt;span style="color:#75715e"&gt;# rank all n documents, best first&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;results &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [corpus[i] &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; i &lt;span style="color:#f92672"&gt;in&lt;/span&gt; order[:k]] &lt;span style="color:#75715e"&gt;# keep the top k&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That is the whole primitive for the simple policy shown here. A vector database may add several different kinds of machinery around it: an ANN index or quantization may &lt;strong&gt;approximate&lt;/strong&gt; the same ranking more cheaply; sharding may distribute the computation; filtering may change the eligible candidate set; persistence and replication may make the system operable. Do not collapse all of those into &amp;ldquo;faster search&amp;rdquo; — some preserve the target policy, some approximate it, and some redefine it.&lt;/p&gt;</description></item><item><title>Agents From First Principles 07: AI Agent Forgets Previous Work? Add Working, Semantic and Episodic Memory</title><link>https://aibussin.com/post/agents-from-first-principles-07/</link><pubDate>Sat, 08 Aug 2026 17:14:00 +0100</pubDate><guid>https://aibussin.com/post/agents-from-first-principles-07/</guid><description>&lt;h1 id="ai-agent-forgets-previous-work-add-working-semantic-and-episodic-memory"&gt;AI Agent Forgets Previous Work? Add Working, Semantic and Episodic Memory&lt;/h1&gt;&#10;&lt;p&gt;An agent can use the right model, call the right tools, execute the right plan, and still behave as if nothing that happened five minutes ago matters.&lt;/p&gt;&#10;&lt;p&gt;You see the symptoms quickly:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;it re-reads files it already inspected;&lt;/li&gt;&#10;&lt;li&gt;it repeats research it already completed;&lt;/li&gt;&#10;&lt;li&gt;it asks for information the user already supplied;&lt;/li&gt;&#10;&lt;li&gt;it forgets why a previous approach failed;&lt;/li&gt;&#10;&lt;li&gt;it loses decisions made earlier in a long task;&lt;/li&gt;&#10;&lt;li&gt;it treats every new run as if the system has never seen the problem before;&lt;/li&gt;&#10;&lt;li&gt;it retrieves an old answer and treats it as current truth;&lt;/li&gt;&#10;&lt;li&gt;it fills the prompt with so much history that the useful information is buried.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The usual response is:&lt;/p&gt;</description></item><item><title>RELATE: Searching Embeddings by Relation, Not Just Similarity</title><link>https://aibussin.com/post/relate/</link><pubDate>Wed, 05 Aug 2026 23:24:45 +0100</pubDate><guid>https://aibussin.com/post/relate/</guid><description>&lt;p&gt;Embeddings are everywhere in modern AI.&lt;/p&gt;&#10;&lt;p&gt;They power semantic search, retrieval-augmented generation, recommendations, clustering, duplicate detection, code search, memory systems, and many of the mechanisms through which an AI system decides what information is relevant.&lt;/p&gt;&#10;&lt;p&gt;Yet most systems interrogate embeddings in essentially the same way:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Take two vectors and calculate cosine similarity.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;That is useful. But it also makes a strong assumption.&lt;/p&gt;&#10;&lt;p&gt;It assumes that the information we care about is expressed directly through the default geometry of the embedding space.&lt;/p&gt;</description></item></channel></rss>