agentskit.js
Data layerRAG

Hybrid search

Vector + BM25 blend with weighted normalization.

import { createHybridRetriever } from '@agentskit/rag'

const retriever = createHybridRetriever({
  vector: rag,
  lexical: bm25Index,
  weights: { vector: 0.7, lexical: 0.3 },
})

When to use

Queries with rare keywords or exact tokens (error codes, SKUs, identifiers) that vector alone misses.

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page