Enterprise Knowledge Base and Dual-Engine Retrieval: A Practical Architecture Guide
This article walks through the technical evolution of enterprise knowledge bases and presents a practical architecture built around dual-engine retrieval. It explains how general-purpose and reasoning models complement each other, how to implement hybrid retrieval with permission filtering pushed down to the recall stage, and how to govern knowledge assets at scale through metadata enforcement, differentiated chunking, and lifecycle management. It also covers performance and cost considerations once membership and file counts grow into the millions and hundreds of millions, along with the observability metrics and capacity planning needed to keep retrieval trustworthy.
1. What Product Evolution Reveals About the Technical Roadmap
Looking at how a class of knowledge management products iterated over the past year, a clear technical thread emerges: first make it usable on mobile, then make knowledge capturable, then make knowledge shareable, and finally make it scale. This sequence closely matches how most enterprise knowledge base projects actually roll out, and it determines the priority of each architecture phase.
A typical phase breakdown looks like this:
- Phase 1 (mobile usability): Launch the mobile app, introduce a dual-engine structure on the retrieval side combining a general-purpose large model with a reasoning model, and offer a certain amount of free object storage to lower the barrier to trial.
- Phase 2 (knowledge capture): Upgrade knowledge base capabilities, introduce a public knowledge plaza module for cross-team reuse, and raise the per-library member limit from tens of users to the million scale.
- Phase 3 (knowledge circulation): Launch a personal knowledge account format, expand personal storage to the tens-of-gigabytes scale, and encourage content producers to keep publishing.
- Phase 4 (scale): Switch all clients to a newer version of the reasoning model; by the third quarter of that year, the number of enterprise users served reaches the million scale and the total number of knowledge base files reaches the hundreds of millions.
Note that these numbers are common industry order-of-magnitude references used to illustrate the pressure level that architectural evolution faces, not committed metrics for any specific product. What developers should really focus on is that every phase adds new constraints to both the retrieval pipeline and the storage pipeline.
2. Dual-Engine Retrieval: Why Pair a General Model with a Reasoning Model
The value of a dual-engine setup is not “more models” but the fact that the capability curves of the two model types are complementary.
General-purpose conversational models are strong at semantic generalization, respond fast, and cost less. They suit queries with clear intent, sufficient context, and answers that can be supported by paragraph-level evidence. Reasoning models break complex questions into multiple sub-tasks. They suit queries that require cross-document comparison, carry many conditional constraints, or contain implicit premises that need to be made explicit.
A practical fusion strategy is “classify first, route second, fuse last”:
def route(query, k=5):# Complexity check: number of constraints, need for cross-document comparison, presence of computationplan = planner(query)if plan.complexity == "simple":hits = hybrid_search(query, top_k=k)return fast_engine.answer(query, hits)# Complex query: rewrite the query and decompose it into sub-questions firstsubs = planner.decompose(query)evidence = []for s in subs:evidence.extend(hybrid_search(s, top_k=k))evidence = dedup_and_rerank(evidence)return reason_engine.answer(query, evidence)
Three engineering points are essential. First, routing thresholds must be calibrated against real business logs through regression testing, not set by intuition. Second, the reasoning engine’s latency is typically several times that of the general engine, so you need timeouts and a fallback path; on timeout, fall back to the general engine and show a notice that results may be incomplete. Third, the prompts and evidence formats of both engines must be unified, so the same piece of evidence does not produce contradictory conclusions under two different templates.
3. Implementing Hybrid Retrieval and Permission Filtering in the Right Order
In enterprise settings, retrieval accuracy problems are often not “insufficient recall” but “recalling content the user should not see.” Permission filtering must therefore be pushed ahead of the recall stage rather than applied as post-filtering on results — post-filtering lets unauthorized documents fill up top_k, and the number of visible results drops sharply.
Recommended pipeline order:
- Query understanding: rewrite, expand synonyms, and extract time-range and document-type constraints.
- Upfront permission filtering: build filter conditions from the user’s knowledge bases, knowledge accounts, and role tags, and push them down to both the vector and keyword retrieval sides.
- Dual-path recall: dense vector recall plus sparse keyword recall.
- Fusion ranking: use reciprocal rank fusion to avoid inconsistent score scales across the two paths.
- Reranking and citation: the reranking model produces the final evidence, and the answer cites source snippets for auditability.
flt = {"must": [{"term": {"kb_id": user.kb_ids}},{"term": {"acl_role": user.role}},],"must_not": [{"term": {"visibility": "private"}}],}candidates = fusion(vector_recall(query, top_k=50, filter=flt),keyword_recall(query, top_k=50, filter=flt),)
Sparse and dense paths are not redundant. Tokens with low semantic density — proper nouns, error codes, contract clause numbers — are usually handled more reliably by sparse retrieval, while colloquial questions and paraphrased expressions depend on dense retrieval. When fusing, normalize the sparse path before it participates in ranking.
4. Tiered Governance of Knowledge Assets: Keeping Hundreds of Millions of Files from Becoming Noise
Once the total file count reaches the hundreds of millions, the bottleneck in retrieval quality shifts from algorithms to governance. Practical tiered approaches include:
- Tiered directories and naming conventions: divide by business domain, document type, and effective date; carry version and effective date in the filename to make time filtering easy.
- Mandatory metadata: require four metadata fields at ingestion — owning team, classification level, validity period, and owner. Documents missing any of them go into a pending-completion queue instead of becoming searchable directly.
- Differentiated chunking: split policy documents by clause while preserving the hierarchy path; split technical manuals by heading level; keep structured descriptions for tabular content so it is not chopped into meaningless fragments.
- Lifecycle management: set expiry reminders and automatic archiving, and move cold data to a lower-frequency storage tier to control cost.
- Quality loop: feed “no-answer rate,” “citation click rate,” and “user correction rate” back as optimization signals, attributed to specific knowledge bases and documents.
Public reuse modules such as a knowledge plaza need additional review and deduplication mechanisms: when the same topic is built repeatedly across teams, use similarity clustering to suggest merging, so highly similar redundant documents do not crowd out retrieval results.
5. Performance and Cost After Scale Growth
Once the member limit rises to the million scale and storage expands to tens of gigabytes, pressure concentrates in three areas:
- Retrieval side: vector indexes need sharding and replicas, with index isolation per knowledge base to prevent a single hot library from affecting the whole system; build result caches for high-frequency queries, and include a user permission digest in the cache key to avoid unauthorized cache hits.
- Write side: use a message queue to smooth peaks in document parsing and vectorization, and set idempotency keys on asynchronous tasks so repeated uploads do not create duplicate chunks.
- Storage side: combine object storage lifecycle policies for hot/cold tiering, and meter raw files and chunk indexes separately for cost attribution.
For observability, collect at least four metrics — retrieval latency percentiles, empty-recall ratio, fallback trigger count, and index build delay — and configure monitoring alerts. For capacity planning, estimate index size with “file count × average chunks per file × vector dimension” and reserve three to five times headroom for sudden growth.
6. Conclusion
Competition in knowledge base products ultimately comes down to retrieval trustworthiness and governance maturity. Dual engines handle answering accurately; hybrid retrieval with upfront permissions handles answering correctly and safely; tiered governance and lifecycle management handle remaining usable at scale. Following this order is what keeps the retrieval experience stable as member and file counts keep expanding.
