Enterprise Knowledge Base Q&A: How Orchestration and Parsing Layers Should Split Work
Enterprise RAG often fails after the demo: broken tables, bad citations, inconsistent answers, and weak permissions. This article maps a five-layer stack, when to prioritize document parsing versus workflow orchestration, a decoupled hybrid architecture with a retrieval contract, and the engineering details that actually bound quality.
1. The real bottleneck is production, not a working demo
Many teams can ship a first knowledge-base Q&A demo: upload a few PDFs, ask a question, and get a plausible answer. In production the same system often breaks down. Scanned tables are shredded, answers cite the wrong page, the same question yields different conclusions across sessions, missing access control allows over-privileged retrieval, and quality cannot be measured so it cannot be improved.
A complete knowledge-base Q&A system typically has five layers, each with different engineering priorities:
- Ingestion and parsing: multi-format readers, layout reconstruction, table and image extraction, OCR.
- Chunking and indexing: chunking strategy, metadata, embeddings, and keyword indexes.
- Retrieval: recall, fusion ranking, reranking, and context trimming.
- Orchestration and agents: intent, task flows, tool calling, multi-turn state.
- Application and governance: permissions, audit, citation provenance, evaluation, cost and latency control.
Collapsing all five into one black box is cheap in the short term and expensive later: you cannot swap a weak parser, and complex orchestration is stuck behind built-in nodes. A more durable approach is layer decoupling and capability-based selection.
2. Two technical tracks, different layers
Common industry offerings fall into two families. They are complementary specialists, not substitutes.
Document-parsing-intensive systems optimize parse and retrieval quality. They typically offer deep layout handling for PDFs, scans, nested tables, and mixed text/images; document-type-specific chunking templates; separate OCR and layout pipelines; and hybrid recall plus reranking. They excel at questions such as “In this 300-page tender with tables, what are the payment terms?”
Workflow-orchestration platforms optimize application assembly. They typically offer visual node graphs, agents and tools, model and prompt management, fast chat-app publishing, and a low-code learning curve. They excel at standing up a multi-step Q&A app that queries databases and calls tools, then handing it to the business in about a week.
When documents and unstructured data dominate, prioritize parsing. When the app shape is complex and the tool chain is long, prioritize orchestration. If you need both, compose them rather than choosing one.
3. A short selection checklist
Half an hour of honest answers usually points to the right architecture:
- Scans, tables, and drawings more than about 30% of the corpus? The parsing layer must be specialized.
- Multi-turn task flows (orders, approvals, internal APIs)? Orchestration must stand alone.
- Sentence-level citations and audit? Retrieval must keep fine-grained metadata.
- Strong multi-tenant and document-level isolation? Enforce permissions in retrieval, not in prompts.
- Sustainable quality measurement? Build an evaluation set and regression early.
4. A decoupled hybrid architecture
A practical shape is: orchestration as the application frame, parsing and retrieval behind service APIs. They communicate over a clear contract so either side can be replaced or scaled independently.
User question↓[Orchestration] intent / task flow / agent tools↓ retrieval request (query, tenant ID, permission tags, topK, filters)[Parse & retrieval service] hybrid recall → rerank → context trim↓ chunks (text + page + document ID + hierarchy path)[Orchestration] prompt assembly → generation → citation markup → audit log
Illustrative contract (pseudocode only; not a product API):
def retrieve(query: str, tenant: str, scopes: list[str], top_k: int = 8):payload = {"query": query,"tenant_id": tenant, # tenant isolation"permission_scopes": scopes, # permission filters run on the retrieval side"top_k": top_k,"filters": {"doc_type": ["contract", "policy"]},}resp = http_post("/retrieval", json=payload, timeout=1500)return [c for c in resp["chunks"] if c["score"] > SCORE_THRESHOLD]
Three contract lessons: push permission tags to retrieval with the request; return locatable metadata for citations; define timeouts and fallbacks explicitly—if retrieval fails, answer “no supporting evidence” rather than letting the model improvise.
5. Six engineering details that cap quality
- Chunking beats model shopping. Split by semantics and layout; keep heading paths as metadata; keep tables as whole blocks with header context; avoid breaking tables across pages.
- Hybrid retrieval beats vectors alone. Keywords are more stable for part numbers and proper names; embeddings handle paraphrases; fuse, then rerank.
- More context is not better. Trim by relevance, order evidence first, and reduce lost-in-the-middle interference.
- Citations must be verifiable. Attach document name, page, and a source snippet so users can jump and check—this is how enterprise trust is built.
- Evaluation first. Before launch, build 100–300 real business questions covering single-hop, multi-hop, no-answer, and unauthorized access; regress on every change.
- Observability and cost. Log retrieval hits, rerank scores, tokens, and end-to-end latency; cache frequent semantic queries; isolate heavy parsing from online retrieval so they do not contend for resources.
6. Using general cloud building blocks
You do not need to own every piece of infrastructure. Object storage for files, a message queue for async parse jobs, containers that autoscale on queue depth, logging and alerting for traces, and managed vector/keyword search are enough. Baidu AI Cloud offers products in these general categories that can plug into an existing stack without changing the layered design above.
7. A staged rollout
- Prototype: single tenant, one document type, fixed flow; validate parse quality and answer usefulness.
- Pilot: add permissions and audit, complete the eval set, gray-release one high-traffic scenario.
- Scale: service-ize parse and retrieval, add sources and tools, run quality dashboards and a regular iteration cadence.
8. Common mistakes
Treating prompts as an access-control system; one chunking config for every document type; skipping OCR quality checks on scans; no no-answer fallback; “it feels better” instead of metrics; co-locating parse with online serving and causing latency jitter.
Takeaway: enterprise knowledge-base Q&A is a composition of layered capabilities. Let specialized systems own parsing and retrieval, let orchestration platforms own application assembly and agents, and keep a crisp contract between them so quality, iteration speed, and operability stay in balance.
