Enterprise Knowledge Base Q&A: A Hybrid Architecture Approach
This article explains why enterprise knowledge base Q&A is difficult to build and how to address it with a hybrid architecture that separates orchestration from document processing and retrieval. It compares the two capability types, outlines a four-layer target architecture with a neutral retrieval request contract, and covers deployment details such as port mapping, reverse proxy, network isolation, and persistence. It also shares key engineering practices for parsing, chunking, hybrid retrieval, multi-base routing, access control, and evaluation, plus common pitfalls and a phased evolution path.
1. Why Enterprise Knowledge Base Q&A Is Hard
Enterprise knowledge base Q&A differs from a general-purpose chatbot in three main ways: documents are complex, business workflows are long, and answers must be traceable. Real enterprise corpora are full of scanned contracts, financial reports with nested tables, and technical specifications with headers and footers. Plain text extraction often loses layout semantics. In addition, a single request is rarely “retrieve once and answer.” It may first require intent recognition, permission checks, and multi-base routing, then decide whether to call a computation tool or a business system API.
So the selection question should not be “which platform is better,” but “which layer owns which capability.” The industry is converging on a layered approach: an upper orchestration and interaction layer handles workflows, agents, and multi-model collaboration; a lower document processing and retrieval layer handles parsing, chunking, indexing, and recall. The two layers are decoupled through stable interface contracts, so each can evolve independently instead of being locked into the capability boundaries of a single framework.
2. Comparing the Two Capability Types
Solutions built for deep document processing typically have these traits: built-in layout analysis models that distinguish headings, body text, tables, and captions; optical character recognition for scanned files; multiple chunking templates for different document types; and good throughput for high-concurrency, latency-sensitive scenarios.
Orchestration-oriented frameworks have different strengths: low onboarding cost, where a visual workflow can get a prototype running; high modularity for secondary development; strong tool ecosystems and task orchestration with conditional branches, loops, and parallelism; and cross-base routing that selects a target knowledge base based on the query.
Placed side by side, their weaknesses are complementary. Orchestration frameworks are weaker at parsing complex layouts, while retrieval frameworks are thinner on multi-step workflows and tool ecosystems. That is the motivation for a hybrid architecture.
3. Target Architecture: Orchestration Layer Plus Retrieval Layer
The recommended target architecture has four layers:
- Access layer: conversation channels, single sign-on, and an audit entry point.
- Orchestration layer: intent recognition, multi-base routing, workflows and agents, multi-model scheduling, and result reranking and citation assembly.
- Retrieval layer: document parsing, chunking, vector and keyword indexing, hybrid recall, and reranking.
- Data and operations layer: object storage for original files, logging services with monitoring and alerting, and evaluation dataset management.
The two layers expose only three interfaces: document upload and parsing task submission, task status query, and retrieval request. A retrieval request can be abstracted into the following illustrative structure, with neutral, implementation-agnostic fields:
{"query": "Q3 return policy for the East region","top_k": 20,"filters": {"tenant": "east", "acl_tag": "sales"},"hybrid": {"vector_weight": 0.7, "keyword_weight": 0.3},"rerank": true,"return_meta": ["doc_id", "page", "snippet"]}
Returned results must include the document identifier, page number, and snippet. This is the foundation for citation tracing and human review.
4. Deployment: Ports and Network Planning
Both component types are usually deployed as containers, and the most common pitfall is host port conflicts. In a container orchestration file, the port mapping format is “host port:container port.” For example, 80:80 maps host port 80 to container port 80, and 443:443 passes HTTPS through. When two systems run on the same machine, keep the container ports unchanged and only change the host-side mapping, for example changing 80:80 to 8080:80 and 443:443 to 8443:443, to avoid startup failures or incorrectly routed requests.
Beyond ports, three points matter. First, use a unified reverse proxy entry point that exposes only one domain and certificate externally and forwards internally by path prefix. Second, segment the network so the retrieval layer is not exposed to the public internet and is reachable only from the orchestration layer over the internal network. Third, ensure persistence by mounting original files, indexes, and database volumes to separate storage so data survives container rebuilds.
5. Key Engineering Details
Document parsing strategy. Not every file needs heavy parsing. Start with type detection: documents with copyable text go through lightweight extraction, scanned files and complex tables go through layout analysis plus recognition, and code and logs are chunked line by line. This balances cost and quality.
Chunking and indexing. Chunk granularity affects recall quality. Chunk along semantic boundaries and keep the section path as metadata. Run vector and keyword indexes together for hybrid recall, then use a reranking model for fine ordering. Store tables whole with a header description so they are not cut in half.
Multi-base routing. Let the orchestration layer classify the query first, then choose the target base. This significantly reduces noise. Combine rules with a model fallback: rules cover frequent, clear cases, and the model handles the long tail.
Permissions and security. Permission filtering must be pushed down to the retrieval layer, not applied by deleting items after results are returned, otherwise content leaks through snippets. Every request carries a tenant and access tag, and the index side stores the same tag.
Evaluation system. Build a fixed evaluation set covering four question types: single-hop facts, multi-hop reasoning, table values, and negation and refusal. Metrics should include at least recall hit rate, citation accuracy, answer faithfulness, and refusal accuracy. Run a regression pass after every change to chunking or prompts.
6. Common Pitfalls and Evolution Advice
The first pitfall is pinning all hopes on prompts while ignoring parsing quality; if parsing is wrong, no amount of prompt tuning can recover. The second is pursuing full automation too early, without human review and a feedback loop, which lets errors accumulate. The third is tightly coupling orchestration and retrieval, which makes upgrades difficult.
A three-step evolution path is recommended. First, use the orchestration layer with basic retrieval to close the loop and collect real questions. Then introduce hybrid recall and reranking, and improve citation tracing. Finally, split knowledge bases and evaluation sets by business domain, gradually add a message queue for asynchronous parsing to smooth peaks, use a container platform for elastic scaling, and track latency and failure rates with monitoring and alerting. If an organization already uses relevant Baidu AI Cloud products, general capabilities such as object storage, container platform, logging, and monitoring can serve as the foundation, letting the team focus on parsing and orchestration, the two areas that truly determine quality.
