Web apps built to scale Since 2015
2MUCHCOFFEE Get a quote
AI development

Reciprocal Rank Fusion in Production: Inside Our Hybrid RAG on Qdrant

Our matching agent answered developer briefs with confident, well-rounded, wrong shortlists, so we rebuilt the search under it. Reciprocal rank fusion explained with the formula, a worked score table, a playground you can tune, and the exact Qdrant query we run.

A late-night engineering desk with source folders, a compact server node, and a softly glowing retrieval wall, representing hybrid RAG in production.
The agent took the blame; the search underneath it was the problem.

Everyone declared this the era of agents, and for once the hype has a real engine under it. We run one in production. A developer brief comes in; the agent reads it and answers with the profiles in its index that fit the work, under real constraints: stack, seniority, domain. Every shortlist it returns rests on one step this article now takes apart: reciprocal rank fusion, the merge inside its hybrid search.

Matching is exactly the kind of job you hand an agent: hard conditions, expensive in human hours, and visible to a client when it is wrong. The first version used plain vector search. It was fluent, fast, and confidently wrong. Ask it for a React Native engineer who had shipped a payments flow, and it returned strong, well-rounded generalists while burying the person whose history literally said React Native and Stripe. The meaning was close. The exact words that mattered got averaged into a smooth blur.

What we rebuilt it as was hybrid search: a dense search for meaning and a sparse search for exact terms, merged by RRF. That merge is where this article now spends most of its time, because the first version of this article got the merge wrong too. We wrote that our sparse weight of 2.0 doubled the exact-term vote. Qdrant's formula divides the rank by the weight, and at k = 60 that halves the gap between the sparse list's top ranks instead of doubling its vote. The worked table below shows the arithmetic to five decimals.

An agent is only as smart as its search, and the search is the part of RAG that vendor demos skip. It is where our first version failed.

The embedding model is the easy part. What breaks in production is everything around it.

Here is the path from plain vectors to hybrid search, told through the system we actually run, with the reasoning behind each piece, the formula, a worked score table, and a fusion playground in the middle you can tune yourself. If you already run dense plus sparse and came for the merge, skip ahead to the section on the formula.

What RAG actually fixes

A language model is good at phrasing and bad at knowing your private facts. It has no access to the profiles in our index until we hand them over. Ask it something outside its training and it produces a confident, plausible answer that happens to be invented.

RAG, retrieval-augmented generation, turns a closed-book exam into an open-book one. Before the model answers, you search your own data for the passages that matter and hand them over with the question. The model stops guessing and starts summarizing facts you retrieved. The quality of the answer is now capped by the quality of the search, not the size of the model. That is the whole reason retrieval deserves real engineering attention instead of a library call you paste once and forget.

How vectors find meaning

To search by meaning instead of exact words, you turn text into a dense vector, a long list of numbers that encodes what a passage is about. Similar meanings land near each other in that space. A query becomes a vector too, and the search is simply this: find the stored vectors nearest to this one.

The naive way to do that is to compare the query against every record. With a few hundred rows that is fine. With millions it is a linear scan that pins a CPU and blows your latency budget. So a vector database builds an index that avoids looking at almost everything.

The idea behind that index is older than vector search. In the late 1960s the psychologist Stanley Milgram mailed folders to volunteers in Nebraska and asked each one to send the folder on to a personal acquaintance more likely than they were to know a stranger, a stockbroker who worked in Boston. The folders that made it took about six hops. Nobody held a map of the whole country. Each person made one good local decision and passed it on. That is the small-world effect, the same intuition behind six degrees of separation, and it is almost exactly how a modern vector index finds a neighbor.

HNSW, Hierarchical Navigable Small World, the graph index Malkov and Yashunin described, is a stack of those small-world graphs. The clean way to picture it is layers of roads. The top layer has a few long-distance routes that cross the whole map in one hop. The middle layer adds regional connections. The bottom layer is every local street, where the records actually live. A search starts at the top, takes a couple of long hops to reach the right region, drops a layer, refines, drops again, and arrives at the right neighborhood in a few dozen steps instead of millions of comparisons. Like Milgram's folders, each step moves to a closer neighbor, and the whole map stays unread.

figure 1 · how HNSW finds a neighbor fast
query enters here match layer 2a few long hops layer 1regional links layer 0every vector lives here
Enter at the sparse top layer, take long hops, drop down and refine. A few dozen steps instead of millions of comparisons.

