<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kathleen DeRusso on Medium]]></title>
        <description><![CDATA[Stories by Kathleen DeRusso on Medium]]></description>
        <link>https://medium.com/@kderusso?source=rss-3397ea8b616f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vLxAtDJ9tWGL1lJsojlA7Q.png</url>
            <title>Stories by Kathleen DeRusso on Medium</title>
            <link>https://medium.com/@kderusso?source=rss-3397ea8b616f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 11:37:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kderusso/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Elasticsearch vs OpenSearch: Vector Search Performance Benchmarks]]></title>
            <link>https://kderusso.medium.com/elasticsearch-vs-opensearch-vector-search-performance-benchmarks-f542e3af0748?source=rss-3397ea8b616f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f542e3af0748</guid>
            <category><![CDATA[search]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Kathleen DeRusso]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 12:25:23 GMT</pubDate>
            <atom:updated>2026-03-10T12:25:23.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*QBsyUiH5nlg46UQoe_atqg.png" /><figcaption>A high-level system diagram showing a “Retrieve-Reason-Retrieve” loop for an AI Agent</figcaption></figure><p>If you’re building a simple RAG system, a single vector search that takes 200ms feels fine. You get your context, you hit the LLM, and the user waits.</p><p>But the industry is moving toward <strong>Context Engineering</strong> and <strong>Agentic Workflows</strong>. In these systems, an agent doesn’t just retrieve once. It runs a loop: <em>Retrieve → Reason → Retrieve again to verify → Refine query → Final retrieval.</em></p><p>These retrieve-reason loops can incur 5 or 10 retrieval calls to fulfill a single user request, multiplying the impact of search latency. What used to be a perfectly acceptable 100ms to return a single set of results now becomes 1 second of “agent thinking time” before the LLM even starts streaming an answer.</p><p>Let’s look at how different engines handle this pressure, specifically when you add filters (think “in-stock,” “price &lt; $60,” or “region: US”) into the mix. Here are a series of benchmarks on a 20M document corpus comparing Elasticsearch and OpenSearch on filtered vector retrieval.</p><p>Spoiler: These tests showed Elasticsearch has 8x higher throughput than OpenSearch for filtered vector search.</p><h3>The Benchmark: Filtered kNN at Scale</h3><p>The goal was to measure <strong>Recall@100</strong> (the amount of relevant documents found in the top 100 results) against <strong>Throughput</strong> and <strong>Latency</strong>. We used six e2-standard-16 nodes (16 vCPUs, 64 GB RAM) for each cluster, testing Elasticsearch 9.3 and OpenSearch 3.5. Both run on Lucene 10, so the differences come down to how the engines implement the filtered retrieval and rescoring.</p><p>The full test output and benchmarking code is available in this <a href="https://github.com/elastic/competitive-benchmarking-studies">repository</a> in the folder <a href="https://github.com/elastic/competitive-benchmarking-studies/tree/main/es-9.3-vs-os-3.5-vector-search">es-9.3-vs-os-3.5-vector-search</a>, but here are some highlights.</p><p>This test ran on 20 million documents, where each document included vector dimensions of 128 dimensions.</p><p>Here are some raw aggregate numbers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dH75jJYizRlD4AZ2mTBrQA.png" /></figure><p>Overall, both vector databases performed comparably on recall:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWnPQ6FaUoOAVdd0b8DhDw.png" /><figcaption>Recall comparison for Elasticsearch vs. OpenSearch at various configurations for num_candidates</figcaption></figure><p>However, as the number of candidates increased, the latency gap widened:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFBssL6C7k-TKzkWM9Sb4A.png" /><figcaption>Latency comparison for Elasticsearch vs. OpenSearch at various configurations for num_candidates</figcaption></figure><p>Let’s see what the raw numbers look like when you’re aiming for high recall (getting the right answer &gt;98% of the time). Here is calling out 9,000 candidates, where both Elasticsearch and OpenSearch perform very well in overall recall (98.3%):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OnVdexFBVkR-2UYi7tjrg.png" /></figure><p>While recall is nearly identical between the two systems, the latency gap is massive: <strong>90ms vs 687ms</strong>.</p><p>In a standard agentic loop where the agent calls the search tool 10 times to assemble context:</p><ul><li><strong>Elasticsearch (90ms):</strong> Total retrieval time = <strong>0.9 seconds</strong>.</li><li><strong>OpenSearch (687ms):</strong> Total retrieval time = <strong>6.8 seconds</strong>.</li></ul><p>Keep in mind that these times are all in retrieval reasoning, before users start seeing output — this is <a href="https://docs.nvidia.com/nim/benchmarking/llm/latest/metrics.html#time-to-first-token-ttft">time to first token</a>, or practically speaking how long it takes before you ask a question and start getting a response. Think about the response times you typically expect from a chatbot. You may not expect instantaneous results, but anything more than two seconds can feel like a very long time — and more than six seconds can make you wonder if the tool is broken.</p><h3>Why the gap?</h3><p>As I stated above, both engines use Lucene 10, so we can rule out any differences in the underlying library. That means that the differences come down to the implementation.</p><p>Most vector searches today use HNSW for speed, but when you apply a filter, the engine has to decide: do I search the graph and then filter the results, or do I use the filter to limit which parts of the graph I search?</p><p>Elasticsearch uses a rescoring mechanism that allows for high-performance over-sampling. It gathers a larger list of candidates using compressed vectors and then performs a high-precision rescore on just the top hits. This “coarse-to-fine” approach keeps the latency flat even as you scale the candidate pool to ensure high recall.</p><h3>The Reality of Production RAG</h3><p>We often focus on the “Generative” part of RAG, but the “Retrieval” is just as important. Not only is relevance crucial to make sure we’re passing in the best context to LLMs, but retrieval is also where cost and latency compound. If your agents are running multi-step reasoning loops, your vector database performance is your primary bottleneck.</p><p>The takeaway from these benchmarks is simple: if you are moving toward agentic workflows, you need to benchmark your search engine for <strong>iterative throughput</strong>, not just a single “hello world” query.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f542e3af0748" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Developer’s Guide to Vector Embeddings and Search]]></title>
            <link>https://kderusso.medium.com/a-developers-guide-to-vector-embeddings-and-search-d148f6d97726?source=rss-3397ea8b616f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d148f6d97726</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[vector-embeddings]]></category>
            <category><![CDATA[search]]></category>
            <dc:creator><![CDATA[Kathleen DeRusso]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 13:57:47 GMT</pubDate>
            <atom:updated>2026-02-19T13:20:59.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMXmK0JAAs0zEi0SHumxbA.png" /><figcaption>Illustration representing dense and sparse vectors in a vector database.</figcaption></figure><p>In the age of AI, traditional keyword-based search often isn’t enough. To build truly intuitive search experiences, we need to move toward understanding meaning and intent: “Semantic Search”.</p><p>This blog is geared toward the developer who wants to start using semantic search, but may not quite know where to start. We’ll break down the core components of modern semantic search: vector embeddings, vector databases, and the mechanics of vector search. It follows from a video series I participated in, which is linked below.</p><p>I use <strong>Elasticsearch</strong> as my vector database. Elasticsearch is an extremely powerful vector database on its own, but to me its real superpower is the fact that it’s also a best-in-class text search solution. Trust me when I say that combining multiple sets of search results to show only the best results is a hard, hard problem! Elasticsearch shines because hybrid search can be performed using a single query, and all of the complex ranking reasoning is done behind the scenes. It’s also quite easy to use — indexing and searching a semantic_text field is as easy as using, well, a regular old text field. (Disclaimer: I’ve worked on some of the features that make semantic_text so easy to use).</p><h3><strong>What are Vector Embeddings?</strong></h3><p>Vector embeddings are a way to turn content into numerical representations of data that capture its underlying meaning in a way computers can process. For this blog I’ll primarily be focusing on text, but you can generate embeddings out of other content as well, such as images.</p><p>When we translate text into these numerical representations, they’re encoded in a conceptual map. Think of these as points in a high-dimensional graph. In this graph, similar objects are mathematically located closer to each other in the map. For example, take the words “dog” and “retriever.” These will be a much shorter distance from each other than “dog” and “cookies.”</p><p>When we explore this graph during a search, we return results based on their relative similarity. In effect, we return documents where the numbers are closer together. This means that we can return relevant results that match the meaning and intent of a query without needing the exact keywords used to be included in the documents that are returned.</p><h3>Dense vs. Sparse Embeddings</h3><p>Understanding the difference between these embedding types is critical for optimizing your search architecture.</p><h4>Dense Embeddings</h4><p>Dense embeddings are a very compact numerical representation of meaning, stored in compact floating-point arrays. Each number in the array corresponds to a dimension and together they capture the overall meaning of an object. This is a very simplified example of how this might look like in vector embeddings:</p><pre>&quot;dog&quot; → [0.82, -0.11, 0.47, …]<br>&quot;retriever&quot; → [0.80, -0.09, 0.50, …]<br>&quot;cookies&quot; → [-0.33, 0.91, -0.12, …]</pre><p>When we search these vectors, we use similarity metrics (like cosine similarity or Euclidean distance) to search these vectors and return the most relevant results.</p><h4>Sparse Embeddings</h4><p>Sparse embeddings have a vast number of dimensions (think every word in a language), but most of the values are zero or empty. If we represented sparse embeddings the same way we represented dense embeddings, it might look something like this:</p><pre>[0, 0, 0, 0.8, 0, 0, 0, 0.3, 0, 0, 0, 0.6, 0…]</pre><p>That’s a lot of wasted space! So in Elasticsearch, we represent these as keyword/token pairs instead. Here’s a simplified example of what that looks like:</p><pre>&quot;dog&quot;: 3.014208,<br>&quot;puppy&quot;: 2.6253395,<br>&quot;retriever&quot;: 1.7399588,<br>&quot;puggle&quot;: 0.8806293,<br>…<br>&quot;cookie&quot;: 0.6215426</pre><p>Each number is a weight that indicates how relevant that token is to the content it represents.</p><p>Sparse models are ideal for text expansion use cases, where we take weighted tokens from a sparse embeddings model like ELSER and “OR” them together taking their relative importance into account. This allows us to cast a wide net for relevant content.</p><h3>Choosing a Model</h3><p>First things first, you have to choose a model to create your embeddings. At first glance, choosing a model might be intimidating. You may see terms like dimensionality and quantization, and wonder what they are and why do you need to care?</p><p>For many semantic search and hybrid search use cases, simply performing a semantic search will provide significant gains in relevance. But if you’re starting out using vector search, choosing a good model to start with will set you off on the right path for the best results.</p><p>When the video series was recorded, I recommended <strong>E5</strong> as an excellent choice for multilingual support, or <strong>ELSER (Elastic Learned Sparse Encoder) </strong>as a state-of-the-art sparse embeddings model optimized for English language text expansion. These are both excellent models and will perform extremely well when used for most semantic search use cases.</p><p>However, today, if I were to recommend a model I would recommend going with one of the <a href="https://jina.ai/embeddings/"><strong>Jina embeddings</strong> models</a>. Not only are they modern embedding models with built in multilingual support, but they’re also embedding models that use dense vectors under the hood, which lets you take advantage of the significant gains Elasticsearch has made recently with vector storage and performance, especially <a href="https://www.elastic.co/search-labs/blog/diskbbq-elasticsearch-introduction"><strong>DiskBBQ</strong></a>.</p><h3>Vector Databases: The Storage Layer</h3><p>OK, so we have vector embeddings, now we need to store and use them. This is where vector databases come into play, like Elasticsearch. A vector database is a specialized data store designed to efficiently store, index, and search high dimensionality vector embeddings.</p><p>There are a lot of vector databases out there, and it’s important to choose the solution that will best work for your use cases and existing tech stack. When evaluating a vector database, look for these technical capabilities:</p><ol><li><strong>Scalability</strong>: The ability to search through millions or even billions of vectors.</li><li><strong>Performance</strong>: High-speed indexing and low-latency search response times.</li><li><strong>Hybrid Search Support</strong>: The capability to combine vector similarity with traditional keyword search (BM25) out of the box.</li><li><strong>Integration</strong>: How easily it fits into your existing tech stack.</li><li><strong>Cost:</strong> How much space do vectors take up on disk, and how much memory is needed if vectors need to sit in RAM?</li></ol><h3>Vector Search vs. Semantic Search</h3><p>While these terms are often used interchangeably, they represent different layers of the search process. <strong>Semantic search</strong> focuses on the user’s intent and the underlying meaning behind a query, while <strong>vector search</strong> is the underlying technical mechanism that finds similarity between mathematical vectors to power that semantic understanding.</p><h3>Summary: How it All Fits Together</h3><p>We went through a lot in this blog! But let’s wrap it up:</p><ul><li>An <strong>embedding model</strong> translates your raw content into vectors, or a list of numbers that represent its meaning.</li><li>These vectors are stored and indexed in a <strong>vector database</strong>.</li><li><strong>Vector search</strong> queries that database to find the closest matches based on mathematical similarity, which lets a computer find things that are conceptually similar even if they don’t use the exact words.</li></ul><h3>Watch the Series</h3><ul><li><a href="https://www.youtube.com/watch?v=VKmtmxQv6Jg">Vector Databases Explained</a></li><li><a href="https://www.youtube.com/watch?v=BKbScJ2P2P0">What is Vector Search?</a></li><li><a href="https://www.youtube.com/watch?v=bGNYyK1L41g">What are Vector Embeddings?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d148f6d97726" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>