Enterprise Knowledge Base Q&A: Architecture Selection and Implementation

    This article explains how to choose an architecture for enterprise knowledge base Q&A by treating it as a set of capability layers rather than a single all-in-one framework. It compares orchestration-oriented and parsing-oriented frameworks, outlines a hybrid design with clear interface contracts, and covers port and network planning, retrieval quality tuning, evaluation, operations, and a phased rollout path.

    1. The Real Problem: Layered Capabilities, Not an Either-Or Choice

    When teams build enterprise knowledge base Q&A systems, the most common question is which open-source framework to adopt as the main platform. This usually comes from an implicit assumption: that one “do-everything” tool must be selected. From an engineering perspective, however, a knowledge base Q&A system can be broken into relatively independent capability layers, each with very different levels of maturity and implementation difficulty. Treating them as one decision turns selection into a gamble.

    A practical layering looks like this:

    • Ingestion layer: document upload, format detection, version management, permission inheritance.
    • Parsing layer: layout analysis, table reconstruction, optical character recognition, formula and caption handling.
    • Chunking and indexing layer: chunking strategy, metadata extraction, dual vector and keyword indexing.
    • Retrieval layer: recall, reranking, multi-knowledge-base routing, context compression.
    • Orchestration layer: prompt management, tool calling, multi-step reasoning, human-in-the-loop nodes.
    • Application and operations layer: session management, citation traceability, evaluation, monitoring and alerting, canary releases.

    The conclusion is straightforward: a framework strong at deep parsing and a framework strong at workflow orchestration each cover only part of the stack. A more reliable approach is to make the main framework responsible for orchestration and application concerns, and push parsing and retrieval down into services exposed through standard interfaces.

    2. Capability Boundaries of the Two Framework Types

    2.1 Strengths of Orchestration-Oriented Frameworks

    The core value of these frameworks is lowering the barrier to building applications. Typical features include a visual canvas, ready-to-use node types, model integration abstractions, prompt version management, tool and plugin mechanisms, and fairly complete application publishing options. A team can usually get a minimal prototype running within half an hour, which is critical for feasibility validation.

    Their limitations are equally clear: parsing depth for complex document layouts is limited, and recall quality drops noticeably with scanned files, cross-page tables, and multi-column layouts. Deep customization is also constrained by the abstraction level of the canvas nodes.

    2.2 Strengths of Parsing-Oriented Frameworks

    These frameworks focus their engineering effort on document understanding. They typically offer layout reconstruction, table structuring, scanned content recognition, and multiple chunking templates, with substantial optimization for high-concurrency, latency-sensitive retrieval scenarios. For corpora where “format is semantics” — policy documents, contracts, financial reports, technical manuals — the benefits are significant.

    Their weakness is at the application layer: automatic multi-knowledge-base routing, complex business workflow orchestration, and human-in-the-loop nodes are usually not design priorities.

    2.3 Benefits of a Hybrid Architecture

    Using an orchestration-oriented framework as the main entry point and a parsing-oriented framework as the retrieval backend provides three things at once: orchestration for complex applications, high-quality document understanding, and the freedom to swap implementations behind standard interfaces. The key is a clear interface contract that avoids coupling business logic to a specific implementation.

    3. Port and Network Planning Before Deployment

    Both framework types are usually deployed through container orchestration and by default occupy high or low ports on the host, which makes conflicts likely when they run on the same machine. Port mapping is written as host_port:container_port; for example, 8080:80 means external access on 8080 while the container still uses port 80.

    Three rules are recommended:

    1. Change only the host port and keep the container port unchanged, so internal application configuration does not need to be modified.
    2. Assign clear port ranges to each system and record them in documentation to prevent duplicate allocation during later scaling.
    3. Expose a single entry point and route by path through a reverse proxy, instead of making business teams remember multiple ports.

    An illustrative reverse proxy configuration (conceptual only):

    1. location /kb/ {
    2. proxy_pass http://parsing-service-address:8080/;
    3. proxy_set_header Host $host;
    4. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    5. }
    6. location /app/ {
    7. proxy_pass http://orchestration-service-address:3000/;
    8. proxy_set_header Host $host;
    9. }

    If object storage holds the original files, plan the internal access address and how credentials are injected. Credentials should be delivered through environment variables or a key management service, not written into configuration files committed to the code repository.

    4. Key Design Decisions for Interface Integration

    The stability of a hybrid architecture depends on contract design. The following abstractions are recommended:

    1. Retrieval request
    2. query user question
    3. top_k number of candidates
    4. threshold minimum similarity score
    5. filters metadata filter conditions (department, classification, time range)
    6. session_id session identifier, used for multi-turn rewriting
    7. Retrieval response
    8. chunks list of text segments
    9. scores relevance scores
    10. refs source file, page number, version
    11. latency_ms processing time

    Three implementation points:

    • Citations must be traceable to a file and page number; otherwise the business side will not trust the answer.
    • Metadata filtering must happen at the retrieval stage rather than as post-filtering in the application layer; otherwise insufficient recall directly degrades answer quality.
    • Timeout and fallback strategies must be explicit: when the retrieval service is unavailable, whether to return a fallback response or escalate to a human needs confirmation from the product side.

    5. Retrieval Quality Tuning Checklist

    • Chunking: split on semantic boundaries, keep heading hierarchy as a context prefix, and tune chunk size and overlap against the actual corpus.
    • Dual-path recall: vector retrieval handles semantic similarity, keyword retrieval handles exact matches such as IDs and clause numbers, then fuse the results.
    • Reranking: a second-pass ordering over the candidate set is the most cost-effective way to improve first-hit accuracy.
    • Multi-turn rewriting: resolve references using session history before retrieval.
    • Cold start: when the corpus is small, add metadata and a synonym list first rather than repeatedly tuning model parameters.

    6. Evaluation and Operations

    The evaluation set should come from real business questions, layered into three categories: answerable, needs clarification, and should refuse. Track hit rate, citation accuracy, and wrong-answer rate for each. Run the same set after every chunking or prompt change instead of relying on intuition.

    On the operations side, monitor retrieval latency percentiles, parsing failure rate, model call error rate, and resource usage trends, with logging and alerting configured. Parsing tasks usually take a long time, so they are better handled as asynchronous jobs with status queries to avoid requests hanging.

    Phase one: use an orchestration-oriented framework to validate business value with a small set of high-quality documents. Phase two: introduce a parsing-oriented service for complex layouts and solidify the interface contract. Phase three: complete evaluation, permissions, and auditing before considering a canary rollout. If graph-based reasoning or lightweight retrieval is needed later, additional backends can be added under the same contract without changing the application layer.