Qdrant builds and maintains the HNSW graph itself once a segment passes the indexing threshold in its optimizer settings, and below that threshold, where our index sits today, its indexing docs say it scans the vectors exactly, because at that size the scan is faster.

Where pure vector search quietly fails

Dense vectors are good at meaning and bad at exact identifiers. They understand that mobile developer and iOS engineer are related. They are much weaker when the thing that matters is one precise token: a specific framework, a version number, a client name, the exact title of a certificate.

That was our matcher's failure. A request for React Native asks for that exact skill rather than the general vibe of mobile work, and a dense vector blends it into the surrounding meaning until it stops being decisive. The same goes for a brand the client names directly, an error code in a support ticket, or a niche library only one person on the team has touched. The detail that should win the match is exactly the detail dense search smooths away.

Dense vectors match meaning, and the sparse side catches the exact terms a user typed.

Sparse vectors and the return of the exact match

The answer is older than embeddings. It is the inverted index, the structure search engines have used for decades to map each word to the documents that contain it. The classic scoring on top of it is BM25, born in the Okapi search system in the 1990s; the BM is just best matching, formula number twenty-five, and it is still a strong baseline thirty years later. In vector terms that is a sparse vector: mostly zeros, with weight on the specific terms that actually appear.

Modern sparse models are smarter than raw keyword counts. We use SPLADE, which stands for sparse lexical and expansion. It runs the text through a BERT head that does two jobs at once: it weights the words that carry meaning, and it quietly expands them to close relatives, so a passage about a car also lights up vehicle and automobile while the stopwords fade. You get the precision of keyword search without its brittleness. Expansion can connect two spellings of the same skill, which helps when a CV and a brief name it differently.

The expansion is also the honest tradeoff: a learned model can spread weight onto neighbors you never asked for. If your domain punishes any drift at all, serial numbers, legal citations, part codes, plain BM25 is the safer sparse side. For skills and job titles we decided the coverage was worth that risk, and fusing by rank rather than by score keeps a loud expansion from swamping the dense side. Sparse search catches the tokens dense search blurs, which is the half we were missing.

Hybrid search: run both, fuse the rankings

Hybrid search is the obvious move once you can name the two failure modes, and you do not have to take my word for the payoff. Anthropic's contextual retrieval study found that adding a contextual BM25 index to contextual embeddings cut failed retrievals, and that a reranker on top cut them again. The figures and the chunk-context step behind them are in our post on PDF chunking for RAG.

Read that result as the shape of the win rather than a guarantee: on a narrow corpus with one uniform vocabulary, dense search alone often saturates and the sparse side adds little. The win shows up where the vocabulary is wide and the queries hang on exact tokens, which is exactly what job briefs and CVs look like.

So you run the dense search for meaning and the sparse search for exact terms, in parallel, then merge the two ranked lists into one.

The merge is the interesting part, because the two searches produce scores on completely different scales. You cannot just add them. The standard method is reciprocal rank fusion, RRF, which ignores the raw scores and looks only at position: a document near the top of either list scores well, and items that rank well in both rise to the top. The next section takes the formula apart, because two of its details, the constant k and the per-list weight, decide the order the agent sees.

One aside, since people ask. RRF is not the only way to fuse. Qdrant's hybrid-queries docs also offer DBSF, which normalizes the two score distributions instead of throwing the scores away, and its docs call it a reasonable choice when you trust the raw scores to carry magnitude. The same page names the two caveats: the statistics come from each query's small prefetch sample, and one outlying score in that sample can skew the normalization for that query. Qdrant's tuning guide says which of the two wins depends on your data, so run both against your labels. Our query passes RRF, which reads positions only.

Before you tune the fusion, score dense alone, sparse alone and the fused list on the same labelled questions. Qdrant's tuning guide makes that the first step, and the Fusion Tax study gives the reason: fusion pays off when both legs are comparably strong, and it can trail the better single leg when one of them is much weaker. The limits section further down has the detail.

figure 2 · one query, two searches, one ranked answer
the query DENSE · BGE-LARGE finds meaning rank: 1 · 2 · 3 · ... SPARSE · SPLADE++ finds exact terms rank: 1 · 2 · 3 · ... Reciprocal Rank Fusion k = 60 · weights 1.0 / 2.0 one ranked list 1 · 2 · 3 one fused order
Two searches run in parallel. RRF merges the rankings by position; the k and the weights are the ones in our repository, and the next section shows what they do.

Reciprocal rank fusion: the formula, the 60 and the weight

