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

    This article explains why choosing a single platform is often insufficient for enterprise knowledge base Q&A, and how to combine a deep document parsing service with a workflow and agent orchestration platform. It covers capability comparison and selection criteria, a four-layer architecture design, port and network planning for containerized deployment, and step-by-step integration that exposes retrieval as a tool. Engineering practices such as layered chunking, hybrid retrieval, citation traceability, caching, observability, and permission alignment are also discussed, along with a three-layer evaluation approach and a phased rollout plan.

    1. Background: Why Picking One Platform Is Usually Not Enough

    When enterprises deploy knowledge base Q&A, the most common debate is which single platform to choose. In real projects, the question itself is flawed. An enterprise knowledge base is not a single capability problem but a stack of at least three: document parsing and knowledge processing, retrieval and generation orchestration, and application delivery and operations. No single open-source solution excels at all three at once, so a more pragmatic approach is to decouple the layers and combine tools.

    A typical split is to let a deep document parsing retrieval service turn PDFs, scanned files, and complex tables into searchable structured chunks, while a workflow and agent orchestration platform handles multi-turn dialogue, task branching, tool calls, and the front-end experience. The two connect over standard HTTP APIs, forming a hybrid architecture that is replaceable and extensible.

    2. Capability Profiles and Selection Criteria

    2.1 Strengths of Deep Document Parsing Services

    • Strong layout reconstruction for complex documents, including multi-column layouts, headers and footers, and cross-page tables;
    • Built-in OCR and multiple chunking templates, with chunk granularity tunable for scenarios such as Q&A pairs, tables, and papers;
    • Engineering optimizations for high concurrency and latency-sensitive workloads, making them suitable as an independent knowledge processing layer that scales horizontally.

    2.2 Strengths of Workflow Orchestration Platforms

    • Low barrier to entry; visual orchestration can produce a working prototype in a short time;
    • Modular design that supports secondary development, external tool mounting, and custom code nodes;
    • Cross-knowledge-base routing that automatically selects the target knowledge base based on the question, which is critical for enterprises with many knowledge domains;
    • Agent capabilities that can wrap retrieval as a tool, letting the upper layer decide when to retrieve and how many times.

    2.3 How to Decide

    Selection should not be based on the length of a feature list but on three measurable dimensions: document complexity (share of scanned files, table density), number of knowledge domains (whether routing is needed), and process complexity (whether multi-step tool calls and human confirmation are required). The more complex and unstructured the documents, the more reason to separate the parsing layer; the longer the process and the more roles involved, the more reason to separate the orchestration layer.

    3. Overall Hybrid Architecture

    A four-layer structure is recommended: application, orchestration, knowledge, and infrastructure.

    1. Application layer: chat interface, admin console, permissions and audit;
    2. Orchestration layer: workflows, agents, prompt version management;
    3. Knowledge layer: document parsing, chunking, vectorization and retrieval services, exposing only a small number of APIs;
    4. Infrastructure layer: container platform, object storage, logging, monitoring and alerting.

    The key constraint is that the knowledge layer exposes capabilities only through APIs, and the orchestration layer is unaware of the underlying index implementation. Replacing the parsing engine or the index engine then requires zero changes to upper-layer flows.

    4. Port and Network Planning Before Deployment

    Both types of platforms officially recommend containerized deployment, and the most common failure on a shared host is a port conflict. Port mappings in container orchestration files follow the format host port:container port — for example, 80:80 maps host port 80 to container port 80 (HTTP), and 443:443 maps HTTPS.

    The rule is to change only the host port and keep the container port unchanged, so addresses hard-coded inside the application do not break.

    1. services:
    2. knowledge-engine:
    3. ports:
    4. - "8080:80" # was 80:80, host port changed to 8080
    5. - "8443:443" # was 443:443, host port changed to 8443
    6. workflow-platform:
    7. ports:
    8. - "80:80"
    9. - "443:443"

    If a reverse proxy provides a single entry point, route by path prefix (for example, /kb/ to the knowledge layer and everything else to the orchestration layer), and handle TLS, timeouts, and request body size limits at the proxy. Document upload APIs need much higher body size limits and longer timeouts than ordinary chat APIs.

    5. Integration: Wrapping Retrieval as a Tool

    Integration takes three steps: the knowledge layer exposes APIs, the orchestration layer registers them as a tool, and the flow calls the tool.

    1. # 1) Create a knowledge base (illustrative)
    2. curl -X POST "http://127.0.0.1:8080/api/v1/datasets" \
    3. -H "Authorization: Bearer $KB_KEY" \
    4. -H "Content-Type: application/json" \
    5. -d '{"name":"hr_docs","chunk_method":"qa"}'
    6. # 2) Upload and parse a document (illustrative, multipart upload)
    7. curl -X POST "http://127.0.0.1:8080/api/v1/datasets/hr_docs/documents" \
    8. -H "Authorization: Bearer $KB_KEY" \
    9. -F "file=@policy.pdf"
    10. # 3) Trigger parsing and retrieval
    11. curl -X POST "http://127.0.0.1:8080/api/v1/datasets/hr_docs/chunks" \
    12. -H "Authorization: Bearer $KB_KEY" \
    13. -H "Content-Type: application/json" \
    14. -d '{"question":"How is annual leave calculated","top_k":6}'

    In the orchestration layer, configure the retrieval action above as a tool node that takes the rewritten query as input and returns a list of chunks; a large model node then synthesizes the answer and adds citations. If the platform supports cross-knowledge-base routing, register each knowledge base separately and let a routing node pick the target based on question semantics, falling back to general Q&A when nothing matches.

    Illustrative flow:

    1. User question → query rewriting → knowledge base routing → deep retrieval (knowledge layer)
    2. → reranking and deduplication → answer synthesis (with citations) → fallback → output

    6. Engineering Practices

    • Layered chunking: use Q&A chunking for policy documents, long chunks with overlap for manuals, and a separate knowledge base for tables;
    • Hybrid retrieval: run keyword and vector retrieval in parallel, then rerank together, which significantly reduces missed recall for proper nouns and identifier-style questions;
    • Traceable citations: answers must carry the source file and location, which is the dividing line for passing enterprise review;
    • Caching and rate limiting: route frequent questions through a semantic cache and set quotas on parsing and retrieval APIs so bulk uploads do not degrade live Q&A;
    • Observability: instrument parsing failure rate, recall hit rate, and time to first token separately, and close the loop with logging and alerting;
    • Consistent permissions: document-level permissions in the knowledge layer must align with user identity in the orchestration layer, otherwise unauthorized recall occurs.

    7. Evaluation and Rollout

    A three-layer evaluation approach is recommended: the parsing layer is measured on layout reconstruction and chunking accuracy; the retrieval layer on hit rate and citation correctness; the application layer on answer usability and human takeover rate. For rollout, get a prototype working with a small document sample within two weeks, then expand knowledge domains and process branches step by step, and finally enable monitoring and canary releases. If the enterprise already has a cloud container platform and object storage, deploy the parsing service statelessly for elastic scaling, and rely on persistent storage with regular backups for indexes and metadata.