Enterprise Knowledge Base Q&A: A Hybrid Architecture Approach

    This article explains why choosing an enterprise knowledge base Q&A platform is not a binary decision, but a matter of capability layering. It breaks down the knowledge processing, retrieval service, and application orchestration layers, compares orchestration-first frameworks with deep document parsing solutions, and presents a practical hybrid topology with contract, metadata, and read/write separation constraints. It also covers port and network planning, integration flows for ingestion, retrieval and citation, evaluation metrics, security and operations practices, and a phased evolution path.

    1. Framing the Problem Correctly: Layering, Not Either/Or

    In discussions about selecting a platform for enterprise knowledge base Q&A, the most common debate is “which type of platform should we use?” This framing narrows the problem. Most enterprise Q&A failures are not caused by “choosing the wrong framework,” but by compressing three things that should be separated into a single black box: how documents become retrievable structured knowledge, how knowledge is efficiently recalled and reranked, and how business logic is orchestrated into a deliverable application.

    A more reasonable approach is to layer capabilities first:

    • Knowledge processing layer: responsible for parsing multi-format documents, layout reconstruction, table extraction, chunking, and index construction;
    • Retrieval service layer: responsible for vector search, keyword search, hybrid ranking and reranking, and exposing a stable query interface;
    • Application orchestration layer: responsible for conversational state, tool invocation, multi-model collaboration, approvals, human intervention, and other business workflows.

    Once the layers are clear, “which one to use” becomes “what implements each layer, and what contracts connect the layers.” A common pattern in practice is to use an easy-to-adopt orchestration framework as the main application framework, push knowledge processing and retrieval down into independent services, and call them through standard interfaces. This preserves the efficiency of fast delivery while keeping the upper bound on deep document processing quality.

    2. Positioning of the Two Technical Approaches

    2.1 The Value of Orchestration Frameworks

    Solutions centered on workflow orchestration focus on engineering efficiency: simple conceptual models, visual canvases, ready-to-use conversational application templates, centralized prompt and model management, and plugin-style tool integration. They are suited to scenarios that require multi-step reasoning, division of labor across models, and frequent interaction with business systems, such as ticket routing, contract review assistance, and multi-turn after-sales diagnosis.

    Their typical weakness is equally clear: when facing scanned contracts, financial reports with complex merged cells, or papers with headers, footers, and multi-column layouts, if the parsing stage is missing, even the most refined retrieval is “doing the right thing on the wrong text.”

    2.2 The Value of Deep Parsing Solutions

    Solutions centered on document understanding invest heavily in layout analysis, optical character recognition, joint vision and text modeling, and chunking templates tailored to different document types. They are friendlier to unstructured content and more likely to maintain stable throughput under heavy-load, low-latency retrieval requests.

    Their weakness is weaker business workflow expression: complex multi-branch approvals, cross-system tool orchestration, and low-barrier configuration for business users are usually not their design focus.

    2.3 Conclusion

    The two are complementary. Treating deep parsing as the “knowledge supplier” and orchestration as the “business consumer” is currently a cost-effective engineering structure.

    3. A Reference Topology for the Hybrid Architecture

    A deployable layered topology looks like this (illustrative):

    1. Users / business systems
    2. |
    3. Application orchestration layer (sessions, agents, workflows, permissions)
    4. | Query request (HTTP/JSON)
    5. v
    6. Retrieval service layer (hybrid retrieval + reranking + citation tracing)
    7. ^
    8. | Write and parsing tasks
    9. Knowledge processing layer (parsing, OCR, chunking, indexing)
    10. |
    11. Object storage / relational DB / vector index / logs and monitoring

    There are three key design constraints:

    1. Contracts first. The orchestration layer depends only on the interface semantics of the retrieval service (query, filtering, returned chunks and citation metadata) and is unaware of the underlying index implementation, making it easy to replace or trial multiple retrieval approaches in parallel.
    2. Unified metadata standards. At minimum, agree on source document ID, version, section path, page number, permission labels, and effective time. Permission filtering must happen at the retrieval stage, not as “after-the-fact masking” at the generation stage.
    3. Separate writes from queries. Document parsing is a heavy task and should go through asynchronous queues and task status queries to avoid large file uploads blocking the online path.

    4. Deployment Preparation: Ports and Network Planning

    Both types of services are usually deployed via container orchestration, and the most common issue when starting them on the same host is port conflicts. First understand the mapping rule: in a configuration like A:B, A is the host port and B is the container port; containers typically serve plaintext HTTP on 80 and encrypted HTTPS on 443. If host port 80 is already occupied by a service started earlier, change only the host-side port and keep the container side unchanged, for example changing 80:80 to 8080:80 and 443:443 to 8443:443.

    Companion checklist:

    • Update forwarding rules on the reverse proxy and gateway accordingly, to avoid “the service is up but access returns 502”;
    • If services communicate over the container network, prefer service names over host ports to reduce cascading changes from mapping updates;
    • Define health check addresses and probe ports clearly; probes should target container internal ports;
    • Standardize time zone, character set, and upload size limits; scanned and image documents easily trigger default size limits.

    An illustrative container configuration snippet (expressing only port and network concepts):

    1. services:
    2. knowledge-service:
    3. ports:
    4. - "8080:80" # host 8080 -> container 80
    5. - "8443:443"
    6. networks: [rag-net]
    7. orchestration-service:
    8. networks: [rag-net]
    9. networks:
    10. rag-net:
    11. driver: bridge

    5. Integration Implementation: Calls, Write-Back, and Citations

    Integration typically involves three data flows.

    The first step is knowledge ingestion. Upload files to the knowledge processing layer, select a chunking template that matches the document type, asynchronously query parsing and indexing status, and record the document ID and version on success for incremental updates and invalidation/removal.

    The second step is online retrieval. The orchestration layer submits the user question, filter conditions (tenant, department, confidentiality level, time range), and the number of results to return; the retrieval service returns chunks, scores, and citation information.

    The third step is generation and tracing. Truncate chunks by rerank score, inject them into the prompt, require the model to answer based only on the chunks, and include citation numbers in the answer; when recall is empty or scores are generally low, explicitly reply “insufficient information” rather than letting the model freely fill in gaps.

    Abstract illustration of the interface call:

    1. def ask(question: str, tenant: str, top_k: int = 8):
    2. hits = knowledge_client.search(
    3. query=question,
    4. filters={"tenant": tenant, "confidential": "<=L2"},
    5. top_k=top_k,
    6. )
    7. if not hits or max(h.score for h in hits) < 0.35:
    8. return {"answer": "Insufficient information to answer the question", "citations": []}
    9. context = "\n".join(f"[{i+1}] {h.text}" for i, h in enumerate(hits))
    10. return llm_client.answer(question, context, require_citation=True)

    Engineering details worth adding: request-level timeouts and retries should distinguish idempotency; retrieval can be retried, while writes need deduplication; introduce semantic caching for high-frequency questions with an invalidation policy; attach a trace ID to all cross-service calls for aggregating troubleshooting in the log service.

    6. Evaluating Results: Turning “Feels Good” into Metrics

    A Q&A system without evaluation cannot iterate. Establish at least four categories of metrics:

    • Retrieval quality: recall hit rate, manual relevance scores for chunks, before/after reranking comparison;
    • Generation quality: answer accuracy, citation consistency rate, unsupported-answer rate;
    • Engineering metrics: time to first token, end-to-end latency percentiles, parsing task success rate and backlog duration;
    • Business metrics: human handoff rate, average handling time, user adoption rate.

    The evaluation set should come from real questions and cover paraphrases, cross-document aggregation, table value queries, and unauthorized questions that should be refused. Every time you adjust the chunking strategy, prompts, or model parameters, run the same set and keep historical results to judge whether a change is a gain or a regression.

    7. Security and Operations Essentials

    In enterprise scenarios, permissions, auditing, and maintainability take priority over flashy features. Recommended practices: enforce document-level and chunk-level permission filtering at the retrieval stage; mask sensitive fields before ingestion; manage keys centrally through configuration or a key management service, never in images or repositories; store parsing artifacts and original files in separate buckets with lifecycle policies; keep traceable citations and operation audits for model outputs.

    To reduce self-built burden, heavy assets can move to general cloud capabilities: object storage for original files and parsing artifacts, a message queue for parsing tasks, a container platform for stateless services, and logging, monitoring, and alerting services for observability. This way, only differentiated logic is self-built, and operations boundaries are clearer.

    8. Suggested Evolution Path

    In the first phase, use an orchestration framework plus an independent retrieval service to complete a closed loop, validating question distribution and document quality; in the second phase, add permissions, evaluation, and caching, and stabilize latency and refusal strategies; in the third phase, introduce more specialized retrieval or graph-based augmentation per scenario, always through a unified contract to avoid tight coupling with a single implementation. Following this path, teams can see a usable prototype within a day or two without being locked in by early choices as the business grows.