Cormack, Clarke and Büttcher published RRF at SIGIR under a title that is also its finding: reciprocal rank fusion outperforms Condorcet and individual rank learning methods. The formula fits on one line. Each list contributes 1/(k + rank), one over k plus the document's rank in that list, and the document's fused score is the sum. Qdrant implements the same idea with two conventions of its own, so both forms are worth having side by side.

reciprocal rank fusiontwo conventions
# Cormack, Clarke and Büttcher, SIGIR 2009. Ranks start at 1 and the lists carry no weights.
score(d) = sum over lists r of   1 / (k + rank_r(d))            # k = 60 in the paper

# Qdrant, hybrid-queries docs. Ranks start at 0. One weight w_r per list.
# k settable per query since v1.16, weights since v1.17.
score(d) = sum over lists r of   1 / (k + (rank_r(d) + 1) / w_r - 1)

# Qdrant's default k is 2. The paper's k = 60 is k = 61 here.
# Our query passes k = 60, which is the paper's 59.

The 60 is the part everyone copies, and the paper is candid about where it came from. The authors give k one job: it damps the high rankings an outlier system hands out. Without it, a document ranked first by one list alone would score 1, and a document ranked second by both lists would only tie it; at k = 60 the second document wins by nearly two to one.

As for the value, the paper says it plainly: k = 60 "was fixed during a pilot investigation and not altered during subsequent validation", and the pilot "indicated that k = 60 was near-optimal, but that the choice was not critical". Its Table 1 backs that up: mean average precision is flat from about k = 20 to k = 100, and the top value in that table sits at 80, a hair above 60.

Qdrant counts ranks from zero and defaults k to 2, which is the paper's k = 1 and a far steeper weighting toward the top of each list. Its tuning guide maps the conventions explicitly: to reproduce the paper's 1/(rank + 60) you pass k = 61. Our query passes k = 60, so in the paper's terms we run 59, a difference the flat part of Table 1 cannot see.

The guide also puts a number on what k does: at Qdrant's default k = 2, rank 1 carries 5.5 times the score weight of rank 10; at k = 61 it carries 1.15 times, so a candidate's presence in a list matters almost as much as its position.

The guide's order of operations follows from that. Once fusion has earned its place over either search alone, sweep k first, over 1, 2, 5, 20 and 61 with equal weights. Tune the weights last, because a weight pair is only valid for the k it was tested with. Across its public datasets the best k was small where queries had about one relevant document each, and large where they had tens or hundreds.

Now the weight, which is where the first version of this article went wrong. Our query passes weights of 1.0 and 2.0, dense then sparse, and we wrote that the exact-term side therefore got the louder vote.

In Qdrant the weight divides the rank: a sparse result at zero-based position r scores 1/(k + (r + 1)/2 - 1) rather than 1/(k + r), so the top sparse result moves from 1/60 to 1/59.5, the fourth from 1/63 to 1/61, and the gap between first and fourth shrinks from 0.00079 to 0.00041. Every sparse result gains a little. At k = 60 a weight of 2.0 halves the sparse list's say in the order near the top of the list and raises its say in presence, most for the lower ranks, and candidates that both lists return are settled mostly by the dense list.

At k = 2 the same weight comes much closer to what the old sentence claimed, lifting the top sparse result by a third and lower ranks by more, because at a small k the rank term dominates the constant. The table shows both.

worked scores · five illustrative candidatesformula arithmetic on invented ranks
CandidateDense rankSparse rank2009 paper, k = 60, 1-based ranksQdrant k = 60, equal weightsQdrant k = 60, weights 1.0 / 2.0 (our query)Qdrant k = 2, weights 1.0 / 2.0
Senior generalist140.03202 tie0.03254 tie0.033060.83333
React Native + Stripe410.03202 tie0.03254 tie0.032680.86667
Mobile engineer330.031750.032260.032660.65000
Full-stack lead250.031510.032020.032650.61905
Payments engineer520.031510.032020.032290.66667
Every score here is formula arithmetic on the playground's invented ranks, shown to five decimals. The first score column is the 2009 paper's formula with 1-based ranks, which equals Qdrant at k = 61 with equal weights. The second is Qdrant at the k our query passes, 60, which is the paper's 59. The third is the exact call in our repository. The fourth keeps those weights and drops k to Qdrant's default.

Read across the column with our query's settings and the first two rows. The senior generalist, dense first and sparse fourth, finishes a few ten-thousandths ahead of the exact match, dense fourth and sparse first; drop k to Qdrant's default of 2 with the same weights and the exact match wins by a clear margin. Only k changed between those two columns, which is the arithmetic behind the guide's order of operations: settle k, then weights.

