Building LLM Apps with Server-Side Tool Chains: Web Search, URL Reading, and an Open-Source Chat Frontend
This article explains how a server-side tool chain in an LLM API takes over web search, URL reading, document and image parsing, and speech features that developers used to build themselves. It covers multi-step tool calls in deep thinking mode, an open-source frontend that can import exported chat history, and two common integration pitfalls: dropping intermediate state blocks and having sampling parameters overridden by the server. It also describes the trade-off between text-only and layout-aware file parsing.
1. Background: From Simple Model Calls to End-to-End Agent Capabilities
Building an LLM application with web search, document parsing, and voice interaction used to require a complex pipeline. Developers had to handle each step themselves: deciding whether a user query needed a search, calling a search engine API, fetching the target web page, cleaning out the HTML tags, and inserting the extracted information into the prompt context. Each step consumed significant engineering effort and compute. This client-driven approach created a long chain of dependencies, and a network fluctuation or an unexpected page structure could break the whole pipeline.
Recently, a major AI platform made a notable update. It packaged the full set of enhanced capabilities behind its web and mobile apps into a public API. Web search, link reading, document and image parsing, and speech-to-text and text-to-speech are now handled on the server. These are tasks that developers once had to write by hand. The client only passes the user’s intent. The model decides whether to search, how many search rounds to run, and then produces an answer with source citations. The platform also open-sourced its frontend interface, which lowers the barrier for companies that want to build their own AI agents.
2. Server-Side Tool Chain Orchestration: Search, Fetching, and Multi-Step Reasoning
The main change is the deep integration of a server-side tool chain. Traditional model APIs only generate text. The server now takes over web retrieval, image search, and link content fetching.
In standard mode, the model decides from the user’s question whether it needs external information. It can call the search tool or run an image search on its own. It then combines the key information it retrieves into the answer and attaches source citations.
When deep thinking mode is enabled, the model shows strong agentic behavior. It can run tool calls in the middle of its reasoning process.
The official documentation includes an example that compares the heights of two famous buildings. The model does not reach the answer in one step. It follows a path similar to how a person would research the question. It first runs a broad search for basic information. If that information is incomplete, it opens the official websites of both buildings to look for exact figures. If the figure is not on the homepage, it searches for keywords within the site. It may also change its search terms and run additional queries. This goal-directed planning lets the model make many tool calls in sequence, up to 20, until it has enough information to close the reasoning loop. Developers do not need to write state machines or retry logic on the client side for this deep search orchestration.
3. Open-Source Frontend and Seamless Conversation Migration
Along with the backend API, the platform open-sourced its frontend source code, which has practical value. Developers can download the static assets, double-click the entry file, and enter an API key. This starts a fully functional chat interface on a local machine or a private server.
The open-source frontend can also import a compressed archive of chat history exported from the official platform. A user’s conversation context on the public platform can therefore move into a privately deployed frontend and continue there. This keeps the conversation flow consistent for users. It also gives enterprise users a practical way to turn knowledge from public-platform conversations into private assets.
4. API Integration Guidelines and Common Pitfalls
Server-side capabilities are powerful, but developers still need to watch several technical details during integration. Otherwise, they can easily run into problems.
4.1 Protocol Compatibility and Context State Retention
At the interface level, the platform supports several mainstream LLM API protocols, so developers can migrate with little friction. To enable the capabilities, add the web search tool identifier and the URL reading tool identifier to the request body.
However, returning context state is the step most likely to go wrong. After the server runs a tool call, the response body includes structured data blocks, such as the thinking process, search results, and fetched page content. When a developer sends the next conversation request, they must return these data blocks to the server exactly as received.
If an internal API gateway removes these intermediate result blocks to save tokens or to mask data, the request still succeeds. The model, however, loses all memory of the web pages it has already read. These intermediate blocks are the core carrier of the model’s short-term memory. Removing them can cause serious hallucinations in multi-turn conversations or lead the model to repeat searches.
// Pseudocode: state blocks must be returned unchanged{"messages": [{"role": "user", "content": "Compare the heights of Tower A and Tower B"},{"role": "assistant", "content": "Search results block..."}, // Must not be filtered{"role": "assistant", "content": "Thinking process block..."}, // Must not be filtered{"role": "assistant", "content": "Based on the information, Tower A is..."},{"role": "user", "content": "Which years were they built in?"}]}
4.2 Sampling Parameter Takeover: Server-Controlled Trade-offs
Another pitfall is that sampling parameters may have no effect. When a request enables tool calls, asks for automatic conversation title generation, or triggers a high-level safety review, the server takes over the sampling process. It does this to keep tool calls stable and output formats consistent.
In these cases, parameters that control randomness, such as temperature and top_p, are ignored. Developers who want fine control over the model’s output style should plan for this in their business logic. In tool-calling scenarios that require strict instruction following, giving up control over randomness is a reasonable architectural trade-off.
5. Multimodal and File Parsing: Choosing a Pay-Per-Page Mode
For document parsing, the platform supports common formats, including PDF, Word, PowerPoint, and images. This capability is typically billed per page, so developers should plan their business logic with cost control in mind.
File parsing has two core modes:
- Text-only extraction: This mode extracts only the text from a file and strips all layout and image information. It is fast and inexpensive. It suits plain-text contracts, logs, or archived documents where formatting does not matter.
- Layout parsing: This mode extracts text and also keeps the document structure, such as tables, columns, and heading levels. It can also recognize information in charts. It uses more compute, but for complex research reports, academic papers, or financial data with many tables, it preserves the semantic context of the content. This can noticeably improve the accuracy of the model’s answers.
6. Summary
This update moves app-level capabilities down to the API and open-sources the frontend. It marks a shift in LLM application development from assembling individual components toward more ready-to-use building blocks. Server-side tool chain management lowers the technical barrier to building agents, so developers can focus more on business logic.
In real deployments, companies can combine general-purpose cloud services such as Baidu AI Cloud, including its API gateway, object storage, and log monitoring services, to build highly available, end-to-end agent infrastructure. By handling context state blocks correctly, understanding how the server takes over sampling parameters, and choosing the right file parsing mode for their costs, developers can build next-generation applications with deep reasoning and multimodal processing.
