Building a "Think First, Search Later" Collaborative Architecture for AI Search
As AI search evolves from single-round retrieval plus stitched generation into multi-stage systems covering planning, retrieval, evidence integration, and generation, complex questions demand more from the search architecture. This article introduces the "think first, search later" pattern: a large reasoning model first produces a thinking framework and retrieval plan, then lightweight models execute query expansion, retrieval, filtering, and integration. It covers the small-model plus large-model collaborative architecture, the end-to-end pipeline, orchestration and observability, multimodal video integration, and evaluation and security best practices.
Building a “Think First, Search Later” Collaborative Architecture for AI Search
As AI search evolves from “single-round retrieval + stitched generation” into a multi-stage system of “planning, retrieval, evidence integration, and generation,” complex questions place higher demands on the search architecture. It must handle multi-hop reasoning, multi-source evidence, and conflicting information, while controlling latency, cost, and hallucination risk. “Think first, search later” is a representative research pattern: the model first proposes a thinking framework and retrieval path, then performs information integration and analysis. Its core is not simply adding one more model call, but decoupling “deep reasoning and planning” from “information retrieval and integration.” Through collaboration between small and large models, complex questions are broken down into executable, observable, and evaluable steps.
1. From Traditional RAG to “Think First, Search Later”
Traditional retrieval-augmented generation (RAG) typically follows a pipeline of “user question → query rewriting → document recall → context concatenation → answer generation.” This pattern is efficient for factual Q&A, but exposes several limitations when facing complex research-oriented questions:
- Insufficient problem decomposition: A single-round query can hardly cover the multiple sets of evidence required for multi-hop relationships, comparative analysis, and causal reasoning.
- Amplified recall noise: Broad queries easily recall large amounts of weakly relevant documents, increasing context cost and interfering with generation.
- Weak evidence organization: After simple concatenation of document fragments, the model struggles to identify conflicts, timeliness, and evidence weight.
- Unobservable process: Intermediate steps lack explicit structure, making it hard to locate whether a failure occurred in planning, retrieval, or integration.
- Untraceable citations: There is no stable mapping between answers and evidence, making it difficult to meet audit requirements in enterprise scenarios.
“Think first, search later” moves planning to the front: a large model with deep reasoning capabilities first generates the thinking framework, sub-questions, and retrieval steps; then lightweight specialized models execute query expansion, retrieval, filtering, extraction, and preliminary integration; finally, the large model performs synthesis and reflection. This allows “thinking” and “searching” to be optimized separately: the planning stage pursues structural completeness and reasonable paths, while the execution stage pursues recall coverage, evidence quality, and cost efficiency.
2. Small-Model + Large-Model Collaborative Architecture
This architecture adopts a “small model + large model” collaborative model. Tasks requiring deep reasoning—framework thinking, step decomposition, conflict judgment, and final synthesis—are handled by a deep reasoning large model. Information search, query expansion, fragment filtering, entity extraction, evidence deduplication, and data integration are handled by lightweight or specialized models.
The value of this division of labor is reflected in four aspects:
- Controllable cost and latency: High-frequency, fine-grained retrieval processing is assigned to small models, avoiding calling expensive reasoning models for every step.
- Stronger concurrency: Multiple sub-queries can be retrieved in parallel, with small models performing parallel filtering and extraction, shortening end-to-end time.
- Auditable process: Planning results, sub-queries, evidence fragments, and filtering rationales can all be recorded in structured form for traceability.
- Better stability: Splitting a long pipeline into modules with clear responsibilities allows single-point failures to be retried or degraded, rather than rerunning the entire pipeline.
Typical components include: planner, step decomposer, query expander, retrieval executor, evidence filter, evidence integrator, answer synthesizer, citation manager, orchestration layer, and caching and observability modules. The planner is handled by the deep reasoning model, the executors by lightweight models and retrieval services, and the synthesizer produces the final answer aligned with citations.
3. End-to-End Pipeline Design
A complete “think first, search later” pipeline can be divided into the following stages:
- Question understanding and constraint identification: Identify the question type, timeliness requirements, domain scope, permission boundaries, and output format. Different planning templates are used for comparative, causal, and research-type questions.
- Thinking framework generation: The deep reasoning model proposes an analytical framework, such as “definition—current status—key factors—comparison—conclusion,” and provides the sub-questions that need to be verified.
- Step decomposition and sub-query generation: Convert sub-questions into retrievable tasks, specifying the goal, keywords, time range, and evidence type for each task. Small models can perform synonym expansion, entity completion, and qualifier enhancement on sub-queries.
- Multi-source retrieval and recall: Execute retrieval in parallel across web pages, document repositories, structured data, or multimodal fragments, recording metadata such as source, time, permissions, and confidence.
- Evidence filtering and extraction: Small models deduplicate recall results, rank them by relevance, extract fragments, and annotate conflicts, keeping only evidence that supports the sub-questions.
- Cross-validation and integration: Key conclusions require at least one independent evidence source; conflicting evidence retains a note of disagreement rather than being forcibly merged.
- Answer synthesis and citation alignment: The large model generates the answer based on structured evidence, and the citation manager maps conclusions to evidence fragments, producing traceable citations.
- Reflection and retry: If evidence coverage is insufficient or citations cannot be aligned, trigger supplementary retrieval or adjust sub-queries instead of generating directly.
Illustrative pseudocode:
plan = reasoning_model.plan(question, constraints)steps = reasoning_model.decompose(plan, max_steps)evidence_pool = []for step in steps:queries = small_model.expand_query(step)docs = parallel_retrieve(queries, filters=permission_scope)evidence = small_model.filter_extract_rank(docs, step)evidence_pool.append(evidence)merged = small_model.deduplicate_and_merge(evidence_pool)answer = reasoning_model.synthesize(question, merged, require_citations=True)if citation_coverage(answer) < threshold:answer = retry_with_reflection(question, merged, plan)
4. Engineering Orchestration and Observability
The key to the collaborative architecture lies in the orchestration layer. The orchestration layer needs to manage step states, parallelism, timeouts, retries, budgets, and degradation strategies. For example: if the planning stage times out, a simplified framework can be returned; if some sub-queries fail in the retrieval stage, other evidence can be preserved; if citations are insufficient in the synthesis stage, supplementary retrieval is triggered. Caching should distinguish between question-level cache, sub-query-level cache, and evidence fragment cache, and should be validated using both semantic similarity and permission tags to avoid unauthorized reuse.
For observability, it is recommended to record the planning tree, sub-queries, recall counts, filtering ratios, evidence citations, model latency, and error codes for each request. Log services and monitoring alerts can be used to analyze failure patterns: whether planning was too broad, recall was insufficient, filtering mistakenly removed valid evidence, or citations were mismatched in the synthesis stage. Evidence objects should include a stable identifier, source type, fragment content, timestamp, permission tag, confidence, and citation location to support auditing and reproduction.
5. Considerations for Integrating Multimodal Video Capabilities
When a search system integrates a general-purpose video understanding model, it should be treated as an asynchronous tool rather than directly concatenating video content into the text context. In engineering terms, subtitles, keyframes, segment summaries, and timestamp indexes can be prepared first, and then video understanding capabilities can be invoked on demand through a unified tool-calling protocol. Retrieval results should return locatable evidence fragments, such as time ranges, keyframe identifiers, and transcribed text, and should inherit the original video’s permission and copyright constraints. Video tasks are usually time-consuming and are well suited to asynchronous task queues, progress callbacks, and timeout degradation, avoiding blocking the main retrieval pipeline.
6. Evaluation, Security, and Best Practices
Evaluation should cover answer correctness, evidence coverage, citation accuracy, step completion rate, latency, cost, and security compliance metrics. Offline evaluation sets should include multi-hop questions, time-sensitive questions, conflicting evidence, and permission-restricted scenarios; online, A/B testing can be used to observe user adoption rates and follow-up question rates. Anti-hallucination strategies include evidence-first generation, mandatory citations, conflict annotation, confidence indicators, and refusal to answer when evidence is insufficient.
For security, retrieval must inherit user and tenant permissions, and sensitive information must be desensitized before entering the model context. Defenses should be in place against prompt injection, malicious web pages, and unauthorized tool calls. Multimodal content requires attention to privacy, copyright, and content security auditing. On the infrastructure side, general-purpose categories of services such as Baidu AI Cloud’s object storage, message queues, log services, and monitoring alerts can be used to host indexes, asynchronous tasks, and observability data.
Best practices can be summarized as: plan before retrieving, structure the evidence, collaborate with layered models, control budgets and timeouts, keep citations traceable, present conflicts explicitly, make multimodal processing asynchronous, and close the evaluation loop. By decoupling and coordinating “thinking” and “searching,” an AI search system can balance coverage, interpretability, and engineering controllability in complex research-oriented tasks.
