Architectural Evolution and Practice of Integrating Search and File Parsing into LLM APIs

    As LLM applications deepen, relying solely on pre-trained knowledge is no longer sufficient for enterprise-level real-time data retrieval and proprietary document parsing. Recently, a major LLM provider integrated highly praised client-side capabilities—such as web search, deep thinking search, file input, and link reading—directly into its conversation API. This article analyzes this architectural evolution from text generators to comprehensive agent bases, exploring capability integration, performance testing, and engineering best practices for developers.

    With the deepening of large language model (LLM) application scenarios, relying solely on the model’s internalized pre-trained knowledge can no longer meet the demands for real-time data retrieval and proprietary document parsing in enterprise applications. Recently, a major LLM provider officially opened and integrated capabilities highly praised in its client applications—such as web search, deep thinking search, file input, and link reading—into its conversation API. This technical move marks the acceleration of LLM APIs evolving from simple “text generators” to “all-around agent bases.” This article delves into this technical trend from four dimensions: architectural evolution, capability analysis, tested performance, and engineering practice.

    1. Evolution Path of LLM API Tool Calling Capabilities

    Over a short period of about a month, the provider’s API capability matrix underwent three clear stages of evolution, reflecting the general trend of current LLM infrastructure as a service:

    1. Opening of independent interfaces: Initially, the provider opened independent Search and Fetch interfaces for its self-developed search engine. Public information shows its underlying index covers hundreds of billions of web pages globally, processing hundreds of millions of search requests daily. Meanwhile, the underlying conversation model saw an expansion of its context window, supporting input of over a million tokens and a maximum output of around 300,000 tokens, laying the foundation for long-text processing.
    2. Exploration of commercial billing: Subsequently, a pay-per-use strategy was implemented for server-side search and fetch calls that were previously free on some clients. This marked the initial formation of a commercial closed-loop for high-quality retrieval capabilities.
    3. All-in-one capability integration: Finally, capabilities like search, fetch, file parsing, and voice were directly packaged into the conversation API. Developers can enable them on demand via parameters, achieving seamless integration of conversation and tool calling.

    2. Architecture Refactoring: Server-Side Tool Calling Eliminates “Glue Code” Pain Points

    For engineers experienced in LLM application development, building an agent with web search capabilities often requires writing a lot of “glue code.” The traditional orchestration logic is as follows:

    1. # Pseudo-code in traditional mode
    2. query = "Latest financial report data of a certain company"
    3. prompt = f"Please convert the user's question into search keywords: {query}"
    4. keywords = llm.generate(prompt)
    5. search_results = search_api.search(keywords)
    6. web_content = fetch_api.fetch(search_results[0]['url'])
    7. final_prompt = f"Answer the question based on the following materials:\nMaterials: {web_content}\nQuestion: {query}"
    8. answer = llm.generate(final_prompt)

    In this mode, developers must not only manage complex conversation states but also handle dirty work such as search term extraction, web page cleaning, context truncation, and error retries. The core value of this API upgrade lies in completely sinking the logic of tool calling and context concatenation to the server side.

    Under mainstream interface protocols, developers only need to enable the corresponding tool switches in the request body on demand to gain five core capabilities: web search, deep thinking search, file input, read link, and content safety validation. Client-side responsibilities are significantly simplified, needing only to render the streaming results returned by the server and maintain basic session states.

    3. Core Capability Analysis and Application Boundaries

    The opened API capabilities can be divided into two layers:

    Layer 1: Built-in Toolset for Conversation API

    • Web Search: Solves the LLM knowledge lag problem, capable of quickly fetching the latest current events, stock prices, or news.
    • Deep Thinking Search: This is the most technically demanding capability. The model no longer searches in one step but “reasons while searching.” Based on the gaps in its current reasoning, it autonomously decides what to search next, whether to open a specific web page, and whether to find content within the page. Official documentation shows that up to twenty such tool operations are supported in a single conversation turn, greatly improving the accuracy of answers to complex factual questions.
    • File Input: Natively supports common document formats like PDF, Word, and PowerPoint, with a single file limit of up to 100 MiB and a maximum of 1000 pages. This eliminates the cost for developers to deploy additional document parsing services.
    • Read Link: Directly pass a URL in the conversation, and the server handles fetching and parsing.

    Layer 2: Independent Atomic Interfaces
    Besides the built-in tools for conversations, the API matrix retains five independent interfaces—Search, Fetch, OCR, ASR (Automatic Speech Recognition), and TTS (Text-to-Speech)—for developers to call flexibly. This means the provider is not only selling model inference capabilities but also opening up its App’s underlying operational methods as infrastructure.

    4. API Call Testing and Performance Evaluation

    To verify the actual performance of the integrated API, we designed a set of test cases covering baseline conversation, web search, deep thinking search, and file input.

    1. Web Search Test
      The test question was set to query the expected IPO issue price and stock code of a well-known AI company. After receiving the request with web search enabled, the model quickly called the underlying Search tool and accurately returned the information: “USD 70 to 78 per share, intended code ANT.” Verified against the company’s recent public prospectus, the retrieval result was completely accurate, demonstrating the timeliness and precision of its search engine.

    2. Deep Thinking Search Test
      The test question was to compare the total funding of two different companies. This is a typical multi-hop reasoning problem, requiring the retrieval of historical financing records of both companies and summing them up. The test found that the model consumed about 400 tokens for internal reasoning (Chain of Thought). During the reasoning process, it autonomously initiated multiple searches and web page fetch operations, filling in missing financial data, and finally provided a logically rigorous comparative answer. This mechanism of deeply binding reasoning with retrieval significantly reduces hallucinations.

    3. Cost Observation
      After completing the cross-calls of the six core capabilities, we pulled the billing data for the day. The results showed that including more than ten API requests and the consumption of about 17,000 tokens, the total bill for the day was only 0.05 RMB. This on-demand, fine-grained billing model is highly cost-effective for small and medium-sized developers.

    5. Engineering Practice Suggestions for Developers

    Facing increasingly feature-rich LLM APIs, developers should note the following points in architectural design:

    • Reasonable Tool Mode Selection: For simple information queries, using basic web search is sufficient to reduce latency and token consumption; for complex comparative analysis or fact-checking, decisively enable deep thinking search.
    • File Processing Strategy: Although the server side supports large file uploads, during actual transmission, for oversized PDF files, it is recommended to perform necessary chunking or OCR pre-processing on the client side first to reduce network bandwidth pressure.
    • Multimodal Orchestration: Listening and speaking (ASR/TTS) currently go through independent interfaces. When building voice assistant applications, the front-end needs to manage the conversion state between audio streams and text streams and coordinate asynchronously between the server-side conversation API and voice API.

    In summary, LLM APIs internalizing search and file parsing capabilities is an inevitable result of the maturation of Agent architecture. It not only lowers the threshold for application development but also improves system stability and security through unified server-side orchestration. As such infrastructure continues to improve, developers will be able to focus more on business logic innovation, driving AI applications into broader implementation scenarios.