Integrating an LLM Application Platform with a Document Retrieval Engine: Architecture, Port Planning, and Engineering Practices

    This article explains how to integrate an LLM application orchestration platform with a specialized document retrieval engine to build enterprise-grade RAG systems. It covers the evolution of enterprise RAG architecture, the division of responsibilities between the two core components, core service port planning (80, 443, and 9380), and the step-by-step engineering work of connecting the platform to the retrieval API. It also addresses security hardening and retrieval tuning, giving developers a practical path to a more flexible, efficient, and accurate knowledge Q&A system.

    As large language models are adopted more deeply across enterprise applications, Retrieval-Augmented Generation (RAG) has become the standard paradigm for building knowledge-base Q&A systems. In real deployments, however, developers often run into weak document parsing, low retrieval accuracy, and rigid orchestration. A common best practice is to combine an LLM application platform with strong workflow orchestration and a specialized retrieval engine focused on deep document parsing. This article walks through that integration, from architecture design and port planning to concrete engineering integration.

    1. The Evolution and Challenges of Enterprise RAG Architecture

    In early RAG projects, developers typically relied on a single framework to handle the entire pipeline: document loading, chunking, vectorization, retrieval, and generation. This all-in-one approach works for plain text, but it struggles with complex enterprise documents such as PDFs, scanned files with tables and images, or documents with deeply nested structures. Parsing quality sets the ceiling on retrieval quality. If the chunking logic breaks the semantic integrity of a document, even a powerful model cannot produce accurate answers.

    For this reason, modern enterprise RAG architectures are moving toward specialized separation of duties. The orchestration platform handles prompt management, agent logic, multi-turn conversation state, and model scheduling, while the underlying knowledge base’s parsing, chunking, vectorized storage, and precise retrieval are delegated to a specialized document retrieval engine. The two communicate through standardized APIs, so each component performs at its best and the system stays maintainable.

    2. Integration Architecture and Component Responsibilities

    In this architecture, the two core components each have a clear role.

    LLM application orchestration platform: This is the system’s “brain.” It receives user queries, manages conversation context, and converts queries into retrieval requests through a configured workflow that it sends to the external knowledge base. Once results come back, the platform combines them with a predefined prompt template and schedules the LLM to generate the final answer.

    Document parsing and retrieval engine: This is the system’s “memory hub,” and its core value lies in deeply understanding unstructured data. It provides a visual preview of document chunks, supports multiple parsing strategies (such as layout-analysis-based chunking), and includes efficient vector retrieval and hybrid retrieval (full-text plus vector).

    3. Core Service Port Planning and Network Communication

    Before integration, mapping out the underlying service ports is a prerequisite for smooth communication. Taking a common document retrieval engine as an example, a standard deployment typically exposes network services on several ports, mainly 80, 443, and 9380. Understanding what each port is for is key to a successful integration.

    3.1 Standard Web Service Ports (80 and 443)

    Port 80 usually maps to the default HTTP port. It serves the front-end management console and non-encrypted API communication. Developers and administrators use it to access the engine’s visual interface for creating knowledge bases, uploading documents, and configuring parsing strategies.

    Port 443 is the default HTTPS port for encrypted web services and API communication. In production, to keep data in transit secure, it is strongly recommended to redirect all traffic to port 443 and encrypt all communication—including the management interface and API calls—with an SSL/TLS certificate, preventing sensitive enterprise knowledge data from being intercepted or tampered with during transmission.

    3.2 Core API Service Port (9380)

    Beyond the standard web ports, this type of engine usually provides a dedicated backend service port for internal RPC or specific-protocol communication, such as port 9380. This port is critical for communication between internal components, and it is also the core entry point that an external orchestration platform relies on for deep integration.

    In practice, many developers fall into a common trap: trying to call the interfaces exposed on ports 80 or 443 directly for knowledge-base retrieval. Because the front-end ports often come with authentication interception, CORS restrictions, or session management, calling them directly tends to cause failures or performance bottlenecks. By contrast, port 9380 usually exposes the backend RPC or RESTful interfaces directly, offering lower-level and more efficient retrieval. So in the later integration with the LLM orchestration platform, using port 9380 as the Base URL for the knowledge-base API is a crucial step.

    4. Engineering Practices for Platform Integration

    Once the port plan is clear, the concrete integration work begins. The overall flow can be summarized as: verifying network connectivity, integrating the API, and adapting the orchestration platform.

    4.1 Verifying Network Connectivity

    Before configuring the application platform, first make sure the server or container running the orchestration platform can reach port 9380 of the retrieval engine. You can test this with a curl command or a simple script. If the two are deployed in different network-isolated zones (such as different VPCs or Kubernetes namespaces), configure the routing rules, security group policies, or DNS resolution in advance so that the TCP path to port 9380 is unobstructed.

    4.2 API Integration and Parameter Configuration

    On the orchestration platform side, you typically add a node of the “external knowledge-base API” type. You then fill in the API’s basic information:

    • Endpoint (Base URL): point it to port 9380 of the retrieval engine, for example http://<engine-ip>:9380/api/v1/retrieval.
    • Authentication: based on the engine’s security configuration, carry an API Key or Token in the request headers to ensure the call is authorized.
    • Request body: the orchestration platform wraps the user’s query into a JSON format the engine recognizes. Typical parameters include the knowledge-base ID, the query text, and the Top-K count.

    Developers should consult the engine’s API documentation and map the platform’s outputs to the engine’s inputs to ensure the fields match.

    4.3 Adapting the Orchestration Platform and Mounting the Knowledge Base

    After creating the API node, connect the external knowledge-base node into the main flow on the orchestration platform’s workflow canvas. When a user asks a question, the workflow automatically triggers the API call and retrieves the recall results returned by port 9380 (usually containing document chunk content, scores, and source information). These recalled results are then used as context and dynamically inserted into the LLM’s prompt template to generate the final answer.

    5. Advanced Security and Performance Considerations

    5.1 Security Hardening

    In production, exposing port 9380 directly carries some risk. It is recommended to add an API gateway layer in front of the port to handle unified authentication, rate limiting, and log auditing. You can also use cloud-native object storage to host the original documents and a message queue to process large-document parsing tasks asynchronously, reducing the real-time load on the retrieval engine.

    5.2 Retrieval Tuning

    After integration, accuracy still needs ongoing optimization. Developers should focus on the retrieval engine’s hybrid-retrieval weight configuration (for example, the ratio between vector retrieval and the BM25 algorithm) and on the context-window truncation strategy in the orchestration platform. Continuously tuning the Top-K value and the reranking model through A/B testing can effectively reduce hallucination and improve the accuracy of the final Q&A.

    6. Summary

    Deeply integrating an LLM orchestration platform with a specialized document retrieval engine is an effective way to break through the limits of a single RAG framework. By accurately identifying and using low-level API services such as port 9380, developers can build a more flexible, efficient, and accurate enterprise knowledge Q&A system. In real engineering work, thoroughly understanding each component’s port plan and interface contract, together with rigorous security and network configuration, is the key to a successful integration.