You can feel the effect yourself. Below is an illustrative five-candidate version of that React Native and Stripe brief. The ranks are invented to show the arithmetic, so test the call on your own data before trusting any of it. Dense search ranks the smooth generalists first, while the sparse list puts the exact match on top. Pick a k, drag the weight, and watch where the fused result lands. The formula under it is Qdrant's, and the default state is the call in our repository.

interactive · tune the fusion, Qdrant's formulak = 60

Dense ranking (meaning)

1Senior generalist
2Full-stack lead
3Mobile engineer
4React Native + Stripeexact match
5Payments engineer

Sparse ranking (exact terms)

1React Native + Stripeexact match
2Payments engineer
3Mobile engineer
4Senior generalist
5Full-stack lead

Fused result · RRF, Qdrant's formula

1Senior generalist0.03306
2React Native + Stripeexact match0.03268
3Mobile engineer0.03266
4Full-stack lead0.03265
5Payments engineer0.03229
At k = 60 and sparse weight 2.0, Qdrant's formula puts Senior generalist first at 0.03306, 0.00038 ahead of React Native + Stripe. The dense list carried it, with the exact match at #2. At k = 2 with the same weight, React Native + Stripe would be first.

The first version ran dense-only retrieval; we rebuilt it as hybrid search. Whether a retrieval change makes the shortlist better is its own discipline, and how to evaluate RAG against a golden set is where that question goes.

Where RRF stops helping

The first limit is the one the table just showed: in Qdrant a weight divides the rank, so at a large k a heavier weight flattens that list's order instead of amplifying it.

The second is that RRF throws the scores away, which is its strength and its cost. Bruch, Gai and Ingber found RRF sensitive to its parameters and a tuned convex combination of the scores ahead of it, in domain and out; on MS MARCO with a small MiniLM model on the dense side, RRF even scored below dense alone. Two of them were at Pinecone when they wrote it, a vendor whose single-index hybrid search weights dense against sparse with a client-side alpha.

Third, fusion pays most when the two lists are of comparable strength and can lose when one is clearly stronger. Qdrant's tuning guide saw fusion beat the better single retriever on four of its five public datasets and trail dense alone on DBPedia-entity, by a gap inside the guide's own confidence interval.

The Fusion Tax, an independent study by Chauhan and Agarwal published in October over seven BEIR datasets, measures it per query: even the best method they tested, dense-weighted score interpolation, ranked relevant documents below the better of its two components on a real share of queries in every dataset, and RRF paid the higher tax wherever the dense retriever was clearly stronger.

Fourth, disjoint lists tie: at equal weights, two lists with no document in common fuse into pairs, rank one of each, then rank two of each, and the agreement signal RRF is built for never fires.

Fifth, prefetch depth caps what can be fused. Our query fetches twice the final limit from each branch, between 10 and 100, and a document outside both prefetches cannot appear in the result however well it would have scored.

Why Qdrant, and when it is the wrong call

We ended up on Qdrant because of what hybrid search needs in production, and the long version of the comparison, with Pinecone and Weaviate weighed too, is our vector database comparison. The short version is three things.

Hybrid lives in one place. A single Qdrant collection holds the dense vector, which gets an HNSW graph once the data outgrows Qdrant's indexing threshold, and the sparse vector, through an inverted index, and fuses them in one query: one collection, one call, fusion on the server.

Filtering is built into the search. Our matcher can filter by section type and by person, with a payload index on each field, so the filter rides inside both prefetch branches rather than running over the page afterwards. Filters are hard for a graph index: a selective one can strand the greedy walk in a pocket where every neighbor is excluded, and post-filtering throws away most of the page you paid for. Qdrant applies the filter while it walks the graph and, since version 1.16, offers an opt-in per-query mode called ACORN that hops through excluded nodes to their still-valid neighbors. For a system whose whole job is search plus conditions, that design carried the decision.

It stays out of the way: one service, written in Rust, with quantization on tap for the day the vectors outgrow memory. We run Qdrant's index and quantization defaults at our size.

If you already run Postgres, sit under a few million vectors and need transactional consistency between relational rows and vectors in one query, pgvector is the pragmatic choice and one fewer system to operate; the pgvectorscale extension carries Postgres into the tens of millions of vectors, and its vendor, Tiger Data (formerly Timescale), publishes benchmarks at that scale.

