---
title: "What is hybrid retrieval?"
description: "Hybrid retrieval combines semantic similarity with exact keyword and identifier matching so queries match both meaning and exact ids."
canonical: https://past.dev/glossary/hybrid-retrieval
last-updated: 2026-09-02
---
# Hybrid retrieval

Source: https://past.dev/glossary/hybrid-retrieval

Hybrid retrieval combines semantic similarity search with keyword or structured filters, so a query can match meaning and exact identifiers at once. Embedding search finds paraphrases and related concepts but treats an invoice number as ordinary text. Keyword and field search find exact strings but miss rewordings. Combining them, with results merged and reranked, covers both: the query about invoice INV-2041 matches the exact id and the surrounding discussion.

## How hybrid retrieval works

Hybrid retrieval runs two searches on the same query and merges the results:

1. **Semantic search** embeds the query and finds records whose meaning is close, catching paraphrases and related discussion.
2. **Lexical and field search** matches exact strings and structured fields: identifiers, names, dates, tags.
3. The two ranked lists are merged by rank fusion and reranked, so a record found by both rises to the top.
4. Structured filters then constrain the merged set: a time range, a resolved entity, an audience scope.

## Where pure vector search fails

A finance agent is asked to find the discussion of invoice INV-2041. Embeddings compress text into meaning, and invoice ids barely differ in meaning: INV-2038 and INV-2044 produce vectors nearly identical to INV-2041. Pure vector search returns invoice discussions in general, and the one record that matters may rank anywhere. The exact id is the entire point of the query, and similarity search treats it as an ordinary token.

Lexical match finds the literal string INV-2041 immediately. Semantic search still earns its place: the thread that matters may call it the April invoice and never repeat the number. Hybrid retrieval returns the exact match first and the related discussion behind it.

| Query | What must match | Search mode that finds it |
| --- | --- | --- |
| invoice INV-2041 discussion | the literal id INV-2041 | lexical match |
| why was the April invoice disputed | paraphrases of the dispute | semantic search |
| invoices disputed since March 12 | a date-bounded set | structured filter |

## Why it matters for AI agents

Agent queries mix meaning with identifiers constantly: ticket numbers, order ids, email addresses, file names, person names. A memory that retrieves only by similarity returns related material and misses the record the identifier names, which lowers [recall precision](/glossary/recall-precision) on the queries the agent states most precisely. Memory systems add two filters beyond generic search: time, so a query can target what was true on a date ([point-in-time recall](/glossary/point-in-time-recall)), and identity, so records about one subject stay together ([entity resolution](/glossary/entity-resolution)).

Retrieval strategies are compared on the same question sets; the [benchmark methodology](/benchmarks/methodology) describes the setup.

## Related concepts

- **[Vector memory](/glossary/vector-memory)**: the similarity-only baseline hybrid retrieval extends.
- **[Recall](/glossary/recall)**: the memory operation hybrid retrieval serves.
- **[Recall precision](/glossary/recall-precision)**: the measure exact matching improves most.
- **[Entity resolution](/glossary/entity-resolution)**: the identity filter applied on top of the merged results.

## Frequently asked questions

### What is hybrid retrieval in RAG?

Hybrid retrieval runs semantic vector search and keyword search on the same query, then merges the ranked results. It catches both rewordings and exact strings such as ids, codes, and names.

### Why does vector search miss exact identifiers?

Embeddings compress text into meaning, and two invoice numbers differ by characters rather than meaning. Nearby ids produce nearly identical vectors, so the exact one does not reliably rank first.

### Do AI agents need hybrid retrieval?

Agent queries routinely contain exact identifiers: ticket numbers, invoice ids, email addresses, dates. A memory that matches only by similarity will retrieve related material and miss the record the identifier names.

## Related

- [Vector memory](https://past.dev/glossary/vector-memory)
- [Recall](https://past.dev/glossary/recall)
- [Recall precision](https://past.dev/glossary/recall-precision)
- [Vector database vs memory](https://past.dev/vector-database-vs-memory)
- [Memory API quickstart](https://past.dev/docs/memory-api/quickstart)