liveBook · Manning

Lexical search

As explained in Agent Design Patterns

Keyword-based search retrieves information by matching query terms against terms in the searchable data.

Lexical search retrieves documents by matching query words against searchable terms. As sparse retrieval, it can represent a query as a weighted keyword vector; BM25 and SPLADE are named examples. section 7.2 section 7.3

It is effective for exact phrases, identifiers, and rare keywords, but does not understand synonyms or a query’s intent. In hybrid retrieval, it complements dense search: lexical matching catches exact terms while semantic search can find conceptually related documents. section 7.3 section 7.4.2

Technical support

A search for “Error Code 0x8004” can retrieve a manual by exact code matching, while dense search can help with a vague description such as “my screen is flickering.” A hybrid system runs both searches, fuses their results with Reciprocal Rank Fusion, then applies a cross-encoder re-ranker. section 7.4.2

How Agent Design Patterns covers it

How deep it goes
Defines sparse retrieval as a weighted keyword vector and explains its strengths and limits, without detailing indexing or scoring internals.
Examples
Uses technical-support searches for error codes and product identifiers alongside vague symptom descriptions.
What you can do after
Apply via BM25 as a sparse search component, combining its results with dense retrieval and re-ranking for technical-support queries.
How it connects
Pairs sparse retrieval with dense retrieval in hybrid retrieval, and connects result fusion to Reciprocal Rank Fusion and cross-encoder re-ranking.

Also explained in

Compare how 14 books explain lexical search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Agent Design Patterns. The section links point to the parts of the book it draws on.