LLM API Capability Matrix for Building a Full AI Assistant: Search, File Input, Link Reading, and Safety Orchestration

    This article presents a capability-matrix approach to building a full AI assistant on top of general-purpose LLM APIs. It examines five core capabilities—non-reasoning web search with citations, reasoning-enhanced multi-step search, file input parsing, link reading, and safety validation—and explains how to orchestrate them into a controllable application. The article also covers a reference architecture and data flow, abstract pseudocode for capability orchestration, context governance, citation traceability, caching, tool orchestration, observability, and evaluation. Finally, it outlines a three-stage rollout path for developers who need to build an auditable, extensible, and sustainable assistant system while keeping tool use, context, and outputs under control.

    LLM API Capability Matrix for Building a Full AI Assistant: Search, File Input, Link Reading, and Safety Orchestration

    1. From Single-Turn Chat to a Capability Matrix: How to Build a Complete Assistant

    Early general-purpose LLM APIs mainly addressed text-in, text-out conversations. As developer needs move from question answering to task execution, a complete intelligent assistant needs more comprehensive input processing, tool invocation, information retrieval, and safety governance. These capabilities can be abstracted into a “capability matrix”: basic conversation handles semantic understanding and generation; search tools retrieve real-time information; link reading parses web content provided by users; file parsing processes attachments such as PDF, Office, and images; and safety validation handles input/output risk control and refusal indicators. Only by orchestrating these capabilities according to business scenarios can developers replicate an experience close to a complete assistant application.

    From an engineering perspective, the value of the capability matrix lies not in the number of individual capabilities, but in the controllability of their combination. A practical assistant application usually needs to answer four questions: Is the user input safe? Is the context sufficient? Are tool calls necessary and traceable? Is the output citable and reviewable? Designing the API call chain around these four questions is more important than simply stacking features.

    2. Breaking Down the Five Core Capabilities

    2.1 Non-Reasoning Web Search with Cited Answers

    In non-reasoning mode, developers can use a search tool switch to let the model automatically initiate web or image searches based on the user’s question and incorporate search results into the answer context. This mode is suitable for factual queries, time-sensitive information retrieval, and product material verification. In engineering implementation, search should not be treated as a one-time action. Instead, it should be designed as five stages: query construction, result filtering, body extraction, citation mapping, and answer fusion.

    First, query construction should combine the user’s original question with session context to avoid search drift caused by unclear references. Second, result filtering should screen based on source quality, time, language, and business allowlists. Third, body extraction should remove navigation, advertisements, and duplicate content while retaining verifiable passages. Finally, citation mapping should establish numbered relationships between key conclusions in the answer and source snippets, making it easier for the frontend to display the “basis for the answer.” For image search, attention should be paid to image metadata, copyright notices, and accessibility, and unreliable content should not be directly concatenated.

    2.2 Reasoning-Enhanced Search: Autonomous Retrieval in Multi-Step Reasoning

    In thinking mode, the search tool can be upgraded from “one-time retrieval” to “multi-step retrieval.” During reasoning, the model can identify information gaps, autonomously initiate searches, read links, compare evidence, and continue reasoning. This capability is suitable for complex research, solution comparison, troubleshooting, and similar tasks. However, multi-step search introduces cost, latency, and unpredictability, so it is necessary to set maximum steps, per-step timeouts, total budgets, stop conditions, and failure fallback strategies.

    In development practice, it is advisable to wrap reasoning-enhanced search as a “controlled agent” rather than leaving it fully open. The orchestration layer should record each step’s query, result summary, cited sources, and confidence, and force convergence when the budget limit is reached. For high-risk business scenarios, the final answer can be required to include a source list; when evidence is insufficient, the system should return “insufficient information” rather than forcing generation. This preserves the advantages of multi-step reasoning while maintaining auditability.

    2.3 File Input: From Attachments to Usable Context

    File input capabilities usually support uploading PDF, Office, image, and other formats, completing plain text extraction or mixed text-image parsing, and then adding the results to the conversation context for the model to answer. File processing is a high-frequency requirement for a complete assistant and also a quality bottleneck. In engineering, it is necessary to distinguish four stages: parsing, chunking, retrieval, and stitching. Parsing extracts text, tables, layout, and image information; chunking should preserve heading hierarchy and page numbers; retrieval selects relevant snippets based on the question; and stitching controls context length while preserving citation locations.

    For mixed text-image files, it is recommended to preserve layout structure information, such as pages, paragraphs, tables, and figure captions, to avoid semantic loss caused by simple linearization. For long documents, a combination of summarization and snippet recall should be used instead of inserting all content at once. For scanned documents and images, OCR and quality detection should be introduced, and low-confidence content should be marked as uncertain. File parsing also needs to address risks such as malicious files, zip bombs, macro viruses, and sensitive information leakage. Parsing services should run in isolated environments.

    When the link reading tool is enabled, the model can automatically detect links in user messages, fetch web page content, and answer based on the context. This capability is suitable for scenarios where users paste articles, documentation pages, announcement pages, and similar content. Implementation should focus on three things: link detection, content extraction, and secure access. Link detection should support multiple links, short links, and parameterized links in messages, but must go through allowlist and protocol validation. Content extraction should extract the main body, title, publication time, author, and other metadata, and remove scripts and irrelevant navigation. Secure access should prevent intranet probing, redirect bypasses, and malicious content injection.

    The results of link reading should be treated as “reference context” rather than absolute facts. For dynamic web pages, login pages, and anti-scraping pages, timeouts and fallback prompts should be set. Fetched content should be cached and version timestamps recorded to avoid repeated fetching of the same link. In frontend display, link summaries, key paragraphs, and citation numbers in the final answer can be associated to improve verifiability.

    2.5 Safety Validation: Input/Output Risk Control and Refusal Indicators

    After the safety validation parameter is enabled, the platform can provide basic risk control capabilities, review model input and output, and return a refusal indicator when risk is detected. For developers, safety validation is not optional; it is the foundation of a complete assistant application. A layered strategy is recommended: the input side checks sensitive information, malicious instructions, and abnormal attachments; the tool side limits link access scope and search sources; the output side checks prohibited content, privacy leakage, and citation inconsistency; and the audit side records request identifiers, risk types, and handling results.

    Refusal indicators should be returned as structured fields so that business systems can handle them uniformly. For refused requests, internal policy details should not be exposed, but a traceable request identifier should be provided. Safety policies also need to be configurable, support gradual rollout, and be evaluable to avoid false positives against normal business. For scenarios involving files and links, special attention should be paid to prompt injection: instructions in external content must not override system policies, and tool-returned content should be treated as untrusted data.

    3. Reference Architecture and Data Flow

    A reference architecture for replicating a complete assistant can be divided into an access layer, preprocessing layer, orchestration layer, model and tool layer, post-processing layer, and governance layer. The access layer handles authentication, rate limiting, and session management; the preprocessing layer performs file parsing, link extraction, and input review; the orchestration layer decides search tools, link reading tools, file context, and safety policies based on mode and configuration; the model and tool layer executes reasoning, search, fetching, and parsing; the post-processing layer performs output review, citation merging, and formatting; and the governance layer handles logs, monitoring, evaluation, and cost statistics.

    When deployed on cloud infrastructure, general object storage can be used to store attachments and parsing results, message queues can smooth traffic peaks, and logging and monitoring alerts can observe tool call success rates, refusal rates, average latency, and per-request cost. Session context should have lifecycle and desensitization policies, and parsing artifacts should be traceable but not exposed long term. In multi-tenant scenarios, tenant isolation is needed at the storage, retrieval, and tool invocation layers.

    4. Abstract Pseudocode: Capability Orchestration

    The following is business-defined pseudocode. It only expresses call relationships and does not represent any specific product interface or parameter setting.

    1. function handle_request(user_input, files, mode, config):
    2. input_audit = safety_check_input(user_input, files)
    3. if input_audit.blocked:
    4. return refusal(input_audit.trace_id)
    5. context = []
    6. if config.file_enabled and files:
    7. context.extend(parse_files(files)) # Business-defined parser
    8. links = extract_links(user_input)
    9. if config.url_reader_enabled and links:
    10. context.extend(fetch_and_extract(
    11. links,
    12. allowlist=config.link_allowlist,
    13. timeout=config.fetch_timeout
    14. ))
    15. tool_policy = build_tool_policy(mode, config)
    16. result = model_reason_and_call_tools(
    17. user_input=user_input,
    18. context=context,
    19. tools=tool_policy,
    20. max_steps=config.max_steps
    21. )
    22. output_audit = safety_check_output(result.answer, result.citations)
    23. if output_audit.blocked:
    24. return refusal(output_audit.trace_id)
    25. return merge_citations(result.answer, result.citations)

    This flow emphasizes three principles: review before processing, policy-controlled tool invocation, and separation of output review from citation merging. Development teams can encapsulate search, link reading, and file parsing as independent services and combine them through the orchestration layer according to the scenario, avoiding the need to put all complex logic into a single API call.

    5. Engineering Best Practices

    For context governance, establish a token budget model: set limits separately for system prompts, file snippets, link summaries, search evidence, and conversation history. When the limit is exceeded, prioritize high-relevance snippets and generate compressed summaries. For citation traceability, assign a stable number to each external snippet, require citation numbers during answer generation, and verify in post-processing whether the numbers exist. For caching, short-cycle caching can be applied to link content, search queries, and file parsing results, but versions and expiration times need to be recorded.

    For tool orchestration, both search and link reading should have timeouts, retries, circuit breakers, and fallback. Concurrent calls should be limited in total volume to avoid a single request overwhelming the system. For observability, it is recommended to record request chains, tool call counts, citation coverage, refusal rates, parsing failure rates, and average latency. For evaluation, build test sets covering factual question answering, long-document question answering, link reading, risky inputs, and prompt injection, and continuously evaluate answer accuracy and the effectiveness of safety policies.

    6. Rollout Path and Conclusion

    Rollout can be divided into three steps. The first stage completes basic conversation, file parsing, and input/output safety validation to establish a minimum viable assistant. The second stage integrates link reading and non-reasoning search, and improves citation display and caching. The third stage introduces reasoning-enhanced search and multi-step tool orchestration, and establishes budget control, an evaluation system, and a gradual rollout mechanism. Each step should retain switches and rollback capabilities to avoid uncontrollability caused by capability stacking.

    Overall, the capability matrix of general-purpose LLM APIs provides a feasible foundation for developers to replicate a complete intelligent assistant. Real competitiveness comes from the systematic design of capability orchestration, context governance, citation traceability, safety risk control, and engineering observability. Only by making these components solid can teams build an extensible, auditable, and continuously iterable assistant application while maintaining controllability.