Deep Search Architecture and Engineering Practices: A Complete Guide

    This article breaks down the technical architecture and engineering practices behind deep search, covering how it evolves from keyword matching to verifiable problem solving. It outlines a six-layer reference architecture, key implementation details for query understanding, hybrid retrieval, reranking, iterative retrieval loops, and citation alignment, plus guidance on balancing quality, cost, and latency, common anti-patterns, and evaluation practices.

    1. From Keyword Matching to Deep Search: The Logic of Technical Evolution

    The core paradigm of traditional search is “query -> inverted index -> ranking -> list of links.” It is deterministic, low-latency, and cost-controlled, but it offers limited support for complex intent, multiple constraints, and cross-document reasoning. Deep search is not simply placing a generative model in front of search. It upgrades search from “information retrieval” to “problem solving”: the system must first understand the real intent and constraints of a question, break it down into several searchable sub-questions, run multiple rounds of retrieval and cross-validation around those sub-questions, and finally aggregate, align, and structure the evidence.

    From an engineering perspective, this evolution brings three changes. First, retrieval shifts from a single pass to multiple rounds, making the pipeline longer. Second, ranking shifts from a single relevance objective to multiple objectives: relevance, credibility, freshness, and coverage. Third, output shifts from a list of links to a structured answer with an evidence chain. Together, these changes move the design focus from index construction to orchestration, scheduling, and quality control.

    A deployable deep search system typically has six layers:

    1. Access and governance layer: authentication, quotas, auditing, canary releases, and rate limiting.
    2. Query understanding layer: intent recognition, entity and constraint extraction, ambiguity resolution, and query rewriting.
    3. Planning and orchestration layer: task decomposition, retrieval strategy selection, loop termination conditions, and budget control.
    4. Retrieval layer: hybrid execution of keyword inverted retrieval, vector semantic retrieval, and structured data queries.
    5. Evidence processing layer: chunking, reranking, redundancy removal, conflict detection, evidence scoring, and aggregation.
    6. Generation and presentation layer: answer synthesis, citation alignment, structured cards, and observability instrumentation.

    The orchestration layer is what sets deep search apart from ordinary retrieval-augmented generation. It decides “whether to keep retrieving,” “what to retrieve next,” and “when to stop,” directly affecting answer completeness and resource consumption.

    3. Engineering Essentials of Key Modules

    3.1 Query Understanding and Rewriting

    Complex questions often contain multiple constraints and implicit premises. A practical approach is to first classify intent (factual, comparative, procedural, time-sensitive), then extract entities, time ranges, geographic ranges, and numeric constraints, and finally generate multiple rewrite variants to cover different phrasing habits. Illustrative pseudocode:

    1. def analyze(query):
    2. intent = classify_intent(query) # fact / compare / howto / time_sensitive
    3. entities = extract_entities(query)
    4. constraints = extract_constraints(query) # time, region, numeric ranges
    5. variants = rewrite(query, intent, entities, constraints)
    6. return intent, entities, constraints, variants

    The key point is that rewriting must preserve constraints rather than loosening them to boost recall. For time-sensitive questions, time filters must be passed explicitly.

    3.2 Hybrid Retrieval and Semantic Indexing

    A single retrieval method struggles to balance precision and generalization. In practice, three paths run in parallel: inverted keyword retrieval ensures precision for terminology and identifier-style queries; vector retrieval handles synonyms and colloquial expressions; structured queries serve strongly structured scenarios such as leaderboards and parameter comparisons. On the indexing side, parent-child chunking is recommended for long documents (small chunks for matching, large chunks for context), along with metadata such as source, time, and permission tags to support later filtering and auditing.

    3.3 Reranking and Evidence Scoring

    Initial recall is usually broad, so reranking is needed to push fragments that can actually answer the question to the top. In practice, a weighted score combining semantic similarity, keyword coverage, source credibility, and freshness works well, with suppression of duplicate content from the same source. Evidence scoring should output explainable components to make debugging easier:

    1. score = 0.45*semantic + 0.25*lexical + 0.20*authority + 0.10*freshness

    3.4 Multi-Round Iteration and Termination Conditions

    Deep search commonly follows a loop of “retrieve -> read -> spot gaps -> retrieve again.” Hard constraints are mandatory, otherwise cost and latency become uncontrollable: maximum rounds, maximum retrieved items, per-round timeout, and total budget. Soft termination should also be set, for example stopping when the marginal evidence gain over two consecutive rounds falls below a threshold. In engineering terms, an “evidence coverage matrix” (sub-questions x evidence) serves as the state machine, where uncovered sub-questions drive the next round of query generation.

    3.5 Answer Synthesis and Citation Alignment

    The generation stage requires “evidence first, conclusions second,” with each key claim bound to at least one evidence fragment and a unified citation ID. When evidence conflicts, showing the disagreement is preferable to forcing a merge. Structured output is easier for downstream consumption:

    1. {
    2. "answer": "...",
    3. "citations": [{"id": 1, "source": "doc", "published_at": "2025-05-01"}],
    4. "gaps": ["Missing 2026 data"],
    5. "confidence": 0.72
    6. }

    4. Balancing Quality, Cost, and Latency

    Resource governance is the most overlooked aspect of deep search. Recommended practices: tier indexes and caches, and cache hot query results with a short TTL; use lightweight models for rewriting and classification that small models can handle, and reserve stronger models for evidence synthesis; parallelize retrieval and generation, and batch reranking; for long contexts, “compress first, then generate,” using extractive summarization to reduce input size. For observability, instrument at least: per-stage latency, recall counts, reranking gains, round distribution, citation coverage, no-answer rate, and user feedback.

    The evaluation system should have three layers: retrieval (hit rate, coverage), evidence (citation accuracy, conflict detection rate), and answer (factual consistency, completeness, readability). Build a question set with reference answers, and retain “no answer / insufficient information” samples to suppress hallucination.

    5. Common Anti-Patterns and How to Avoid Them

    The first is infinite retrieval loops with no budget or gain checks. The second is constraint loss during rewriting, which leads to off-target answers. The third is relying only on vector recall, which lacks precision for terminology and identifier queries. The fourth is misaligned citations and claims, leaving users unable to verify. The fifth is ignoring permissions and compliance, causing cross-tenant data leakage. The way to avoid these is to make constraint, budget, citation, and permission checks mandatory gates in the pipeline rather than after-the-fact fixes.

    6. Conclusion

    The essence of deep search is “verifiable problem solving.” Developers should place complexity in orchestration and evidence governance: use hybrid retrieval to ensure recall, reranking and evidence scoring to ensure quality, budgets and termination conditions to control cost, and citation alignment plus an evaluation system to ensure trustworthiness. Built on general-purpose capabilities from Baidu AI Cloud such as container platforms, object storage, message queues, log services, and monitoring and alerting, teams can quickly stand up a deep search service with elasticity and observability, and keep iterating under real traffic.