liveBook · Manning

Pipeline

As explained in AI-Powered Search

A pipeline is an ordered sequence of processing stages in which each stage transforms or passes information to the next stage.

A search pipeline is a sequence of processing stages that prepares documents or interprets queries before results reach a user. Keeping stages modular makes it easier to add, reorder, or replace parsing, models, and ranking logic as search needs change. section 1.3.7 section 7.1

A semantic query pipeline commonly has four phases:

  • Parse the query to identify entities and their relationships. section 7.4
  • Enrich it with context, such as learned relationships, alternative spellings, or signals about popular results. section 7.4 section 7.5
  • Transform it into a query suited to the target search engine, then search and return ranked results. section 7.4

The phases need not run just once in a straight line: a pipeline can repeat stages, skip them, run conditional searches, or merge results. A keyword-based fallback provides a match path when more specialized models cannot interpret a query. Models must be placed in an appropriate order rather than treated as interchangeable additions. section 7.0 section 7.1 section 7.4

From words to restaurant results

A query such as “top kimchi near charlotte” can fail as a literal search when no document contains every keyword. Semantic parsing and enrichment instead produce results in Charlotte with top ratings, including relevant Korean restaurants whose reviews do not contain “kimchi.” The pipeline turns words such as “top” and “near” into useful search constraints rather than requiring them to match as ordinary keywords. section 7.3 section 7.5

Pipelines also operate before query time: document stages can normalize fields, extract entities, or add embeddings, while scheduled jobs learn from content and user signals. Query-time stages can then use that prepared information without making every request wait for the learning jobs. section 1.3.7

The word also names a specific Transformers API. In Python, `pipeline("question-answering", model=model_name, tokenizer=model_name, device=device)` packages a pretrained model for question-and-context inputs. Its generated answers are guesses until reviewed; this tool is distinct from the broader, modular search workflow. section 14.2.2

Figure 7.7 Semantic search example returns relevant results by better interpreting and executing the query
figure

Compare the semantic-search results with the zero-result lexical search to see the practical effect of query interpretation. section 7.3

How AI-Powered Search covers it

How deep it goes
Defines four query phases and explains modular stages and fallbacks; illustrates executable code only for a separate Transformers pipeline.
Examples
Contrasts zero-result lexical search with interpreted restaurant results and traces another query through entity extraction and signals boosting.
What it assumes
Introduces the four phases after standalone techniques including misspelling detection, synonym discovery, and query intent classification.
What you can do after
Build it from scratch as a four-phase semantic query workflow with replaceable stages and a keyword fallback.
How it connects
Connects semantic search with entity extraction, knowledge graphs, signals boosting, keyword fallbacks, and ranking models.

Also explained in

Compare how 48 books explain pipeline →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.