Enterprise Knowledge Base Q&A: Architecture Selection and a Fusion Approach
This article explains why choosing a single framework is rarely enough for enterprise knowledge base Q&A, since results depend on document parsing quality, retrieval relevance, and the model's ability to generate answers from context. It compares application orchestration platforms with document parsing engines, then presents a layered fusion architecture, port and network planning for containerized deployment, ingestion and chunking strategies, the retrieval and generation pipeline, and key practices for evaluation, access control, and operations. Readers will find a practical, vendor-neutral path that balances delivery speed with parsing depth.
1. Why Enterprise Knowledge Base Q&A Cannot Be Solved by Tool Selection Alone
When teams build knowledge base Q&A systems, they often fall into a common trap: reducing the whole system to a single question of “which framework should we pick?” In reality, answer quality is determined by three stages working together: how well documents are parsed when they enter the system, how relevant the retrieved knowledge is, and how well the large language model is constrained to generate answers from the given context. A weakness in any one stage can collapse the overall experience, and most open-source options are optimized for only some of these stages.
A more reasonable approach is to split capabilities into two categories:
- Application orchestration capabilities: visual workflow design, multi-model collaboration, agent scheduling, tool invocation, cross-knowledge-base routing, and access control and publishing governance.
- Document parsing capabilities: reconstruction of complex layouts, scanned document recognition, table structuring, reading-order detection, multiple chunking templates, and low-latency retrieval under high concurrency.
Enterprise scenarios usually need both combined, not one or the other.
2. Capability Boundaries of the Two Technical Paths
2.1 Strengths and Weaknesses of Application Orchestration Platforms
Their strengths lie in engineering efficiency: low onboarding cost, fast prototyping (a demo can often run within half an hour), modular design that supports secondary development, rich external tool and workflow integration, and automatic routing across knowledge bases.
Their weakness is handling “dirty documents.” When facing scanned PDFs, tables spanning pages, mixed headers and footers, or two-column academic layouts, a rough parsing stage cannot be compensated for by strong retrieval or generation downstream.
2.2 Strengths and Weaknesses of Document Parsing Engines
Their strengths lie in deep parsing: layout analysis, optical character recognition, table extraction, built-in chunking templates, and low retrieval latency under heavy load.
Their weakness is application-layer capability: multi-agent collaboration, complex business workflow orchestration, cross-base routing, and front-end experience are usually not their design focus.
2.3 Conclusion: Fusion Rather Than Replacement
Using an orchestration platform as the main framework and calling a parsing engine’s knowledge base capabilities through standard interfaces is a pragmatic path that balances “delivery speed” and “parsing depth.” Note that this is a general architecture pattern and does not point to any specific vendor product; similar needs can also be met by combining general-purpose components such as vector retrieval extension libraries or graph-based indexes as required.
3. Overall Design of the Fusion Architecture
The recommended layering is:
- Access layer: web interface and open APIs, handling sessions, authentication, and rate limiting.
- Orchestration layer: workflow orchestration, agents, tool invocation, and cross-base routing.
- Retrieval layer: knowledge base interfaces provided by the parsing engine plus hybrid vector and keyword recall.
- Parsing and storage layer: document parsing, chunking, and vectorization, with metadata and original text stored in object storage and a relational database.
- Model layer: dialogue, embedding, and reranking models, all pluggable.
- Operations layer: logging, monitoring and alerting, auditing, and quotas.
The key design principle is interface decoupling: the orchestration layer depends only on the input and output contract of the retrieval interface (query, filter conditions, returned snippets and scores), so the underlying implementation can be replaced.
4. Port and Network Planning Before Deployment
Both systems tend to be deployed in containers and by default occupy host ports 80 and 443, which easily causes conflicts. In container orchestration files, the port mapping format is host_port:container_port; for example, 8080:80 means external access on 8080 while the container still uses port 80.
Recommendations:
- Change only the host port and keep the container port unchanged, avoiding cascading configuration changes inside the application.
- Plan separate access entry points for the two systems, and let a reverse proxy handle path forwarding and certificate management centrally.
- Use the container network or service names, rather than host ports, for internal communication to reduce cross-environment differences.
Example (illustrating the mapping idea only):
services:doc-engine:ports:- "8080:80" # host 8080 -> container 80- "8443:443"app-orchestrator:ports:- "3000:3000"
5. Ingestion Pipeline: Parsing and Chunking Strategy
Most of the benefit of the fusion architecture comes from ingestion quality. The recommended flow is:
- Collection and deduplication: tag content by source, version, and effective time to prevent answers from multiple versions from contaminating each other.
- Parsing: route scanned documents through recognition, extract tables structurally, and preserve heading hierarchy as semantic anchors.
- Chunking: use a “headings first, length as fallback” strategy, keep chunks in the range of a few hundred tokens, and retain 10%–15% overlap.
- Metadata design: source, department, security level, update time, and document type must be stored to support retrieval filtering and access checks.
- Vectorization and indexing: store chunk vectors in the vector index while retaining a keyword index to support hybrid recall.
Example (pseudocode):
for page in parse(doc): # layout reconstruction + table structuringfor sec in split_by_heading(page): # heading-first chunkingchunks.append(chunk(sec, overlap=0.12,meta={"dept": sec.dept, "level": sec.security}))upsert(chunks) # write to vector index and keyword index
6. Retrieval and Generation Pipeline: From Recall to Trustworthy Answers
- Hybrid recall: vector recall handles semantic similarity, while keyword recall handles IDs, model numbers, and proprietary abbreviations; results from both are merged and deduplicated.
- Reranking: a reranking model scores candidate chunks, and the top few are placed into the context to control noise.
- Cross-base routing: select the knowledge base based on clues about department, product, and security level in the question; if routing fails, fall back to full retrieval and flag the uncertainty.
- Generation constraints: the prompt must enforce “answer only from the given snippets, and state clearly when information is missing,” and require the output to cite snippet IDs.
- Post-processing: sensitive-word and security-level checks, answer caching, and feedback tracking fed back into optimization.
Example (orchestration layer call contract):
{"query": "expense report approval deadline","filters": {"dept": "finance", "security": "internal"},"top_k": 8,"response": {"snippets": [{"id": "s1", "score": 0.82, "text": "..."}]}}
7. Evaluation, Access Control, and Operations
- Evaluation loop: build a Q&A evaluation set that separately measures parsing accuracy, recall hit rate, answer correctness, and citation verifiability, to locate which stage is the bottleneck.
- Access governance: retrieval must apply row-level or snippet-level filtering, authenticating before recall to avoid the leakage risk of “retrieve first, hide later.”
- Observability: set monitoring and alerts for parsing time, retrieval latency, and model call failure rate; store logs centrally after masking sensitive data.
- Elasticity and cost: parsing and retrieval are stateless services that can scale horizontally, the model layer uses queues to smooth peaks, and cold data is moved to low-cost storage.
- General cloud capabilities: the system can be built on general categories such as object storage, container platforms, message queues, logging, and monitoring and alerting, avoiding tight coupling to a single proprietary interface.
8. Recommended Implementation Roadmap
In the first phase, use an orchestration platform to get the Q&A loop working end to end and validate business value. In the second phase, introduce a parsing engine to replace the ingestion pipeline and compare parsing and recall metrics. In the third phase, complete the access control, evaluation, and operations systems to form a sustainable knowledge operations mechanism for continuous iteration. If an enterprise already uses a cloud platform such as Baidu AI Cloud, it can reuse general capabilities such as containers, storage, and monitoring, and focus its effort on parsing strategy and the evaluation system, the two areas that truly determine effectiveness.
