Skip to main content

Designing Multi-Country Knowledge Bases: Metadata Filtering, Versioning, and Update Mechanisms

· 5 min read
Jack Ning
Maintainer of Bytedesk

A cross-border e-commerce platform often serves a dozen country sites at once. Shipping timelines, return windows, and seller settlement rules can all differ per site — even the official languages differ. When the AI agent's knowledge base ignores site and language, the most embarrassing incident occurs: a Brazilian buyer asks about the return policy, and the AI recites the Singapore site's clause with total confidence. This kind of error is far worse than "I don't know" — it misleads users into real-world decisions.

This is the second post in an experience-sharing series for AI customer service product managers and developers, drawn from hands-on practice as an AI product manager at a Southeast Asian cross-border e-commerce platform. In this post I want to share the design of a multilingual knowledge base's data structure, metadata filtering, version management, and update mechanisms for country sites where language, logistics policy, return rules, and seller benefits all differ — so that wrong-site information is never retrieved. It is a comprehensive design mixing data modeling, retrieval isolation, and lifecycle management.

Illustration: Metadata filtering and versioning in a multilingual knowledge base

Three Key Points in Multi-Country Knowledge Base Design​

  • Data modeling for multiple knowledge systems: organizing knowledge along "site × language × business type" instead of dumping everything into one index.
  • Metadata filtering and retrieval isolation: site isolation must be enforced by hard pre-retrieval filtering — not by hoping similarity ranking "probably gets it right."
  • Knowledge lifecycle management and compliance awareness: policies have effective dates, versions, and audit needs; a knowledge base is not a static file imported once.

The Overall Design​

1. Data structure: knowledge entries plus metadata as the core​

Each piece of knowledge is chunked, with the chunk as the minimal unit carrying a unified metadata model including:

  • site (country site), language, business_type (logistics / returns / seller benefits, etc.)
  • policy_id (unique policy identifier), version, effective_date / expire_date
  • source, audience (buyer or seller)

Two structural designs matter most:

  • Separate global layer and override layer: cross-site common knowledge lives in a "global layer," site-specific differences in an "override layer." At retrieval time the site layer takes precedence over the global layer — no need to duplicate identical content per site, while differences remain coverable.
  • Multilingual versions bound to one policy_id: all language versions of the same policy share one policy_id, keeping semantics consistent and translations traceable. A policy revision updates all language versions together — never "English updated, Thai still on the old policy."

2. Metadata filtering: hard prefilter before retrieval, not ranking as a fallback​

This is the most underestimated link. The correct approach: during query parsing, identify the user's site, language, and identity, then pass them as hard filter conditions (prefilter) to the retrieval engine so the candidate set only ever contains knowledge effective for that site.

For time-sensitive policies (such as temporary return rules during mega-sales), add effective-period filtering. When filtering leaves no usable results, prefer clarification or human handoff — never fill the gap with another site's knowledge. Answering with the wrong policy is more harmful than not answering.

3. Version management​

  • Every policy carries a version number and effective time, supporting gradual rollout: a new version takes effect on some sites or a slice of traffic first, then goes full after validation.
  • Historical versions are retained for audit and regression evaluation — when a policy is disputed, you can trace back which version was effective when the user asked.
  • Answer generation requires the model to cite the version number or effective date for later traceability.

4. Knowledge update mechanism​

Knowledge bases decay faster than teams expect, so I would build a change-driven process:

  1. Subscribe to policy changes: when legal or operations publishes a change, automatically trigger re-chunking, re-embedding, and index updates for knowledge under the corresponding policy_id;
  2. Set expiry reminders and periodic audits, proactively reviewing high-traffic knowledge that has not been updated for a long time;
  3. Before every update goes live, run regression tests with an evaluation set covering all sites and languages, preventing the update itself from introducing cross-site errors.

5. The fallback principle​

The final principle: when retrieval results do not match the user's site, or knowledge has expired, prefer refusing to answer or handing off to a human over answering with wrong-site knowledge. A refusal costs the user one more question; a wrong answer costs the user acting on the wrong policy.

How This Maps to Weiyu​

The Weiyu open-source customer service system (GitHub: https://github.com/bytedesk/bytedesk , website: https://www.weiyuai.cn ) provides corresponding foundations in knowledge base management: multiple knowledge bases with multi-format document import, chunking, and vectorization; knowledge can be categorized, enabled, or disabled, making it easy to organize isolation by business line or site; the interface and messages support multiple languages to serve buyers in different markets; when the AI agent cannot retrieve reliable evidence, it can hand off to human agents or tickets, with skill-group routing as the safety net instead of guessing. For enterprises needing deep customization like "site override layers," Weiyu's open-source architecture leaves ample room for secondary development.

Key Takeaways​

  • Three-dimensional modeling: site × language × business type as core metadata fields; separate global and site-override layers.
  • Hard prefiltering is the first gate against cross-site contamination; similarity ranking is not an isolation mechanism.
  • Version + effective-period management makes knowledge gradually rollout-able, auditable, and traceable; model-cited version numbers enable accountability.
  • Change-driven updates + periodic audits + regression evaluation — missing any one lets the knowledge base slowly rot.
  • Refusing beats answering wrong: when no knowledge matches the site, human handoff is the responsible choice.