<?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 Bernardo Neves on Medium]]></title>
        <description><![CDATA[Stories by Bernardo Neves on Medium]]></description>
        <link>https://medium.com/@bernardosbneves?source=rss-6c43da78103a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cj0g8Y5TzMY3OtHM.jpg</url>
            <title>Stories by Bernardo Neves on Medium</title>
            <link>https://medium.com/@bernardosbneves?source=rss-6c43da78103a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:46:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bernardosbneves/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[How I Built an End-to-End Semantic Retail Search]]></title>
            <link>https://medium.com/@bernardosbneves/how-i-built-an-end-to-end-semantic-retail-search-e86799490e9b?source=rss-6c43da78103a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e86799490e9b</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[mongodb-atlas]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Bernardo Neves]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:14:28 GMT</pubDate>
            <atom:updated>2026-08-31T17:14:28.305Z</atom:updated>
            <content:encoded><![CDATA[<h4>An end-to-end guide to building Hybrid Search using MongoDB Atlas Vector Search and Voyage AI.</h4><p>I’m a Solutions Architect at MongoDB. I recently built a demo for a customer to show what happens when you fix search relevance in a retail catalog.</p><p>Whether you care about the business metrics or just want to see the code, this is the full write-up: architecture, code, and the details that are crucial for project success.</p><p>Part of my job is building working things that answer a question a customer is actually asking. Slides describe a capability; a demo lets someone type into a box and see what happens.</p><p>The question this time was one most online retailers eventually run into: <strong>shoppers search for what they mean, and keyword engines match what they type.</strong></p><p>Let&#39;s imagine someone is looking for a card and knows what it does but not what it’s called, so they type the thing they’d say out loud to a friend:</p><blockquote>reanimation from the graveyard</blockquote><p>A lexical engine looks for those characters. No product in the catalog contains the word “reanimation”. Real trading cards don’t describe themselves in shopper vocabulary, they describe themselves in game mechanics. So the search returns whatever fuzzy-matched on “from” and “the.”</p><p>The shopper sees noise and leaves. Sitting in the catalog, unreached: a Magic card called <strong>Reanimate</strong> and a Yu-Gi-Oh card called <strong>Monster Reborn</strong>, which do precisely the thing that was asked for.</p><p>Closing that gap is what vector search is for: it matches on meaning rather than characters. The build below does it with MongoDB Atlas Vector Search and Voyage AI embeddings, in about 200 lines.</p><p>I’m writing it up because several of the decisions that mattered most: how you write the product text, which analyzer your keyword baseline uses, which embedding endpoint you call aren’t spelled out anywhere obvious.</p><h3>What I built</h3><p>A small but complete trading-card marketplace — Magic: The Gathering, Pokémon, and Yu-Gi-Oh in one catalog running on <strong>MongoDB Atlas Vector Search</strong> with embeddings from <a href="https://www.mongodb.com/docs/voyageai/"><strong>Voyage AI</strong></a>, the embedding company MongoDB acquired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OllFVf8Yn1sskOK0lVzmbQ.png" /><figcaption>UI</figcaption></figure><p>I should admit up front that I’m not a gamer. The audience I presented this to very much was, which is why the catalog looks like this. It helped and it raised the bar on the details. That turned out to matter more than I expected, for reasons I’ll get to in Step 1.</p><p>One search box. Three modes you can flip between:</p><ul><li><strong>Semantic (vector)</strong> — matches on meaning</li><li><strong>Keyword (lexical)</strong> — a genuine Atlas Search full-text index</li><li><strong>Hybrid</strong> — fuses both with Reciprocal Rank Fusion</li></ul><p>The mode that made the point best was <strong>Compare</strong>: one query, semantic results on the left, keyword results on the right, side by side. When a shopper describes a concept in their own words, the two columns don’t just differ. They stop resembling each other.</p><pre>┌─────────────────────────────────────────────────────────────┐<br>│  Search:  &quot;reanimation from the graveyard&quot;      [Compare ✓]  │<br>├──────────────────────────────┬──────────────────────────────┤<br>│  SEMANTIC · Vector Search    │  LEXICAL · Keyword Search     │<br>├──────────────────────────────┼──────────────────────────────┤<br>│  #1  Reanimate               │  #1  Elemental HERO Neos      │<br>│  #2  Monster Reborn          │  #2  Emrakul, the Aeons Torn  │<br>│  #3  Swords to Plowshares    │  #3  Ash Blossom &amp; Joyous ... │<br>└──────────────────────────────┴──────────────────────────────┘<br>   ↑ the two cards that actually        ↑ noise — none of these<br>     reanimate, across two games          reanimate anything</pre><p>That side-by-side is the entire argument. I stopped needing to explain it.</p><h3>The architecture</h3><pre>┌──────────────────────────────────────────┐<br>   Browser  ──────► │  Express server (server.js)              │<br>   (search box)     │   /api/vector   /api/keyword   /api/hybrid│<br>                    └───────────────┬──────────────────────────┘<br>                                    │<br>                 embed query text   │<br>                 (Voyage AI)        │<br>                                    ▼<br>                    ┌──────────────────────────────────────────┐<br>                    │  MongoDB Atlas — cardshop.cards           │<br>                    │                                           │<br>                    │  Each document:                           │<br>                    │   { name, price, rarity, inStock, ...     │<br>                    │     rulesText, flavorText,                │<br>                    │     embedding: [0.017, -0.04, ... x1024] }│<br>                    │                                           │<br>                    │  Two Atlas Search indexes:                │<br>                    │   • cards_vector_index  (vectorSearch)    │<br>                    │   • cards_text_index    (full-text)       │<br>                    └──────────────────────────────────────────┘</pre><p>Look at where the embedding lives: inside the product document, next to price and inStock.</p><p>That placement is the part I’d want to know about if I were evaluating this. There’s no separate vector database to provision and keep in sync, and no nightly job reconciling a catalog against a second system that has drifted. The operational data, the full-text index, and the vectors sit in one place, and a single query can touch all three.</p><p><strong>Stack:</strong> MongoDB Atlas Vector Search · Voyage AI (voyage-3.5, 1024 dimensions) · Node/Express · vanilla-JS front end. Roughly 200 lines of code and two index definitions.</p><h3>Step 1: The data, and why it decides everything</h3><p>The catalog is about 57 hand-built cards. Each document is a perfectly ordinary retail SKU:</p><pre>{<br>  name: &#39;Reanimate&#39;,<br>  game: &#39;Magic: The Gathering&#39;,<br>  set: &#39;Tempest&#39;,<br>  rarity: &#39;Uncommon&#39;,<br>  type: &#39;Sorcery&#39;,<br>  rulesText: &#39;Put target creature card from a graveyard onto the battlefield &#39; +<br>             &#39;under your control. You lose life equal to its mana value.&#39;,<br>  flavorText: &#39;The dead make excellent servants...&#39;,<br>  price: 9.75,<br>  condition: &#39;Near Mint&#39;,<br>  inStock: true,<br>  quantity: 18,<br>}</pre><p>The rulesText field is doing more work here than it looks like, and it&#39;s worth being deliberate about.</p><p>An earlier version of this catalog described cards editorially: <em>“a reanimation spell that brings monsters back from the dead,”</em> <em>“a board wipe that resets the battlefield.”</em> Readable copy, and exactly what a marketing team would write.</p><p>It also makes a relevance comparison meaningless. Those descriptions contain the shopper’s vocabulary, so the keyword index matches “reanimation” directly and both engines return the same results. You end up measuring the product copy, not the search.</p><p>The catalog uses authentic, mechanical text instead — the way real cards actually read:</p><blockquote><em>Destroy all creatures. They cannot be regenerated.</em></blockquote><p>No “board wipe.” No “reanimation.” Now the only route from <em>“wipe the board”</em> to <em>Wrath of God</em> runs through understanding what the card <strong>does</strong> — exactly what embeddings capture and exactly what character matching cannot.</p><p>The general point, and the first thing I’d check on a real catalog: the semantic advantage is largest exactly where product descriptions <em>don’t</em> already contain the words shoppers use. Keyword-stuffed copy shows a tie in a side-by-side test, which makes vector search look like it isn’t worth the trouble. Shoppers using their own words are still hitting the gap — it’s just invisible from inside your own vocabulary.</p><h3>Step 2: Embeddings with Voyage AI</h3><p>An embedding turns text into a list of numbers that encodes its meaning. Similar meanings land near each other in the vector space. Each card gets embedded once, at write time, and the vector is stored right in the document.</p><p>First, flatten the card into one compact string:</p><pre>export function cardToEmbeddingText(card) {<br>  return [<br>    card.name, card.game, card.type, card.subtypes?.join(&#39; &#39;),<br>    card.rarity, `from the set ${card.set}`, card.rulesText, card.flavorText,<br>  ].filter(Boolean).join(&#39;. &#39;);<br>}</pre><p>Then call Voyage. And here there’s a detail that will save you either money or a rate-limit headache, depending on which endpoint you pick:</p><p>Endpoint Key format Catch api.voyageai.com/v1/embeddings pa-... (Voyage-issued) Free tier capped at <strong>3 requests/minute</strong> until you add a payment method ai.mongodb.com/v1/embeddings al-... (Atlas model key) Same voyage-3.5 model, billed through Atlas, <strong>no free-tier rate limit</strong></p><p>Same model, same vectors, different door. I didn’t want to attach a credit card just to run a demo, so I used the Atlas endpoint. It’s one environment variable:</p><pre>VOYAGE_API_KEY=&quot;al-...your-atlas-model-key...&quot;<br>EMBEDDING_URL=&quot;https://ai.mongodb.com/v1/embeddings&quot;<br>VOYAGE_MODEL=&quot;voyage-3.5&quot;<br>EMBED_DIMENSIONS=&quot;1024&quot;</pre><p>Two more things in the embed path that are easy to skip and shouldn’t be:</p><pre>// input_type matters: &quot;document&quot; when embedding catalog items,<br>// &quot;query&quot; when embedding a shopper&#39;s search. Voyage optimizes each differently.<br>const body = { model: config.voyageModel, input, input_type: inputType,<br>               output_dimension: config.dimensions };</pre><p>input_type is free relevance. The model places &quot;a question&quot; and &quot;an answer&quot; in compatible but distinct regions of the space, and telling it which one you&#39;re handing over measurably improves results. Set &quot;document&quot; when you index and &quot;query&quot; when you search. It costs you one field.</p><h3>Step 3: Two indexes, both native to Atlas</h3><p>This is the part that tends to surprise people: <strong>both</strong> search modes run on Atlas Search. The semantic one and the old-fashioned one. There is no bolt-on search engine anywhere in the diagram.</p><p><strong>The vector index:</strong></p><pre>await col.createSearchIndex({<br>  name: &#39;cards_vector_index&#39;,<br>  type: &#39;vectorSearch&#39;,<br>  definition: {<br>    fields: [<br>      { type: &#39;vector&#39;, path: &#39;embedding&#39;, numDimensions: 1024, similarity: &#39;cosine&#39; },<br>      { type: &#39;filter&#39;, path: &#39;game&#39; },<br>      { type: &#39;filter&#39;, path: &#39;rarity&#39; },<br>      { type: &#39;filter&#39;, path: &#39;price&#39; },<br>      { type: &#39;filter&#39;, path: &#39;inStock&#39; },<br>    ],<br>  },<br>});</pre><p>Those filter fields are how semantic relevance and hard business rules end up in a single query. More on that shortly.</p><p><strong>The full-text index:</strong></p><pre>await col.createSearchIndex({<br>  name: &#39;cards_text_index&#39;,<br>  type: &#39;search&#39;,<br>  definition: {<br>    mappings: {<br>      dynamic: false,<br>      fields: {<br>        name:       { type: &#39;string&#39; },<br>        rulesText:  { type: &#39;string&#39; },<br>        flavorText: { type: &#39;string&#39; },<br>        set:        { type: &#39;string&#39; },<br>      },<br>    },<br>  },<br>});</pre><p>I used a real Atlas Search full-text index for the keyword side rather than the legacy MongoDB $text index. A demo that beats a strawman isn&#39;t worth showing anyone — the first question I&#39;d expect is whether the baseline was rigged. Atlas Search full-text is BM25-ranked lexical search, the same class of thing a serious catalog runs in production. Comparing against that made the result something I could defend.</p><h3>Step 4: The three modes</h3><p><strong>Vector.</strong> Embed the shopper’s words, then search:</p><pre>const [queryVector] = await embed(q, &#39;query&#39;);<br>const results = await col.aggregate([<br>  {<br>    $vectorSearch: {<br>      index: &#39;cards_vector_index&#39;,<br>      path: &#39;embedding&#39;,<br>      queryVector,<br>      numCandidates: 150,<br>      limit: 10,<br>      ...(filter ? { filter } : {}),<br>    },<br>  },<br>  { $project: { name: 1, price: 1, score: { $meta: &#39;vectorSearchScore&#39; } } },<br>]).toArray();</pre><p><strong>Keyword</strong></p><pre>const results = await col.aggregate([<br>  { $search: { index: &#39;cards_text_index&#39;,<br>               text: { query: q, path: [&#39;name&#39;, &#39;rulesText&#39;, &#39;flavorText&#39;, &#39;set&#39;] } } },<br>  ...(filter ? [{ $match: filter }] : []),<br>  { $limit: 10 },<br>  { $project: { name: 1, score: { $meta: &#39;searchScore&#39; } } },<br>]).toArray();</pre><p><strong>Hybrid.</strong> This is the mode people ask the most questions about, so it’s worth being precise about what actually happens.</p><p>Hybrid does <strong>not</strong> run one clever query that understands both. It runs the two queries above, separately, and then merges the two ranked lists. They hit the same collection but different indexes, so they’re independent of each other and I fire them in parallel:</p><pre>const [vec, kw] = await Promise.all([<br>  vectorSearch(q, { filter, limit: 20 }),<br>  keywordSearch(q, { filter, limit: 20 }),<br>]);</pre><p>Two lists come back. Now they have to be combined, and that’s harder than it sounds, because <strong>the scores are not comparable.</strong> Vector search returns cosine similarity, roughly 0 to 1. Atlas Search returns BM25, an unbounded relevance score that might be 2 or might be 40 depending on term rarity and field length. Adding them together means whichever number happens to be bigger wins, which has nothing to do with which result is better.</p><p>Reciprocal Rank Fusion sidesteps that by throwing the scores away. It looks only at <strong>what position</strong> a document reached in each list.</p><p>Each appearance contributes 1 / (K + rank), with K = 60:</p><p>Rank in a listContribution11 / 61 = 0.016421 / 62 = 0.016151 / 65 = 0.0154201 / 80 = 0.0125</p><p>A document gets one contribution per list it appears in, and the two are added. So a card that ranks #5 in both lists scores 0.0154 + 0.0154 = 0.0308, beating a card that ranks #1 in one list and is absent from the other, at 0.0164.</p><p><strong>That’s the whole behaviour in one sentence: appearing in both lists beats ranking first in one.</strong> Which is usually what you want from hybrid, because agreement between two very different retrieval methods is a strong signal.</p><p>The K constant is what controls how strongly that holds. Look at the table again: the gap between rank 1 and rank 20 is small, because 60 dominates the denominator. Lower K to 5 and rank 1 scores 0.167 while rank 20 scores 0.04, so top positions dominate and the “appears in both” effect weakens. Raise K and the list flattens further toward pure agreement. K = 60 comes from the original 2009 RRF paper and is a reasonable default, not a law.</p><pre>const K = 60;<br>const scores = new Map(), byName = new Map();</pre><pre>vec.forEach((d, i) =&gt; { byName.set(d.name, d);<br>  scores.set(d.name, (scores.get(d.name) || 0) + 1 / (K + i + 1)); });<br>kw.forEach((d, i) =&gt; { if (!byName.has(d.name)) byName.set(d.name, d);<br>  scores.set(d.name, (scores.get(d.name) || 0) + 1 / (K + i + 1)); });</pre><pre>const results = [...scores.entries()]<br>  .sort((a, b) =&gt; b[1] - a[1])<br>  .slice(0, limit)<br>  .map(([name, score]) =&gt; ({ ...byName.get(name), score }));</pre><h3>Tuning hybrid</h3><p>Four knobs, roughly in order of how much they matter:</p><p><strong>Weights.</strong> The biggest lever. Multiply one branch’s contribution before summing, so semantic counts more than lexical or the reverse:</p><pre>const W_VEC = 1.0, W_KW = 0.6;   // trust semantic more than keyword<br>scores.set(d.name, (scores.get(d.name) || 0) + W_VEC * (1 / (K + i + 1)));</pre><p>Which direction to lean depends on your queries. Catalogs searched by part number or exact product name want keyword weighted up. Catalogs searched in descriptive language want semantic weighted up. This is worth measuring against real query logs rather than guessing.</p><p><strong>Retrieval depth.</strong> How many results each branch returns <em>before</em> fusion, and it’s the mistake I’d most expect someone to make. If each branch returns only 10 and you display 10, you lose most of the overlap signal, because a document sitting at rank 14 in one list and rank 3 in the other looks like it appeared once. Pull 20 to 50 per branch and fuse down to 10.</p><p><strong>K.</strong> As described above. Lower to favour top-ranked items, raise to favour cross-list agreement.</p><p><strong>Filters on both branches.</strong> Covered in the next section, and it’s a correctness issue rather than a tuning one.</p><h3>You may not need to write this yourself</h3><p>I implemented RRF in application code because it makes the mechanics visible. In production you’d likely use <a href="https://www.mongodb.com/docs/manual/reference/operator/aggregation/rankFusion/"><strong>$rankFusion</strong></a>, a native Atlas aggregation stage that does this inside the database. You give it multiple sub-pipelines and it combines their results with reciprocal rank fusion in a single stage, so there&#39;s no second round trip and no fusion code to maintain.</p><p>Weights per pipeline are supported, and scoreDetails will show you how a given score was computed, which is genuinely useful when a result ranks somewhere surprising.</p><p>Hybrid earns its keep when a shopper mixes a proper noun with a description, like <em>“Charizard holo”</em>, where you want keyword precision on the name and semantic recall on everything else.</p><h3>Relevance is only half the job</h3><p>Retail search isn’t “find me the most similar thing.” It’s “find me the most similar thing <strong>that I can actually sell you</strong>, under $50, in stock, in the right category.”</p><p>Because game, price, and inStock were declared as filter fields on the vector index, those constraints push straight down into the search:</p><pre>function buildFilter({ game, maxPrice, inStockOnly }) {<br>  const f = {};<br>  if (game &amp;&amp; game !== &#39;all&#39;) f.game = game;<br>  if (inStockOnly)            f.inStock = true;<br>  if (maxPrice)               f.price = { $lte: Number(maxPrice) };<br>  return Object.keys(f).length ? f : undefined;<br>}</pre><p>Two sharp edges worth knowing before you hit them:</p><p><strong>In </strong><strong>$vectorSearch, you can only filter on fields you indexed as </strong><strong>filter.</strong> Forget to declare one and you&#39;ll be filtering in application code, after the fact, on a truncated result set, which quietly produces wrong answers.</p><p><strong>In hybrid mode, apply the filter to both branches before fusing.</strong> If you filter only the vector branch, an out-of-stock card that you deliberately excluded can walk back into the final list through the keyword branch during fusion. Same filter, both sides, then fuse.</p><h3>The results</h3><p>Authentic card text, a strong keyword baseline. Here is what Compare mode returns for the same query on each side. Semantic is what the shopper wanted; keyword is what they would have gotten.</p><p><strong>“reanimation from the graveyard”</strong></p><ul><li><em>Semantic:</em> Reanimate, Monster Reborn</li><li><em>Keyword:</em> Elemental HERO Neos, Emrakul, Ash Blossom</li></ul><p><strong>“a wizard that casts powerful magic”</strong></p><ul><li><em>Semantic:</em> Dark Magician, Snapcaster Mage</li><li><em>Keyword:</em> Rhystic Study, Mystical Space Typhoon</li></ul><p><strong>“stop my opponent from playing a spell”</strong></p><ul><li><em>Semantic:</em> Counterspell, Rhystic Study</li><li><em>Keyword:</em> Elemental HERO Neos, Raigeki</li></ul><p><strong>“undo my opponent’s move”</strong></p><ul><li><em>Semantic:</em> Counterspell, Mirror Force, Swords to Plowshares</li><li><em>Keyword:</em> Venusaur, Gengar, Alakazam</li></ul><p>That last one is my favorite. <em>“Undo my opponent’s move”</em> returns three random Pokémon. Not near-misses. Not a different interpretation. Just three creatures that happen to share stopwords with the query.</p><p>In every one of these, the shopper never typed the product’s own words, and semantic search found it anyway.</p><h3>Four things worth knowing before you build this</h3><p><strong>1. Your product text decides what a comparison can show.</strong> Covered above, but worth restating: descriptions containing the concept-words let keyword search match directly, and semantic search looks redundant next to it. Check the copy before you trust the benchmark.</p><p><strong>2. Analyzers are a product decision, not a config detail.</strong> The default lucene.standard analyzer tokenizes and lowercases, but it does not stem and does not remove stopwords. Two consequences, both of which I hit while testing.</p><p>Without stemming, a singular and a plural, or a verb and its noun form, are unrelated tokens. A query using a different grammatical form of a word that is genuinely in your catalog can return nothing at all. Without stopword removal, common words such as “from” and “the” remain indexed and can participate in matching and relevance scoring, potentially diluting the signal from more meaningful terms.</p><p>Switching the field to lucene.english gives you both, and the keyword results improve noticeably. The point is that your analyzer choice changes what &quot;keyword search&quot; even means in a comparison, so check which one you&#39;re running before drawing conclusions from a bake-off.</p><p><strong>3. Choose the embedding model, don’t inherit it.</strong> I used voyage-3.5 at 1024 dimensions because it suited a mixed-domain retail catalog, but that was a decision, not a default. It&#39;s worth spending an hour on before you index anything, because changing your mind later means re-embedding the entire collection.</p><p>Three things I’d weigh:</p><ul><li><strong>Domain fit.</strong> General-purpose models are the right starting point for product catalogs, but specialised models exist for code, legal and financial text, and multimodal content. Retrieval quality on your data is what matters, not benchmark averages.</li><li><strong>Dimensions.</strong> Higher dimensions capture more nuance and cost more storage and memory. Some models support shrinking the output dimension, which lets you trade a little accuracy for a much smaller index.</li><li><strong>Reranking.</strong> A reranker is a second, more expensive pass over your top few results. Retrieve broadly with embeddings, then rerank the top 50 down to 10. It’s often a bigger relevance win than switching embedding models.</li></ul><p>Voyage AI is the natural first stop here now that it’s part of MongoDB, and it covers all three of those.</p><p><strong>4. You may not need to write the embedding pipeline at all.</strong> Everything in Step 2, calling the API, storing the vector, embedding the query at search time, is now optional. You could use <a href="https://www.mongodb.com/docs/vector-search/crud-embeddings/automated-embedding/"><strong>Automated Embedding</strong></a>: you pick a Voyage model when you configure the vector index, point it at a text field, and MongoDB generates and stores the embeddings for you, at index time and at query time, keeping them in sync as documents change.</p><p>That removes the whole class of bugs where your embeddings drift out of date because someone updated a product description without re-running the embed job. It also means you can send natural language text straight to the query rather than embedding it yourself first.</p><p>I wrote the pipeline by hand here because seeing input_type, dimensions and the stored vector made the mechanics concrete, which was the point of a demo. For anything real, start with Automated Embedding and only drop down to manual embedding if you need control it doesn&#39;t give you.</p><p>If you do embed manually, one detail that’s easy to skip: set input_type to &quot;document&quot; when indexing and &quot;query&quot; when searching. The model places questions and answers in related but distinct regions of the vector space, and telling it which one you&#39;re handing over is free relevance.</p><h3>Where this ends up mattering</h3><h3>Where this ends up mattering</h3><p><strong>One platform, zero ETLs.</strong> Operational data, full-text search, vector search and business-rule filters live in one database and execute in a single query. No fragile sync pipelines to keep alive, no paying to store the same catalog twice, and no window where an item went out of stock ten minutes ago but your search index hasn’t heard about it.</p><p><strong>One vendor.</strong> Voyage AI is part of MongoDB. Strong retrieval-focused embedding models, one bill, and the models sitting next to the data rather than a network hop away.</p><p><strong>Real-time consistency.</strong> Price, inventory and spec changes are reflected in your search filters straight away, not by whatever an off-site vector index happened to ingest two hours ago.</p><p><strong>It scales past the demo.</strong> The same $vectorSearch stage that handles 57 cards handles 57 million SKUs, with approximate nearest neighbour via HNSW keeping query latency roughly flat as you grow.</p><p><strong>Low friction to test.</strong> Roughly 200 lines, two index definitions, no new infrastructure to provision.</p><p><a href="https://www.mongodb.com/docs/vector-search/">Vector Search</a> is very well documented. What I wanted to show you I how much the result depends on the surrounding choices: how the product text is written, which analyzer the keyword baseline uses, which embedding model you picked. Those are the things I’d want someone to know before evaluating this on their own catalog.</p><p><em>I’m a Solutions Architect at MongoDB. This was built for a customer conversation about search relevance; the catalog is entirely synthetic and no customer data or details are involved. Opinions are 100% my own.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e86799490e9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>