<?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 Emanuel Jimenez on Medium]]></title>
        <description><![CDATA[Stories by Emanuel Jimenez on Medium]]></description>
        <link>https://medium.com/@emanueljimenez?source=rss-82dc5bf64129------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WlGlHUZ3fjTG-KYP.</url>
            <title>Stories by Emanuel Jimenez on Medium</title>
            <link>https://medium.com/@emanueljimenez?source=rss-82dc5bf64129------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:46:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emanueljimenez/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 we run an AI-assisted dev workflow: Claude Code, Linear, Slack and Grok]]></title>
            <link>https://medium.com/@emanueljimenez/how-i-run-a-one-person-ai-dev-team-claude-code-linear-slack-and-grok-5b65a2b542ac?source=rss-82dc5bf64129------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b65a2b542ac</guid>
            <category><![CDATA[slackbot]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[grok-ai]]></category>
            <category><![CDATA[linear-app]]></category>
            <dc:creator><![CDATA[Emanuel Jimenez]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 21:10:05 GMT</pubDate>
            <atom:updated>2026-11-27T21:23:40.016Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Four tools, one loop: an AI agent spots new regulations, a ticket appears, a coding agent ships the change, and I approve every step from Slack.</em></p><p><a href="https://regwatch.boyscout.dev/">RegWatch AI</a> is a regulatory monitoring platform for tax and audit firms. It covers Spain and the EU, and now also US sources such as the IRS, the PCAOB and the AICPA. Every night it reads the official publications, works out which new rules affect which clients, and backs every answer with a citation to the official text that anyone can check.</p><p>Two things make this hard.. The regulations never stop arriving, so there’s always more to build. And the domain is unforgiving: a wrong date or an invented reference is a real problem for a client. So I can’t just let agents run loose. I needed a setup where AI does most of the typing and the watching, and I still make every decision that matters.</p><p>This post walks through that setup step by step: what each tool does, how they connect, and the details that made it work in practice. If you work in a small team, you can copy most of it in an afternoon..</p><h3>The setup at a glance</h3><p>Each tool has one job, and the two decisions that matter stay with a person:</p><ul><li><strong>Grok</strong> watches the regulators and turns new publications into issues.</li><li><strong>Linear</strong> is the single list of work; agent issues wait in Triage.</li><li><strong>Claude Code</strong> turns an accepted issue into a pull request, working in its own git worktree.</li><li><strong>Slack</strong> is where I see everything: issues, comments, CI and deploys.</li></ul><p>The two highlighted boxes are the only manual steps.</p><p>The two highlighted boxes are the only manual steps: accepting an issue and merging a pull request. Everything between them runs on its own.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*9XhzaKgqY6iuS4vN7bD42Q.png" /></figure><h3>Step 1: Linear is the single source of work</h3><p>The first rule of the setup is simple: <strong>no issue, no code.</strong> Every piece of work, whether I thought of it, a customer asked for it or an agent found it, starts as a Linear issue in one team (key BOY). That gives every change an ID that follows it through the branch name, the pull request and the Slack thread.</p><p>Three things I set up in Linear:</p><ol><li><strong>A Triage state.</strong> Issues created by agents don’t land in my backlog. They land in Triage, where I accept, merge or decline them. This is the buffer that keeps an AI from filling my roadmap.</li><li><strong>A </strong><strong>vigilancia label</strong> (Spanish for &quot;watch&quot;). Every issue the regulatory watcher creates carries it, so I can filter &quot;what did the bot find this week&quot; in one click.</li><li><strong>Acceptance criteria on every issue.</strong> The coding agent is told not to start without them. If an issue has none, it asks for them in a comment.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*GLhxpt5EbhJvMlGbX4GnDw.png" /></figure><p>My issues in Linear: the newest one came from the watcher bot.</p><p><strong>Technical detail:</strong> Linear ships an official MCP server, so Claude Code can read and update issues directly. One command connects it:</p><pre>claude mcp add --transport http linear-server https://mcp.linear.app/mcp</pre><p>The first time you use it, a browser window opens for OAuth. After that, the agent can read an issue, move it to In Progress and post a comment when it’s done.</p><h3>Step 2: Grok watches the regulators and files issues</h3><p>My product monitors regulations for clients, but I also need to know when a regulator publishes something my <em>product</em> should cover. That’s the job of a Grok bot I called <strong>RegWatch Compliance</strong>.</p><p>It runs as a scheduled task on Monday, Wednesday and Friday. The instructions are plain text and look roughly like this:</p><ol><li>Search for publications from a fixed watchlist of regulators in the EU, Spain and the US since the last run: 72 hours on Mondays, 48 hours otherwise.</li><li>For each item relevant to the product, check Linear for an existing issue. If one exists, add a comment. If not, create one.</li><li>Create at most 5 issues per run, in the Triage state, with the vigilancia label.</li><li>Prefix the title with “URGENTE:” only if a deadline closes in less than 10 days.</li><li>Never invent a reference, a date or a number. If something can’t be checked, say so in the issue.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*1SFC1N7wevPXAo7st_gCGw.png" /></figure><p>The watcher bot in Grok, with Friday’s run.</p><p>Here’s what a real run produced this Friday. It found two new consultations from AMLA, the EU anti-money-laundering authority, and opened <strong>BOY-162</strong> to bring them into the product. It reported the publication date and when each consultation closes, explained why it didn’t mark the issue as urgent, and confirmed there were no earlier issues on the topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*VzPsjr7udKtV1IQkag0RRQ.png" /></figure><p>The run summary: one issue created, no duplicates.</p><p><strong>Why Grok for this part?</strong> Two reasons. Grok’s search is good at fresh news and posts from regulators, and Grok has a native Linear connector, so the bot can create issues without any glue code. I use the personal bot included in my X Premium subscription.</p><p><strong>Why every 48 hours and not every hour?</strong> Regulators publish on working days, and consultations stay open for weeks or months. Checking three times a week catches everything in time, and keeps the Triage queue short enough that I actually read it.</p><h3>Step 3: Claude Code picks up the issue, in its own worktree</h3><p>Once I accept an issue, Claude Code does the engineering. I start a session with one line, for example <em>“work on BOY-160”</em>, and the rest is in a file the agent reads on every session: CLAUDE.md at the root of the repo.</p><p>The Linear part of my CLAUDE.md is short:</p><pre>## Working with Linear<br>- All work starts from a Linear issue in team BOY. No issue, no code.<br>- When starting: read the issue through the Linear MCP, move it to<br>  In Progress and work in your own worktree:<br>  git worktree add ../boy-&lt;n&gt; -b boy-&lt;n&gt;-&lt;slug&gt; feature/dev<br>- At most two active worktrees. After the PR merges:<br>  git worktree remove ../boy-&lt;n&gt;<br>- No acceptance criteria? Ask for them in an issue comment first.<br>- When done: open the PR with the issue ID in the title and comment<br>  the PR link plus the typecheck, lint and test results on the issue.<br>- Never deploy, never touch production data or credentials.</pre><p>That last line matters. The agent can read code, run tests and write files freely. Anything with side effects outside the developer’s machine… (a push, a migration, a production backfill) needs my explicit approval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*OAZeX2vUOeOcHxZnPULHYQ.png" /></figure><p>Claude Code closing a delivery: real check results and a risk it found.</p><p>Look at what that report includes. The agent split the issue into deliveries (E1 for shared code and the API, E2 for the web), ran all three checks and gave the real numbers, including two failing tests it recognised as a known Windows line-ending issue. It also raised something I hadn’t asked about: old Excel imports might have swapped day and month. And it says it stopped because I rejected one of its steps. That’s the behaviour I want: honest numbers, risks surfaced, and no pushing past a “no”.</p><h3>Why git worktrees change everything</h3><p>A git worktree is a second (or third) working directory attached to the same repository. Each worktree has its own branch and its own files on disk, but they all share one .git history. One command creates it:</p><pre>git worktree add ../boy-160 -b boy-160-notificaciones feature/dev</pre><p>This gives me a folder ../boy-160 with a fresh branch, next to my main checkout. Here&#39;s why that&#39;s so useful with coding agents:</p><ul><li><strong>Parallel work without collisions.</strong> I can have one Claude Code session on BOY-160 and another on BOY-161, each in its own folder. They never overwrite each other’s files, and neither touches my main checkout.</li><li><strong>No more stash juggling.</strong> If an urgent bug comes in, I don’t stash half-finished agent work. I open another worktree for the fix and come back later.</li><li><strong>One issue = one folder = one branch = one PR.</strong> The naming (boy-&lt;n&gt;) makes it obvious which terminal belongs to which issue, and which Slack notification belongs to which branch.</li><li><strong>Easy review and easy throwaway.</strong> I can open the worktree in my editor and read the diff in isolation. If the approach is wrong, git worktree remove and the branch deletion leave no trace.</li><li><strong>Cheaper than a second clone.</strong> All worktrees share the same objects, so creating one takes seconds and almost no disk.</li></ul><p>A few practical details I learned the hard way:</p><ol><li><strong>Dependencies are per folder.</strong> Each worktree needs its own npm install (or your package manager&#39;s equivalent). Budget the time and disk.</li><li><strong>Untracked files don’t come along.</strong> Your .env and local config live only in the main checkout. Copy what&#39;s needed, and never copy production credentials.</li><li><strong>Watch your ports.</strong> Two dev servers on the same port will fight. Run tests in parallel, but only one dev server at a time, or give each worktree its own port.</li><li><strong>Cap the number.</strong> I allow two active worktrees. More than that and I become the bottleneck: every worktree is a PR I have to review.</li><li><strong>Clean up after merging.</strong> git worktree list shows what&#39;s open; git worktree prune removes references to folders you already deleted. Tools like ESLint and Vitest may also need to ignore the worktree folder if it sits inside the repo.</li></ol><h3>Step 4: Slack is the control room</h3><p>Linear holds the work, GitHub holds the code, and Slack is where I see both without opening either. I keep three channels:</p><ul><li><strong>#linear-avisos</strong>: new issues, status changes and agent comments on issues, from the Linear app.</li><li><strong>#ci</strong>: pass or fail of each workflow run, from the GitHub app.</li><li><strong>#deploy</strong>: deploy runs to production, from the GitHub app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*p1qEFr3knoarWB8RfjPjtQ.png" /></figure><p>Three channels, one job each.</p><p>The nice side effect: when Claude Code finishes a delivery and comments on the Linear issue, that comment shows up in #linear-avisos. I can read &quot;E2 (web) done, here are the test results&quot; on my phone and decide whether to review now or later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*uEJqaDnDFlQgYGwbcLblMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*vZ8D6PNGvGEXCz7FFhL8EQ.png" /></figure><p>The agent’s comment on BOY-160, delivered to Slack by the Linear app.</p><p>CI results land in #ci.</p><p><strong>Technical details that tripped me up:</strong></p><ol><li><strong>Connect the workspace first.</strong> In Linear, the Slack integration must be connected at the workspace level before you can pick a channel in your team’s settings. Otherwise you get a “connect a Slack workspace” error.</li><li><strong>Name collisions.</strong> I couldn’t call the channel #linear, because the Linear app already uses that name. Hence #linear-avisos (&quot;linear-notices&quot;).</li><li><strong>One GitHub command per message.</strong> Inside a channel, subscribe with the GitHub app, one command per message, or Slack silently ignores the rest:</li></ol><pre>/github subscribe owner/repo pulls reviews comments<br>/github subscribe owner/repo workflows:{name:&quot;CI&quot;}</pre><p>For #ci, I also unsubscribed the default features (issues, commits, releases) so the channel only shows workflow results. A noisy channel is a channel you mute.</p><h3>Guardrails and lessons</h3><p>The tools are the easy part. What makes the setup safe is a handful of rules about where the AI stops.</p><ul><li><strong>Agents propose, I decide.</strong> Grok can only create issues in Triage. Claude Code can only open pull requests. Nothing reaches production without me pressing the button.</li><li><strong>Two phases for anything non-trivial.</strong> First the agent explores: it reads the code, runs read-only checks and comes back with a plan, open decisions and risks. Only after I approve the plan does it write code.</li><li><strong>Real checks, real numbers.</strong> Every delivery ends with typecheck, lint and tests, and the agent reports the actual result. A check that didn’t run doesn’t count as passed.</li><li><strong>Stop and ask on the things that matter.</strong> If a change would alter which clients receive a regulation, create alerts, touch stored data or reinterpret a rule, the agent stops and comments on the issue instead of deciding.</li><li><strong>Two failures, then stop.</strong> If the agent fails twice at the same blocker, it stops and explains the likely cause and what it tried, instead of looping.</li><li><strong>Small batches.</strong> At most five bot issues per run, two active worktrees. The limit isn’t the AI’s capacity; it’s how much I can review well.</li></ul><p>What I’d do differently: I’d write the CLAUDE.md rules on day one instead of adding them after each mistake. Every rule in mine started as an incident.</p><h3>Closing</h3><p>This setup doesn’t replace an engineering team, and it isn’t meant to. It replaces the parts of the job that are pure overhead for any engineering team: reading every regulator’s site, writing tickets, switching branches, checking whether CI passed. That leaves my time for the parts that need judgement: deciding what to build and reviewing what gets built.</p><p>If you want to try it, start small: one Linear team with a Triage state, Claude Code with the Linear MCP and a short CLAUDE.md, and one Slack channel. Add the watcher bot and the worktrees once the basic loop feels natural.</p><p>I’d love to hear how others are wiring agents into their workflow, especially in regulated domains. Drop a comment.</p><p>If you’re curious about the product itself, you can see what RegWatch does at <a href="https://regwatch.boyscout.dev/">regwatch.boyscout.dev</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b65a2b542ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hybrid Retrieval in Production: When BM25 Beats Your Vector Store]]></title>
            <link>https://medium.com/@emanueljimenez/hybrid-retrieval-in-production-when-bm25-beats-your-vector-store-9edfea683386?source=rss-82dc5bf64129------2</link>
            <guid isPermaLink="false">https://medium.com/p/9edfea683386</guid>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <dc:creator><![CDATA[Emanuel Jimenez]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 20:45:43 GMT</pubDate>
            <atom:updated>2026-08-01T20:45:43.295Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two scoring functions with different biases, one honest look at how to combine them — and why the fusion formula is the easy part.</em></p><p>When I started building RAG systems, I believed the marketing: embeddings and vector search were the <em>modern</em> way to find things, and keyword search was a relic. Then I put a system in front of real users and real documents, and my “modern” vector store confidently failed on the simplest queries — the ones a plain keyword index would have nailed on the first try.</p><p>That experience taught me the thesis of this article, and it’s more modest than the usual “vectors are magic” pitch: <strong>BM25 and embeddings are two scoring functions with different biases. Hybrid retrieval exploits that complementarity — but whether it actually works for you depends far more on engineering decisions (chunking, your embedding model, analyzers, and above all evaluation) than on the fusion formula everyone fixates on.</strong> Hybrid helps. It is not a silver bullet.</p><p>Let’s build up to that carefully, because the details are where retrieval systems are won and lost.</p><h3>Two ways to find a document — and what they actually are</h3><p>Every retrieval system answers the same question: <em>given a user’s query, which documents are most relevant?</em> There are two classic families of answers, and it’s worth being precise about them, because the popular one-liners (“keywords vs meaning”) hide the parts that matter.</p><p><strong>Keyword search (BM25).</strong> This powers Elasticsearch, OpenSearch, and the full-text side of Azure AI Search. The cartoon version is “it counts words,” but BM25 is more than that: it normalizes for document length, saturates term frequency so the tenth occurrence of a word matters less than the second, and weights rare words more than common ones — all governed by tunable parameters (k1, b). More importantly, its quality depends heavily on the <strong>analyzer</strong>: tokenization, stemming and lemmatization, stop-word handling, n-grams, and per-field or metadata boosting. A poorly configured BM25 index and a well-configured one are not the same tool.</p><p><strong>Vector search (embeddings).</strong> You convert the query and every document chunk into a vector that captures meaning, then retrieve the chunks whose vectors sit closest to the query’s. The cartoon version is “it understands meaning,” but that understanding is only as good as several choices you rarely see discussed: the <strong>embedding model</strong> (its domain, language, and granularity), your <strong>chunking strategy</strong> (size, overlap, whether chunks respect document structure, what metadata rides along), the <strong>similarity metric</strong> (cosine, dot product, L2) and whether vectors are normalized, and your pre-processing. Change the chunker and the “meaning” your system retrieves changes with it.</p><p>So the honest framing isn’t “exact tokens vs meaning.” It’s two scoring functions that are <em>biased in different directions</em> — and each one carries a stack of engineering decisions underneath it.</p><h3>When BM25 tends to win</h3><p>With that caveat in place, the biases are real and predictable. Keyword search tends to win when the <em>exact token</em> carries the intent:</p><ul><li><strong>Codes, IDs, and SKUs.</strong> A query for ERR-4021 or Form 13F needs that exact string. Embeddings blur these into a neighborhood of &quot;similar-looking codes,&quot; and you can get ERR-4022 ranked first.</li><li><strong>Names and acronyms.</strong> “HIPAA,” a specific product name, a person’s surname. BM25 finds the literal match; a vector model may decide “HIPAA” is near “GDPR” because both are privacy regulations — related, but not what the user asked for.</li><li><strong>Rare, domain-specific terms.</strong> BM25 weights rare terms heavily by design, so an unusual drug name or a clause number lights up the exactly-right document.</li><li><strong>Short, literal queries.</strong> “reset password,” “refund policy.” There is nothing to interpret; the words <em>are</em> the intent.</li></ul><h3>When vector search tends to win</h3><p>Flip the bias. Vectors tend to win when the words differ but the meaning is the same:</p><ul><li><strong>Paraphrases and synonyms.</strong> “My laptop won’t turn on” matching a doc about “device fails to boot” — zero shared keywords, identical intent.</li><li><strong>Natural-language questions.</strong> “How do I get my money back?” against a policy that says “refunds are processed within 5 business days.”</li><li><strong>Concept-level matches.</strong> “Ways to reduce cloud costs” surfacing an article on “rightsizing compute instances,” which never uses the words “reduce” or “cost.”</li><li><strong>Messy input.</strong> Typos, slang, and cross-language matching degrade BM25 sharply and embeddings far less.</li></ul><h3>The case nobody puts in the diagram: when both fail</h3><p>Here’s the part the tidy “use both” story leaves out. Sometimes <strong>neither</strong> retriever finds the answer, and hybrid doesn’t save you — because the failure isn’t in the scoring function at all.</p><p>Imagine a compliance question: <em>“What’s the retention period for audit logs under our data policy?”</em> The answer exists, but it lives in a 40-page PDF where the retention table is on page 31, split across a page break, and the words “audit log” appear in the <em>heading</em> on page 12 while the actual number sits in a row labeled only “Category C — 7 years.” Your chunker sliced the table away from its heading. BM25 can’t match “audit log” to a chunk that only says “Category C.” The embedding of an orphaned table row is close to nothing meaningful. Both retrievers return confident, wrong neighbors, and fusing two wrong lists gives you a wrong list.</p><p>No value of k, no reranker, and no clever fusion fixes this. The fix is upstream: better chunking that keeps tables with their headings, metadata that tags the retention section, or a document-structure-aware parser. This is the single most important thing to internalize before you tune anything: <strong>in real corpora, retrieval often fails because of chunking, metadata, or corpus quality — not because you picked the wrong retriever.</strong> Hybrid raises your ceiling; it does not fix a broken foundation.</p><h3>Hybrid retrieval: run both, then merge</h3><p>When the failure <em>is</em> about retriever bias — and much of the time it is — the answer is to run both retrievers in parallel and merge their ranked lists. Your real traffic is a mix: some users paste an error code, others ask a full sentence, and you can’t know in advance which is which. Hybrid stops you from betting on one.</p><p><strong>Step 1 — One query, two searches.</strong> The query goes to the keyword index and the vector store at the same time.</p><p><strong>Step 2 — Two ranked lists.</strong> You get two “top-N” lists that overlap sometimes and disagree often.</p><p><strong>Step 3 — Fuse them into one.</strong> You merge the rankings into a single order. This is the step people overthink, so let’s make it concrete — and then immediately complicate it honestly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeZJV5TdIBt7cnevhh_rBA.png" /></figure><h3>Reciprocal Rank Fusion — and its fine print</h3><p>You can’t just add the two scores: BM25 scores are unbounded while cosine similarity sits roughly in [0, 1]. Adding them is comparing apples to kilometers. A common, robust fix is <strong>Reciprocal Rank Fusion (RRF)</strong>, which ignores raw scores and looks only at <em>rank position</em>:</p><pre>score(document) = sum over each list of  1 / (k + rank)</pre><p>rank is the document&#39;s position in a list, and k is a smoothing constant. Azure AI Search implements hybrid ranking with RRF and uses a default k of 60 (<a href="https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking">Microsoft Learn</a>). A document collects one contribution per list it appears in, and the contributions add up; documents ranked near the top of <em>both</em> lists float up.</p><p>Here’s an <strong>illustrative</strong> example — these numbers are hand-built to show the mechanics, not results from a benchmark — for the query <strong>“HIPAA audit logging requirements”</strong> with k = 60:</p><p>DocumentKeyword rankVector rankRRF calculationScore<strong>Doc A</strong> — “HIPAA audit control §164.312”131/(60+1) + 1/(60+3)<strong>0.0323Doc B</strong> — “Logging best practices for compliance”411/(60+4) + 1/(60+1)<strong>0.0320Doc C</strong> — “GDPR data retention policy”2121/(60+2) + 1/(60+12)<strong>0.0300Doc D</strong> — “How to enable audit trails” — 20 + 1/(60+2)<strong>0.0161</strong></p><p>Doc A wins by being strong in both lists; Doc B nearly ties it on vector strength despite a mediocre keyword rank; Doc C had a great keyword rank but the vector side correctly recognized it as off-topic and RRF pushes it down; Doc D, missed entirely by keywords, still makes the cut on vectors alone. That’s the intended behavior: the retrievers vote, and agreement rises.</p><p>Now the fine print RRF tutorials skip:</p><ul><li><strong>Pool size and truncation matter.</strong> Whether you fuse the top 10, 50, or 100 from each retriever changes recall <em>and</em> latency. Fuse too few and you drop good candidates before fusion ever sees them.</li><li><strong>k is not sacred.</strong> A smaller k lets top ranks dominate; a larger one flattens everyone. 60 is a sane default, but in domains with few relevant documents or long tails of near-equivalent candidates, k can meaningfully shift the final order. Tune it against metrics, not vibes.</li><li><strong>RRF is one option, not the law.</strong> Alternatives include normalized score + weighted sum (often as good when your two score distributions are stable), per-retriever weighting (nudge the keyword side up if your users lean on exact codes), and learning-to-rank over features from both retrievers when you have training data.</li><li><strong>Decide where filters live.</strong> Metadata filters (tenant, date, security trimming) usually belong <em>inside</em> each retriever before fusion, not bolted on after — otherwise you fuse candidates you’ll only throw away, wasting pool budget.</li></ul><h3>Reranking: not a footnote</h3><p>RRF gives you a good merged list, but the <em>final</em> ordering that goes into your LLM prompt usually improves with a <strong>cross-encoder reranker</strong> — a model that reads the query and each candidate together instead of comparing pre-computed vectors. Think of hybrid + RRF as <strong>recall</strong> (get the right documents into the room) and reranking as <strong>precision</strong> (put the best one in the front row).</p><p>It is not free, and that’s the point worth making. A cross-encoder adds latency and infrastructure, because it scores every candidate at query time; the cost scales with your pool size. So the practical questions are <em>when</em> and <em>how much</em>: rerank only the fused top-N (say 20–50, not 500), consider a lighter distilled reranker or an LLM-based reranker depending on your latency budget, and reserve heavier reranking for high-value or high-ambiguity queries. And be honest about the flip side — a well-configured hybrid retriever with good chunking sometimes clears your quality bar without a reranker at all. Measure before you add the box. (The reranking layer deserves its own article, and it’ll get one.)</p><h3>How you actually know it’s working: evaluation</h3><p>This is the part that separates “seems to work in the demo” from “holds up in production and under audit,” and it’s where intuition fails hardest. “Test with your own queries” is true but useless without specifics, so here’s the concrete version.</p><p>Build a <strong>gold set</strong>: a few dozen to a few hundred real queries, each labeled with the document(s) that genuinely answer it. Then measure with standard retrieval metrics rather than eyeballing: <strong>Recall@k</strong> (did the right doc make the top <em>k</em>?), <strong>nDCG@10</strong> (are the right docs ranked high, not just present?), and <strong>MRR</strong> (how high is the first correct hit, on average?). Every configuration decision above — the keyword/vector weights, k, the pool size, whether reranking earns its latency — should be chosen by moving these numbers, not by argument.</p><p>Two things people forget. First, retrieval quality is a means, not the end: also measure the <strong>downstream answer quality</strong> the LLM produces from those documents, because better recall that doesn’t change answers isn’t worth latency. Second, when configurations are close, an <strong>A/B test</strong> on real traffic (with a task-success or click signal) beats offline metrics, which can’t see what your users actually needed.</p><h3>Production: latency, cost, and drift</h3><p>A few operational realities the “just run both” advice glosses over. Running two retrievers plus fusion plus an optional reranker <strong>adds latency</strong> — usually fine if the retrievers run in parallel and your pool and reranker candidate count are bounded, but measure it under load, not on a single query. It also <strong>costs more</strong>: you now maintain a keyword index <em>and</em> a vector index, pay to embed every document, and possibly host a reranker. For a small or highly structured corpus, well-tuned BM25 alone may clear your bar, and hybrid is premature. <strong>Caching</strong> helps on all fronts — cache embeddings of unchanged documents, and cache results for hot queries. And retrieval quietly <strong>degrades over time</strong>: the corpus grows, query patterns drift, and a new embedding model version can shift everything. Log queries and their retrieval metrics, and alert when recall on your gold set drops — otherwise the first person to notice will be a user or an auditor.</p><h3>When you might not need hybrid at all</h3><p>To keep the earlier promise of nuance: plenty of good systems don’t start hybrid. A reasonable path is to ship well-configured BM25 first, watch where it fails systematically, and add vectors specifically to cover those failures — rather than standing up two indexes and a reranker on day one because a blog post said “always.” Hybrid is the answer to <em>observed</em> retriever-bias failures, not a default you owe every project.</p><h3>Takeaways</h3><ul><li><strong>BM25 and embeddings are two biased scoring functions, not old vs new.</strong> Each one hides real engineering choices (analyzers and tuning for BM25; chunking, model, and metric for vectors).</li><li><strong>BM25 leans toward exact tokens; vectors lean toward meaning</strong> — and sometimes both fail, because the real problem is chunking, metadata, or corpus quality, which no fusion fixes.</li><li><strong>Hybrid + RRF is a strong, simple default</strong>, but pool size, k, filter placement, and the choice of fusion method all matter, and alternatives to RRF exist.</li><li><strong>Reranking buys precision at a latency cost</strong> — add it deliberately and measure whether it earns its place.</li><li><strong>Evaluation is the real work.</strong> A gold query set and metrics like Recall@k, nDCG@10, and MRR — plus downstream answer quality — are how you tune anything and how the system survives an audit.</li></ul><p>The “boring” keyword index you were ready to retire is often the thing standing between your users and a wrong answer — but the magic was never the fusion formula. It’s the chunking, the metadata, and the measurement underneath it.</p><p><em>First in a series on retrieval systems that hold up in production and under audit. Next: the reranking layer nobody talks about — cross-encoders, cost, and when to skip it.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9edfea683386" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>