Hybrid Architecture for Enterprise Knowledge Base Q&A: A Practical Guide

    This article explains why enterprise knowledge base Q&A should not be treated as a choice between document retrieval platforms and visual workflow platforms. It compares the strengths of both, then presents a hybrid architecture with an orchestration layer and a retrieval capability layer connected by a minimal HTTP contract. It also covers deployment and network isolation, core retrieval pipeline design, permission enforcement and auditing, evaluation metrics, and a phased evolution roadmap.

    1. The Real Problem: Layered Collaboration, Not Either-Or

    In discussions about enterprise knowledge base Q&A, a common mistake is comparing two types of solutions on the same dimension to decide which one is better. In practice, they solve problems at different stages of the pipeline: one focuses on deep parsing of unstructured documents and retrieval quality, while the other focuses on application orchestration, agent scheduling, and interaction delivery. Treating them as a “retrieval capability layer” and an “application orchestration layer” is more useful from an engineering perspective than forcing a winner.

    A complete Q&A pipeline typically has six stages: document ingestion, parsing and chunking, indexing and recall, reranking and generation, orchestration and tool invocation, and permissions and auditing. No single solution can be optimal at all six stages, which makes a hybrid architecture the more pragmatic choice.

    2. Capability Profile of the Two Solution Types

    2.1 Strengths of Document Parsing and Retrieval Solutions

    • Strong handling of complex layouts: for scanned files, double-column layouts, and cross-page tables, they typically combine layout analysis, table structure reconstruction, and optical character recognition.
    • Rich chunking templates: differentiated chunking strategies for different document types reduce the semantic breaks caused by a one-size-fits-all approach.
    • Optimized for high load: horizontal scaling and caching are easier in concurrent retrieval and latency-sensitive scenarios.

    The trade-off is that application-layer capabilities are relatively weak. Orchestration, multi-turn dialogue state management, and external tool integration usually require additional work.

    2.2 Strengths of Visual Orchestration and Workflow Solutions

    • Low barrier to entry: a usable prototype can be produced through UI-based configuration, often with deployment validated within tens of minutes.
    • Modular design that is friendly to secondary development and private deployment integration.
    • Support for workflow orchestration, agent scheduling, and external tool extension, with strong application assembly capabilities.
    • Support for cross-knowledge-base routing, automatically selecting the appropriate knowledge base based on the question, which is often missing in retrieval solutions.

    The trade-off is that parsing accuracy may become the bottleneck for overall Q&A quality when facing low-quality scans and complex tables.

    3. Hybrid Architecture Design: Orchestration-Led, with the Parsing Layer as a Capability Backend

    The recommended form is a combination of an “orchestration layer + retrieval capability layer”: the orchestration layer handles interaction, flows, and agents, while the retrieval capability layer exposes document parsing, chunking, indexing, and retrieval through standard interfaces. Decoupling the two with an interface contract means either layer can be replaced and upgraded independently.

    Layered diagram:

    1. Users / business systems
    2. |
    3. Application orchestration layer (workflow / agents / tool invocation)
    4. | Standard HTTP API
    5. Retrieval capability layer (parsing / chunking / indexing / recall / reranking)
    6. |
    7. Object storage + vector index + relational metadata database

    Keep the interface contract to a minimal set, and avoid leaking the internal implementation details of either layer into the contract:

    1. # Minimal API exposed by the retrieval capability layer (illustrative)
    2. POST /api/v1/documents # Upload a document, return doc_id
    3. POST /api/v1/chunk # Trigger parsing and chunking, return chunk statistics
    4. POST /api/v1/retrieve # Input: query, top_k, kb_ids, filters
    5. # Output: chunks[{text, score, doc_id, page}]

    4. Deployment and Network Isolation: The Easiest Place to Go Wrong

    Both solution types tend toward containerized deployment. When they coexist on the same host, the first issue is port and reverse proxy conflicts. The principle is to “change only the host port mapping, not the container ports,” which avoids breaking existing service discovery and self-signed certificate configurations inside the images.

    1. # Illustrative: host port 8080 mapped to container port 80, container ports unchanged
    2. services:
    3. retrieval:
    4. ports:
    5. - "8080:80"
    6. - "8443:443"

    Additional recommendations:

    • Unified entry point: a reverse proxy routes by path prefix, for example /chat to the orchestration layer and /kb to the retrieval layer.
    • Internal communication: the two layers communicate over internal addresses and internal ports, not exposed to the public internet.
    • Resource isolation: parsing and embedding computation are resource-intensive and should be deployed separately to avoid competing with online Q&A for compute.
    • Data tiering: raw files go to object storage, metadata to a relational database, and vectors to a vector index, each with its own backup strategy.

    5. Key Retrieval Pipeline Design Decisions

    1. Hybrid recall: keyword recall and vector recall run in parallel, then results are fused and reranked, covering both exact matching of proper nouns and semantic similarity.
    2. Reranking: a second scoring pass over candidate chunks is the most cost-effective step for improving answer accuracy.
    3. Context budget: set limits on the number and length of chunks in the prompt to prevent noise from crowding out useful information.
    4. Citation traceability: returned chunks must carry the document identifier and page number, and the answer side must show the source. This is a hard requirement for enterprise scenarios.
    5. Incremental updates: document changes go through version numbers and incremental indexing to avoid service disruption from full rebuilds.

    6. Permissions, Auditing, and Compliance

    Enterprise knowledge bases often involve sensitive information. Permissions must be enforced at the retrieval layer rather than only filtered at the presentation layer; otherwise, they leak through cited chunks. Recommended practices include tagging documents and chunks with access labels, passing the caller’s identity with each retrieval request, and applying row-level filtering to recall results based on labels; logging the full Q&A chain, matched documents, and operators, centralizing logs in a logging service with monitoring and alerting configured; and applying data masking and egress policy controls to external model calls.

    7. Evaluation: Metrics Instead of Gut Feel

    • Retrieval layer: recall hit rate, chunk relevance score, average latency.
    • Generation layer: answer accuracy, citation accuracy, refusal rate (refuse rather than fabricate when there is no supporting evidence).
    • Engineering layer: concurrent throughput, retry failure rate, index update latency.

    Build a fixed evaluation set and include it in continuous integration. Run a regression pass every time the chunking strategy or prompts change, to avoid fixing one scenario and breaking three others.

    8. Evolution Roadmap

    In the first phase, use the orchestration layer to quickly produce a prototype and validate business value. In the second phase, introduce the parsing capability layer to replace the default parser and resolve the complex document bottleneck. In the third phase, complete the permissions, auditing, and evaluation systems. In the fourth phase, expand by scenario, such as introducing graph-structured indexing for multi-hop questions and lightweight retrieval to reduce resource usage. If the enterprise already has infrastructure such as a container platform, object storage, and monitoring and alerting, it can be reused to reduce duplicate work.