Enterprise Knowledge Base Q&A: Architecture Choices and Implementation

    This article explains how to choose an architecture for enterprise knowledge base question answering, where the real cost usually lies, and how to combine document parsing with workflow orchestration. It covers the capability boundaries of both approaches, a five-layer hybrid design, key retrieval engineering details, and the permissions, compliance, and evaluation practices needed to keep answers accurate and auditable.

    1. Why Enterprise Knowledge Base Q&A Is Hard

    Many teams can get a basic “upload document, ask a question, get an answer” pipeline running during a proof of concept. In an enterprise environment, however, the real cost is not model calls but data ingestion and fallback for answer quality. Enterprise documents come in highly varied forms: well-formatted digital reports, scanned files, image-based tables, merged cells that span pages, headers, footers, and watermarks, plus large volumes of contracts and tickets scattered across business systems as attachments. If any parsing step distorts the content, both retrieval and generation downstream will fail as a result.

    The first principle of architecture selection, therefore, is not “which platform has more features” but “which capability is the current bottleneck.” Two common technical approaches in the industry have different strengths: one is a retrieval-augmented approach known for deep document parsing, and the other is an application-building platform known for workflow orchestration and tool integration. They are not substitutes; they can be combined into a layered structure.

    2. Capability Boundaries of the Two Approaches

    2.1 Core Strengths of Document-Parsing Retrieval Solutions

    The value of these solutions is concentrated on “turning unstructured documents into high-quality retrievable chunks”:

    • Layout reconstruction: structural recognition of multi-column layouts, heading hierarchies, and mixed charts and text, avoiding compressing a whole page into a single unstructured block of text.
    • Optical character recognition: handling scanned files and image-based content by converting pixel information into retrievable text.
    • Templated chunking: differentiated chunking strategies for different genres such as papers, contracts, manuals, and tables, reducing semantic fragmentation.
    • High throughput and low latency: stable response under both batch ingestion and online query workloads.

    2.2 Core Strengths of Workflow-Orchestration Application Platforms

    These platforms focus on “how to package retrieval capability into a business application”:

    • Low barrier to entry: a visual orchestration interface lets non-specialist staff build prototypes, often completing an end-to-end demo within half an hour.
    • Modularity and secondary development: capabilities are exposed as nodes or components, making it easy to swap models and insert custom logic.
    • Tool ecosystem and task flows: support for function calling, external API integration, conditional branching, and loops, enabling multi-step agents.
    • Multi-knowledge-base routing: automatically selecting the target knowledge base based on question semantics, reducing false recalls in scenarios with many knowledge domains.

    2.3 Typical Weaknesses of a Single Approach

    Relying only on a parsing solution often means lacking process control, human-in-the-loop collaboration, and integration with business systems, so application-layer logic requires extensive in-house development. Relying only on an orchestration platform tends to produce “retrieved but incomplete content” on complex-layout documents, with answer quality locked by the parsing stage. This is exactly why a hybrid architecture is needed.

    3. Layered Design of a Hybrid Architecture

    The recommended design splits the system into five layers that communicate through standard interfaces, and any layer can be replaced independently:

    1. Ingestion layer: connects to business systems, shared directories, and object storage, handling incremental synchronization and deduplication.
    2. Parsing layer: performs layout analysis, recognition, table structuring, and chunking, outputting chunks with metadata.
    3. Index layer: maintains both a keyword inverted index and a vector index, with metadata used for filtering.
    4. Orchestration layer: handles query rewriting, multi-route recall, reranking, routing, and tool calls.
    5. Application layer: session management, citation tracing, feedback collection, and permission checks.

    The following is an illustrative contract for the parsing service, with neutral interface naming to make it easy to swap implementations:

    1. # Illustrative input/output contract for the parsing service
    2. def parse_document(file_uri: str, template: str) -> list[dict]:
    3. return [{
    4. "chunk_id": "c-001",
    5. "text": "……chunk body……",
    6. "page": 12,
    7. "metadata": {"dept": "finance", "level": "internal"},
    8. "score_hint": 0.0
    9. }]

    4. Key Engineering Details for Retrieval Quality

    • Hybrid retrieval: keyword recall is good at proper nouns and IDs, while vector recall is good at synonymous expressions; the two are fused and then normalized into a unified ranking.
    • Reranking: using a cross-encoder to fine-rank the top candidates is usually more effective than simply increasing the recall count.
    • Query rewriting: completing references, omissions, and multi-turn follow-ups, turning “what about its scope of application” back into a complete question.
    • Metadata filtering: first narrowing the candidate set by department, classification level, and time range, then ranking, balancing accuracy and compliance.
    • Context budget: controlling the assembled length and prioritizing high-information-density chunks to avoid truncating key information.

    5. Permissions, Compliance, and Operability

    Enterprise scenarios must answer three questions: who can ask, what can be asked, and what to do when an answer is wrong. It is recommended to place the permission check before retrieval rather than after generation, so sensitive content never enters the context; every answer should include source chunks and page numbers to form an auditable trail; and feedback on no-answer and low-score cases should be collected to create a data loop for continuous improvement. For operations, it is recommended to deploy parsing, indexing, and orchestration in separate containers, together with logging services and monitoring alerts, and to set threshold alerts for ingestion latency, recall hit rate, and timeout rate.

    6. Evaluation and Evolution Path

    Evaluation should cover three levels of metrics: the parsing layer looks at character accuracy and table structure fidelity; the retrieval layer looks at hit rate and average ranking position; the application layer looks at answer accuracy, citation coverage, and user adoption rate. The rollout is recommended in three steps: first use an orchestration platform to quickly validate business value, then introduce a parsing solution to fill the gap for complex documents, and finally consolidate a unified gateway and governance system. If an enterprise already uses relevant general capabilities from Baidu AI Cloud, categories such as object storage, container platforms, and logging and monitoring alerts can serve as the underlying foundation, while keeping interfaces standardized to avoid tight coupling with a single implementation.