Skill AI & LLM →

Hybrid Search Implementation

Combine vector and keyword search for improved retrieval.

Combines vector similarity and keyword (BM25) search into one retrieval pipeline so you catch both semantic matches and exact terms like names, codes, and domain jargon that pure vector search misses. It fuses the two signals with RRF or weighted scoring, optionally reranks with a cross-encoder, and logs every score so recall regressions are debuggable.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category AI & LLM
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, hybrid-search-implementation

Inside the run · no black box

See the actual work before you buy it.

Vectors understand intent but miss product codes; keywords nail exact matches but miss meaning. This pipeline indexes both, fuses the two rankings properly, and keeps every result traceable to its source leg.

  1. Indexes every document twice in the same store: a dense vector embedding under an HNSW index for semantic intent, and a full-text keyword index for exact matches like product codes and names
  2. At query time, over-fetches roughly 3x the requested result count from both legs in parallel, because fusion needs headroom to surface documents one leg missed
  3. Fuses the two ranked lists with Reciprocal Rank Fusion or a min-max-normalized weighted sum; raw scores are never compared directly because BM25 and cosine similarity live on different scales
  4. Optionally cascades into a cross-encoder reranker applied only to the top 20-50 candidates, where the expensive model is affordable and lifts final ordering quality
  5. Attaches three scores to every result (vector, keyword, fused) plus a source tag, so a future recall drop can be traced to the exact failing leg instead of blind debugging
  6. Tunes weights empirically per query type: keyword-heavy queries shift weight toward exact match, natural-language queries shift toward semantic, validated with A/B tests rather than defaults
Use cases · what happens when you plug it in

One power source. 6 lines out.

hybrid-search-implementation · core

core active · 6 lines

  1. Building a RAG system that needs higher recall than vector search alone

    ✓ building a rag system that
  2. Handling queries with exact terms: product codes, names, SKUs

    ✓ handling queries with ex…
  3. Improving search over domain-specific vocabulary and synonyms

    ✓ improving search over do…
  4. Adding cross-encoder reranking on top of a fused candidate set

    ✓ adding cross-encoder rer…
  5. Tuning the vector-versus-keyword balance per query type

    ✓ tuning the vector-versus…
  6. Diagnosing a recall drop by tracing which leg returned each result

    ✓ diagnosing a recall drop
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. Lift recall noticeably by catching what semantic search and keyword search each miss

    license: perpetual
  2. Return relevant results for exact-match queries that pure vector search drops

    license: perpetual
  3. Trade latency for quality deliberately with cascade reranking on only the candidates that need it

    license: perpetual
  4. Debug recall regressions fast because every result carries its vector, keyword, and fused score

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

Reciprocal Rank Fusion and normalized linear-combination fusion implementations

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

ML and backend engineers building RAG systems or search engines where neither vector nor keyword search alone gives sufficient recall.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. We run PostgreSQL, not Elasticsearch. Is that covered?

    Yes. There's a complete PostgreSQL setup combining a pgvector HNSW index with a full-text GIN index and in-query RRF fusion. Elasticsearch 8.x gets its own implementation using script_score and native RRF, so you pick whichever store you already run.

  2. If I use a bigger embedding model, do I still need the keyword leg?

    Yes. Exact terms like product codes, SKUs, and names keep slipping through pure vector search no matter the model size. The BM25 leg catches those, the two signals fuse via RRF or weighted scoring, and every result logs which leg returned it so recall regressions stay debuggable.

  3. Does it tune the vector-versus-keyword weights for my data automatically?

    No. It gives per-query-type balance guidance and warns about common weight-tuning anti-patterns, but the right weights come from testing against your own queries. The score logging makes that testing practical; the decision stays yours.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.