Alex Tkachenko, a full-stack engineer on our team, keeps a public side project on exactly that path, a movie recommender, fastapi-movies on his GitHub, where each film carries a 768-dimensional embedding as an ordinary column and a user's taste is the SQL average of the embeddings in their catalog. On our own team the rule split both ways: hybrid retrieval under hard filters went to Qdrant, and the recommender that lives next to its relational data stayed in Postgres.

The repository is public and readable at github.com/2mc-org/cv-matcher-api, and the hybrid search this article describes is one file, app/cv/services/cv_qdrant_repository.py. The collection holds a named dense vector from BAAI/bge-large-en-v1.5 at cosine distance and a named sparse vector from prithivida/Splade_PP_en_v1, and the repo pins Qdrant v1.18.0 in its compose file. The query issues two prefetch branches with the same filter, each fetching twice the final limit, between 10 and 100, and fuses them in one call. Here it is, quoted from the repository with the leading indentation trimmed and one commented-out line removed; that line was the plain FusionQuery form, which would run Qdrant's default k = 2 with equal weights.

app/cv/services/cv_qdrant_repository.py · search()2mc-org/cv-matcher-api
query_filter = self._build_search_filter(chunk_types, profile_id)
prefetch_limit = min(max(limit * 2, 10), 100)
response = self._client.query_points(
    collection_name=self._collection_name,
    prefetch=[
        Prefetch(
            query=list(dense_vector),
            using=DENSE_VECTOR_NAME,
            filter=query_filter,
            limit=prefetch_limit,
        ),
        Prefetch(
            query=sparse_vector,
            using=SPARSE_VECTOR_NAME,
            filter=query_filter,
            limit=prefetch_limit,
        ),
    ],
    query=RrfQuery(
        rrf=Rrf(
            k=60,
            weights=[1.0, 2.0],  # dense, sparse
        )
    ),
    limit=limit,
    with_payload=True,
)
return list(response.points)

The interesting work was deciding what the retrieval had to do; the code is about forty lines.

And it runs. A live version sits at cv-matcher.2muchcoffee.com. Given a role in plain language, it answers with a ranked shortlist, each match backed by the profile lines that earned it; when the request is too vague to search, it says what it is missing instead of inventing an answer. The hybrid retrieval in this article is the layer under that conversation.

The chunking is the same kind of boring on purpose. A CV is a small database wearing a document costume: a title, a skill list, a dated job history, certificates. So we cut along the structure rather than by token count or semantic drift: one point per section, one per job, one per certificate. Run a generic semantic chunker over a CV and it reads the jump between two jobs as a topic change and slices the timeline into confetti. The structure was already the chunking; we respected it. Documents that arrive as scanned PDFs are the harder version of the same problem, and our post on RAG over messy PDFs goes through that one.

What this looks like in production

Retrieval sits inside a larger pipeline. The ranked list of people feeds the rest of the agent, orchestrated with LangGraph, which drafts a first-pass response, with durable state in Postgres so a long run survives a restart. The agent is only as good as what retrieval hands it. Give it the well-rounded wrong people and it writes a confident, wrong draft. Give it the right match and the rest of the system has something true to work with.

LangGraph diagram of the cv-matcher agent: start, an errors guard, resolve phase, summarize messages, classify intent, then a branch to match profiles, follow up, or reject; match and follow-up end in finalize response, reject ends the run.
The agent, drawn straight from the code. The hybrid search in this article is the cv_search tool. Inside match_profiles, a small tool-calling sub-agent may call it more than once with focused queries and is told to rank only from what those searches returned; the follow-up node can call the same tool, scoped to one profile, to look up evidence. The rest is intent routing: run a fresh search, answer a follow-up, or turn away anything that is not one.

Hybrid runs dense and sparse side by side; the second stage would be a reranker, and it is the one we would add next. A cross-encoder, or a late-interaction model like ColBERT, re-reads the query against each top candidate and reorders them, slower but sharper. In Anthropic's study that step cut the remaining failures by about a third. At our index size it is overkill. At tens of thousands of documents it is the first thing I would add.

When that day comes, measure the reranker switched on and switched off, and report recall before and after it, because a general-purpose reranker can order specialized text worse than the list it was handed. The LegalBench-RAG benchmark caught Cohere's general-purpose reranker doing exactly that, and the Drowning in Documents study found rerankers that helped on a short candidate list falling below retrieval alone once they scored a much larger set.

It is tempting to skip all of this and pour everything into one giant context window. The models hold a million tokens now, so why retrieve at all? Because they do not read the middle evenly. Liu and colleagues named it lost in the middle: a fact buried in the center of a long context is far more likely to be ignored than the same fact at the start or the end.

