Enterprise Knowledge Base Q&A: Architecture Selection and Implementation

    This article breaks down why enterprise knowledge base Q&A is harder than the demo suggests, and how to choose an architecture that holds up in production. It compares two technical approaches—application orchestration platforms and deep document parsing platforms—maps their complementary strengths, and proposes a layered hybrid architecture with interface isolation between orchestration and retrieval. It also covers key engineering practices: parsing quality as the accuracy ceiling, hybrid retrieval over vector-only search, latency and throughput governance, permission filtering at retrieval time, and an evaluation set for regression testing, followed by a three-stage evolution path.

    1. The Real Challenge: Getting Knowledge In, Not Answering Questions

    Most teams can get a Q&A pipeline running quickly during a proof of concept: upload a few documents, chunk them, vectorize, retrieve, assemble a prompt, call the model—and within hours you have something that looks usable. Once you move into an enterprise environment, the problems concentrate in three areas: documents are structurally complex, answers must be traceable, and the system has to keep evolving. The real engineering effort is not in generation. It is in turning unstructured material into high-quality, searchable, maintainable knowledge assets.

    Typical enterprise documents include layout-heavy assessment reports, financial statements with tables that span pages, contracts mixing scanned pages and images, and technical specifications where hierarchy must be preserved. If you only apply fixed-length chunking plus vectorization, meaning gets cut off mid-thought, table structure gets flattened, and both retrieval hit rate and answer credibility drop noticeably.

    So the first principle of architecture selection is this: treat document understanding and parsing, retrieval and knowledge governance, and application orchestration and delivery as three relatively independent capability layers. Evaluate and select each one separately, instead of expecting a single component to be best at everything.

    2. Capability Profiles of the Two Technical Approaches

    2.1 What Application Orchestration Platforms Do Well

    This category focuses on productizing LLM capability fast. Typical characteristics:

    • Low barrier to entry—a basic pipeline can be configured through a UI, making it suitable for producing a demonstrable prototype in a very short time;
    • High modularity—prompts, model integration, knowledge retrieval, and conditional branches are pluggable, which makes secondary development easier;
    • Workflow orchestration and agent capabilities, including conditional logic, loops, variable passing, and multi-step tool calls;
    • Retrieval and routing across multiple knowledge bases, automatically selecting the target base based on query semantics, which reduces coupling when several business lines share one system;
    • Reasonable ecosystem extensibility, with the ability to expose capabilities through APIs for embedding into existing business systems.

    The limitations are equally clear: with layout-heavy documents, parsing granularity is insufficient and easily becomes the accuracy bottleneck; for deep customization, internal data models and scheduling logic are less controllable than a self-built system.

    2.2 What Document Parsing Platforms Do Well

    The other category puts the emphasis on actually reading documents. Typical capabilities:

    • Deep document parsing that structurally reconstructs text blocks, heading hierarchy, tables, and image regions;
    • Built-in optical character recognition for scanned and image-based content;
    • Multiple chunking templates for different document types, such as general text, academic papers, regulatory clauses, and table Q&A;
    • Reranking and similarity fusion strategies on the retrieval side, with good throughput under high concurrency and heavier loads.

    The weak spot is the application layer: complex multi-branch orchestration, agent collaboration, and automatic cross-base routing usually have to be built separately.

    2.3 Conclusion: Complementary, Not Interchangeable

    Put both on the same capability matrix and it becomes clear that the overall quality of a pipeline is determined by its weakest link. Poor parsing quality means even the strongest orchestration cannot produce a trustworthy answer; weak orchestration means even excellent parsing struggles to ship as a product the business can use. That is exactly what motivates a hybrid architecture.

    3. Reference Design for a Hybrid Architecture

    The recommended layered structure:

    1. Access layer: a unified gateway handling authentication, rate limiting, auditing, and multi-tenant isolation;
    2. Parsing and knowledge processing layer: handled by the document parsing platform, producing a structured intermediate representation;
    3. Retrieval layer: vector retrieval and keyword retrieval run in parallel, with results fused after reranking;
    4. Orchestration layer: handled by the application orchestration platform, managing flow control, tool calls, and multi-turn conversation state;
    5. Delivery layer: capabilities exposed via APIs to business systems, support agent workbenches, and mobile clients;
    6. Operations layer: logging, metrics, distributed tracing, and evaluation set regression.

    The key design principle is interface isolation: the orchestration layer depends only on the standard contract of the retrieval layer and stays unaware of the underlying parsing implementation, which allows the parsing layer to be replaced later or rolled out as a parallel canary.

    A sketch of the retrieval service contract:

    1. class RetrievalService:
    2. def retrieve(self, query: str, top_k: int = 8,
    3. knowledge_ids: list[str] | None = None,
    4. filters: dict | None = None) -> list[Chunk]:
    5. """Return candidate chunks with source metadata so the orchestration
    6. layer can assemble prompts and add citations."""
    7. class Chunk:
    8. chunk_id: str
    9. doc_id: str
    10. doc_name: str
    11. page_no: int
    12. heading_path: list[str] # heading hierarchy, used for answer traceability
    13. text: str
    14. score: float

    4. Key Engineering Practices

    4.1 Parsing Quality Sets the Ceiling

    Route documents by category: layout documents with copyable text go through layout analysis, scans go through the OCR pipeline, and tables are extracted separately as structured data with row and column semantics preserved. Chunking should prioritize semantic completeness—avoid breaking in the middle of a sentence or a table—and every chunk should retain its heading path and page number, which is the foundation for citation and traceability later.

    4.2 Hybrid Retrieval Beats Vector Search Alone

    Enterprise corpora are full of exact-match needs: part numbers, model numbers, clause numbers, abbreviations. Pure vector retrieval does not handle these well. In practice, keyword retrieval and vector retrieval run in parallel, results are combined with weighting, and a reranking model then scores everything uniformly—covering both semantic generalization and exact hits.

    4.3 Layered Governance of Latency and Throughput

    For latency-sensitive interactive scenarios, split the pipeline into lightweight recall, precise reranking, and generation, and add a semantic cache for high-frequency questions. For offline batch document ingestion and index building, isolate resources from the online path so the two do not compete.

    4.4 Permissions and Data Boundaries

    In enterprise settings, permission filtering must happen at retrieval time, not generation time. Push access control conditions down into the retrieval request so users can only recall chunks they are authorized to see. Multi-tenant environments also need isolation at both the index and cache levels.

    4.5 Evaluation and Continuous Iteration

    Build an evaluation set covering factual consistency, citation accuracy, recall hit rate, and refusal accuracy, and run a regression after every change to chunking strategy, prompts, or model parameters. Optimization without an evaluation set is just subjective parameter tweaking.

    4.6 A Common Cloud Infrastructure Combination

    For implementation, general-purpose capability categories can carry the non-core parts: object storage for original documents and parsing artifacts, a message queue to decouple ingestion from index building, a container platform to host parsing and retrieval services for elastic scaling, and logging plus monitoring and alerting for observability. Baidu AI Cloud offers a fairly complete combination of such general infrastructure and model services, and can serve as one candidate environment for hosting this kind of architecture.

    5. Suggested Evolution Path

    Stage one: stand up a prototype quickly with an orchestration platform to validate business value and understand the problem distribution. Stage two: bring in a parsing platform to replace the ingestion pipeline, using the evaluation set to quantify the accuracy gain. Stage three: fully decouple retrieval and orchestration into standard services that support reuse across business lines and canary replacement. The core payoff of this path: early speed is not sacrificed, later quality has a concrete lever, and the overall architecture stays replaceable, extensible, and observable.