diagram.mmd — flowchart
AI Search System flowchart diagram

An AI search system combines classical keyword retrieval with dense vector semantic search and LLM-based re-ranking to return highly relevant results for natural language queries — going beyond simple keyword matching to understand user intent.

What the diagram shows

This flowchart maps the hybrid retrieval and ranking architecture used in modern AI search:

1. User query: a natural language search query is submitted. 2. Query understanding: the query is analyzed for intent, entities are extracted, and query expansion (synonyms, related terms) is optionally applied. 3. Parallel retrieval: the query is dispatched simultaneously to two retrieval systems: - Keyword search (BM25/inverted index): fast lexical matching that excels at exact-match recall. - Vector search (ANN): semantic embedding search that handles paraphrases and conceptual similarity (see Vector Database Query). 4. Result fusion: results from both retrieval paths are merged using Reciprocal Rank Fusion (RRF) or a learned fusion model, producing a unified candidate set. 5. LLM re-ranking: a cross-encoder or LLM scores each candidate against the query for relevance. This is more accurate than ANN alone but too slow to run over the full corpus. 6. Diversity filtering: near-duplicate results and results from the same source domain are deduped to improve result diversity. 7. Result assembly: the final ranked list is assembled with snippets, metadata, and relevance scores. 8. Response returned: results are returned to the user interface or downstream application.

Why this matters

Hybrid search consistently outperforms either keyword or vector search alone. The two-stage architecture — fast retrieval followed by accurate re-ranking — balances recall and precision while keeping latency manageable. See AI Ranking Pipeline for how ranking is applied more broadly.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

An AI search system is a retrieval architecture that combines classical keyword search (BM25/inverted index) with dense vector semantic search, fusing the results and applying LLM-based re-ranking to return highly relevant results for natural language queries — going beyond exact-match to understand user intent.
The user query is dispatched in parallel to both a keyword search index (for exact-match recall) and a vector ANN index (for semantic recall). Results from both are merged using Reciprocal Rank Fusion or a learned fusion model, then the merged candidate set is scored by a cross-encoder or LLM re-ranker for precise relevance before the final list is assembled and returned.
Use hybrid search when your queries include specific named entities, product codes, or exact phrases that pure semantic search handles poorly. Vector-only search can miss exact-match results because semantically similar but lexically different content may score higher. Combining both retrieval paths maximizes recall across query types.
Common challenges include calibrating the fusion weights between keyword and vector results (domain-dependent), LLM re-ranking latency on large candidate sets (addressable by limiting re-ranking to top-50 candidates), query understanding failures on short or ambiguous queries, and maintaining index freshness as new documents are ingested.
mermaid
flowchart TD A([User query]) --> B[Query understanding: intent detection and entity extraction] B --> C[Query expansion: synonyms and related terms] C --> D[Parallel retrieval] D --> E[Keyword search: BM25 inverted index] D --> F[Vector search: ANN embedding lookup] E --> G[Keyword candidates with BM25 scores] F --> H[Vector candidates with cosine scores] G --> I[Reciprocal rank fusion: merge candidate lists] H --> I I --> J[LLM or cross-encoder re-ranking on top-N candidates] J --> K[Diversity filtering: deduplicate near-identical results] K --> L[Assemble result list with snippets and metadata] L --> M([Return ranked search results])
Copied to clipboard