Length alone still hurts newer models. Chroma's Context Rot report, a vendor study across a wide set of models including GPT-4.1, Claude 4 and Gemini 2.5, found performance growing less reliable as input length grows, even on simple tasks. A bigger window gives you a longer place to lose the thing that mattered, so retrieval keeps its job.

That is the lesson under all of this, and it is the one I keep relearning. The embedding model and the agent are the parts everyone talks about. The retrieval architecture, the chunking, the fusion, the filtering, the choice of index, is the part that decides whether the thing works when it is no longer a demo.

More in this series: choosing a vector database for RAG, evaluating RAG with a golden set, RAG over messy PDFs and agentic RAG.

FAQ

What is hybrid search in RAG? Running dense vector search for meaning and sparse search for exact terms in parallel, then merging the two ranked lists into one, usually with reciprocal rank fusion. Anthropic's contextual retrieval study found that adding a contextual BM25 index to contextual embeddings cut failed retrievals, and a reranker on top cut them again; read that as the shape of the win rather than a guarantee.

Where does pure vector search fail? On exact tokens: the specific skill, code, or name a query hangs on. Dense search returns semantic neighbors, which is exactly wrong when only the literal match counts. The gain from adding sparse search shows up where vocabulary is wide and queries depend on exact terms; on a narrow, uniform corpus, dense alone often saturates.

What is reciprocal rank fusion? The standard way to merge two ranked lists whose scores live on different scales. It ignores raw scores and sums, for each document, 1/(k + rank) over the lists, so items ranked well by both searches rise. Cormack, Clarke and Büttcher published it at SIGIR with k = 60; Qdrant defaults to k = 2 with zero-based ranks and lets you set both k and a per-list weight.

Why is k 60 in reciprocal rank fusion? Because the paper that introduced RRF fixed k = 60 during a pilot investigation and kept it, and the pilot found the value near-optimal with the exact choice mattering little. Its results table is flat from about k = 20 to k = 100, with 80 a hair above 60. The paper counts ranks from 1; Qdrant counts from 0 and defaults to 2, so the paper's 60 is Qdrant's 61, and the k = 60 our query passes is the paper's 59.

What is weighted reciprocal rank fusion? A per-list weight on top of RRF. In Qdrant, available since v1.17, the weight divides the rank: a list's contribution is 1/(k + (rank + 1)/w - 1) with zero-based ranks, so at k = 60 a weight of 2 roughly halves the gaps between that list's top ranks. At any k it also lifts each of that list's results: the top one only slightly at k = 60 and by a third at k = 2, and lower ranks by more in both cases. At a large k that compresses the weighted list's say in the order; at a small k it behaves like the louder vote people expect. Qdrant's tuning guide says to settle k before the weights, because a weight pair only holds for the k it was tested with, and equal weights can win.

What is SPLADE? Sparse lexical and expansion: a sparse model that runs text through a BERT head to weight the terms that matter and expand them with related ones, so the exact-match side of search gets smarter than raw keyword counting while keeping the thing that makes it sparse, the ability to hit the literal token.

Do million-token context windows replace retrieval? Retrieval keeps its job, because models read a long context unevenly. Liu and colleagues named the effect lost in the middle: a fact buried in the center of a long context is far more likely to be ignored than the same fact at the start or end. Chroma's Context Rot report, a vendor study, adds that models including GPT-4.1, Claude 4 and Gemini 2.5 grew less reliable as input length grew. A bigger window gives you a longer place to lose the thing that mattered.

What 2muchcoffee covers

Our AI engineering team builds production RAG and AI systems the way we built this one: the unglamorous retrieval layer first, because that is what decides whether the output can be trusted. If you have a RAG prototype that demos well and returns confident, slightly wrong answers, start with the search underneath, ahead of the model. The plain path to talk it through is the AI work we do.

One concrete action

Before you reach for a bigger model, run one test on your own RAG. Pick an exact identifier you know is in your data, a specific framework, a product name, a part number, and search for it. If the passage that contains it does not come back at or near the top, the gap is in the search, and hybrid search, with k settled before the weights, is where to start.

Oleg Logvin Tech Lead at 2muchcoffee
Alex Tkachenko Full-Stack AI & Software Engineer

Read next

Contact our team

Do you have an idea for your next project? Not sure what tech stack or business model to choose? Share your thoughts and our team will assist you in any inquiry.