AI Search on Mobile: Technical Architecture and Engineering Practices

    This article explains how mobile AI search is re-architected around retrieval quality, controllable generation, and verifiable citations instead of ranking precision alone. It covers the structural gaps in the traditional query understanding–retrieval–ranking–summary pipeline, the difference between web search as external knowledge injection and deep thinking as added reasoning compute, a routing rule for combining them, a six-layer reference architecture from query to verifiable answer, and the main engineering challenges: streaming latency, context conflicts, citation consistency, and cost control. It also addresses on-device behavior under poor connectivity, full-chain observability metrics, and a two-track evaluation loop in which refusal is treated as a first-class capability.

    1. Why Mobile Search Needs a Structural Rework

    The core pipeline of traditional mobile search is query understanding, retrieval, ranking, and summary presentation, and its optimization targets have long been response latency and click-through rate. Once users shift from expecting “a list of links” to expecting “a verifiable answer,” this pipeline exposes three structural gaps.

    The first is the semantic gap. Short queries carry little context, and literal matching struggles to cover implied intent. The second is that answers are not verifiable. Snippets have no traceable citation back to the source text, so users cannot tell where a conclusion came from. The third is that interaction is broken into steps. Users make multiple round trips and assemble information themselves, which raises cognitive cost.

    What large models change is not “faster ranking” but the merging of retrieval and generation into a single closed loop: the model handles intent clarification and query rewriting, and also organizes the answer on top of retrieved results. The engineering focus therefore moves from ranking precision to the coordination of three things: retrieval quality, generation controllability, and citation verifiability.

    2. Capability Abstraction: What Deep Thinking and Web Search Each Solve

    In general technical terms, these two capabilities can be abstracted as different compute modes.

    Web search is essentially external knowledge injection. Knowledge stored in model parameters is static and has a cutoff, so real-time information must come from retrieval. The engineering implication is that the ceiling on answer quality is set by retrieval quality, not by model size.

    Deep thinking is essentially a larger compute budget at the reasoning stage. For multi-constraint, multi-hop problems, the model must decompose sub-problems first and then verify them step by step, trading more intermediate steps for higher accuracy. The engineering implication is higher latency and cost, which requires differentiated scheduling.

    The combination can be described by a routing rule:

    1. def route(query, ctx):
    2. # Does this need external real-time knowledge?
    3. need_retrieval = ctx.has_time_sensitive or ctx.has_entity_lookup
    4. # Does this need multi-hop reasoning?
    5. need_reasoning = ctx.hop_count > 1 or ctx.constraint_count >= 2
    6. if need_retrieval and need_reasoning:
    7. return "deep_search" # retrieval + deep thinking
    8. if need_retrieval:
    9. return "fast_search" # retrieval augmentation only
    10. if need_reasoning:
    11. return "reason_only" # reasoning only
    12. return "direct_answer"

    The value of this routing is that expensive capabilities are spent on the queries that actually need them, instead of sending every request through the deepest path.

    3. Reference Architecture: Six Layers from Query to Verifiable Answer

    The first layer is query understanding. It performs normalization, correction, intent classification, and query rewriting, expanding colloquial input into several search expressions. The output of this layer is a set of queries, not a single string.

    The second layer is retrieval. It typically queries several index types in parallel: a general web index, structured knowledge entries, and time-sensitive content sources. Results from multiple paths are deduplicated and scored together.

    The third layer is reranking and filtering. A cross-encoder reranks candidate segments for relevance, while quality filtering removes low-information-density content, content farms, and segments that contradict each other.

    The fourth layer is context assembly. Bounded by the context window, budget is allocated by relevance × authority × freshness, and each segment keeps a source identifier for later citation.

    1. {
    2. "slot_budget": 6000,
    3. "segments": [
    4. {"id": "s1", "score": 0.91, "freshness": 0.8, "tokens": 820},
    5. {"id": "s2", "score": 0.87, "freshness": 0.4, "tokens": 640}
    6. ]
    7. }

    The fifth layer is generation. The model produces an answer from the assembled context and is required to point back to specific segment IDs through structured markers, which makes citation a generation constraint rather than something stitched on afterward.

    The sixth layer is presentation and feedback. The answer is streamed, citations are clickable and traceable, and user behavior flows back as training signal for the ranking and rewriting models.

    4. Key Engineering Challenges and Responses

    The complexity of streaming output is often underestimated. Retrieval time cannot be compressed, and the user has already waited hundreds of milliseconds. A workable approach is to decouple retrieval from the first screen: return the query understanding result and a thinking-status placeholder first, then fill in the body progressively, so perceived latency is significantly lower than actual latency.

    Context conflict is another frequent problem. When sources disagree, the model should not be left to arbitrate freely; conflicts should be marked during assembly and surfaced explicitly in the answer, along with differences over time.

    Citation consistency needs engineering validation, not model self-discipline. A lightweight check can be added after generation: extract the citation IDs in the answer and compare them against assertions that have no supporting source; if the check fails, trigger regeneration or degrade to listing sources only.

    Cost control depends on tiering. Cache high-frequency query results in a distributed cache, route long-tail queries to the deep path, and cap the number of retrieval rounds and the reasoning budget per request.

    5. On-Device Experience and Observability

    The client side must handle weak and absent networks. The strategy is to cache recent queries and answers locally and to tag cached content with its generation time, so stale information is not mistaken for a real-time conclusion.

    Observability should cover the full chain rather than API success rate alone. Recommended signals are per-stage latency, number of retrieved items, relevance change before and after reranking, citation hit rate, no-answer rate, and user retry rate. These metrics localize problems to a specific layer instead of attributing everything to “the model is not good enough.”

    On the infrastructure side, a combination of general-purpose capabilities from Baidu AI Cloud can be used: object storage holds index and corpus snapshots, a message queue smooths traffic spikes and decouples retrieval from generation, a container platform hosts elastic inference services, and logging plus monitoring and alerting provide chain tracing and threshold notifications. These are all standard industry categories, which makes them portable across environments.

    6. Quality Evaluation and the Iteration Loop

    Evaluation should run on two tracks in parallel. Offline, a labeled query set measures answer accuracy, citation verifiability, and the appropriateness of refusals. Online, canary experiments observe retry rate and proxy metrics for satisfaction.

    Refusal deserves particular emphasis as a first-class capability. When retrieval quality falls below a threshold, stating clearly that information is insufficient and offering referenceable sources pays off more in the long run than fabricating a fluent answer.

    7. Conclusion

    The competitiveness of mobile AI search does not come from single-point model capability but from the system-level coordination of retrieval quality, reasoning budget scheduling, citation verifiability, and on-device experience. Layering the pipeline, making budgets explicit, and turning citations into verifiable constraints is a sound path to an AI search service that can evolve sustainably, without depending on any vendor’s proprietary interfaces.