Enterprise Knowledge Base Q&A: Hybrid Orchestration and Deep Document Parsing
Learn how to combine LLM application orchestration with deep document parsing for enterprise knowledge base Q&A. This article compares their complementary strengths, outlines an API-based integration workflow, and explains Docker Compose port mapping to avoid conflicts when deploying both components on the same host.
Technology choices shape the capabilities of an enterprise knowledge base question-answering system. Common approaches fall into two categories: large language model (LLM) application orchestration frameworks centered on business logic and agents, and document retrieval engines focused on unstructured data processing and deep document parsing.
Complex enterprise environments often require both flexible workflows and detailed document understanding. A single approach may struggle to provide both. This article compares the strengths and limitations of these two approaches and describes a hybrid architecture that integrates them through APIs.
1. Comparing the Two Approaches
When designing an enterprise knowledge base, it is important to understand where each type of framework excels and where its responsibilities end.
1.1 Strengths of Application Orchestration Frameworks
Application orchestration frameworks aim to simplify LLM application development while supporting business logic. Their main strengths include:
- Ease of use and rapid iteration: These frameworks typically provide visual interfaces, allowing developers to get started without extensive study of low-level documentation. Initial configuration and prototype deployment validation can often be completed in a short time—typically within 30 minutes.
- Modularity and customization: Modular designs make it straightforward to replace model nodes or insert custom code, supporting deeper application customization.
- Complex workflows and agent orchestration: Support for external tools and workflow orchestration enables collaboration between multiple models. Visual workflows let developers define conditional branches, loops, and other business processes.
- Intelligent routing across knowledge bases: These frameworks can retrieve information from multiple knowledge bases and route requests according to user intent. This is particularly useful for enterprises with several business units.
1.2 Strengths of Deep Document Parsing Engines
Deep document parsing engines focus on data ingestion and processing rather than application workflows. Their strengths lie in handling complex source documents:
- Detailed parsing of unstructured data: Deep document understanding techniques help extract information from PDFs, scanned documents, and complex tables while preserving document hierarchy and visual organization.
- Built-in visual and text processing: Native optical character recognition (OCR) support and document-specific chunking templates—for contracts, academic papers, and financial reports—reduce preprocessing work.
- Support for retrieval-intensive workloads: Architectures optimized for retrieval can provide high concurrency and low latency, making these engines suitable for latency-sensitive applications and heavy retrieval workloads.
1.3 Why Combine Them?
Enterprise workflows can be intricate, while knowledge sources vary widely in format and complexity.
Using only an orchestration framework may limit retrieval accuracy when source material includes scanned PDFs with complex tables. Using only a document parsing engine may make it difficult to implement multi-step question-answering workflows and tool calls.
A hybrid architecture addresses these complementary requirements by assigning business orchestration and document processing to separate components.
2. Hybrid Architecture and API Integration
The central principle of this architecture is separation of responsibilities: use each component for the tasks it handles best.
2.1 Orchestration as the Control Layer, Parsing as a Data Service
The application orchestration framework acts as the system’s control layer. It handles user interactions, intent recognition, workflow scheduling, and final answer generation through the LLM.
The deep document parsing engine operates as a backend data service. Its responsibilities are document parsing, vector storage, and precise retrieval.
This division keeps application logic separate from document processing.
2.2 API Integration Workflow
API communication provides a standard way to connect the components while keeping them decoupled. The workflow consists of four steps:
- Control the request flow: A user request reaches the orchestration framework, which triggers an HTTP request through a workflow node.
- Call the retrieval API: The framework sends the user’s query or relevant context to the retrieval API exposed by the document parsing engine.
- Receive retrieved content: The engine performs vector retrieval and reranking internally, then returns the highest-matching text chunks to the orchestration framework.
- Generate the answer: The framework combines the retrieved knowledge base context with the user’s question and passes them to the LLM to generate the final response.
This API-based integration preserves flexibility and extensibility. The underlying parsing engine can be upgraded or replaced without changing the main business workflow.
Depending on the business scenario, enterprises may also incorporate other open-source frameworks, such as graph-based retrieval-augmented generation (RAG) frameworks, to extend the system’s capabilities.
3. Container Deployment and Network Configuration
Containerized deployment is a common way to implement this hybrid architecture. Running multiple components on the same host, however, can introduce network configuration issues—especially port conflicts.
3.1 Understanding Port Mapping
In Docker Compose, a basic port mapping uses the format A:B:
Ais the port on the host.Bis the application’s listening port inside the container.
For example, 80:80 forwards traffic from port 80 on the host to port 80 inside the container. Port 80 is commonly used for HTTP, while port 443 is commonly used for HTTPS.
The container-side port is determined by the application’s configuration and generally does not need to be changed. The host-side port can be adjusted to accommodate ports already in use.
3.2 Avoiding Port Conflicts
If the orchestration framework and document parsing engine are deployed on the same host and both attempt to bind the same host port, such as 80 or 443, a port conflict occurs.
A practical solution is to change the host-side port mapping for one component—typically the backend parsing engine—while leaving its container-side port unchanged.
In the parsing engine’s docker-compose.yml file, locate the ports configuration. If the original mapping is 80:80, change it to 8080:80. Requests sent to port 8080 on the host will then be forwarded to port 80 inside the parsing engine’s container.
services:doc-parse-engine:# Other configuration omitted...ports:- "8080:80" # Map host port 8080 to container port 80- "8443:443" # Map host port 8443 to container port 443# ...
This adjustment resolves the host-port conflict without changing the application’s internal listening ports.
When configuring the external knowledge base API in the orchestration framework, use http://<host-IP>:8080/... as the request target for access through this host-port mapping.
4. Conclusion
Building an enterprise knowledge base Q&A system requires a balance between business workflow flexibility and document processing depth.
Combining an LLM application orchestration framework with a deep document parsing engine provides a practical way to achieve that balance. The orchestration layer supports flexible workflows and application development, while the parsing engine handles complex unstructured documents and retrieval.
API integration keeps these responsibilities loosely coupled, and careful container networking and port mapping help ensure stable deployment. This modular architecture provides a foundation for enterprise knowledge assets and intelligent applications as their requirements evolve.
