Configuring Region Segmentation for Agents
You can tailor your Brainfish agents to deliver region-specific experiences in two ways: by creating a separate agent per region, or by dynamically overriding regions in code at embed time.
Prerequisite: workspace-level region segmentation must already be turned on, and your collections must be tagged with regions. See How to enable Region Segmentation.
Why region segmentation?
Region segmentation ensures users get the response most relevant to their locale — different languages, content, or regional compliance.
Option 1 — Multiple agents per region
Create a unique Brainfish agent for each region. Best when you want full customization per locale, such as a unique agent identity, language, suggested questions, or knowledge scope.
- Agents → Create new agent for each region (UK, EU, AU, etc.).
- Configure each agent's region under Knowledge Settings.
- Embed each agent on the region-specific pages of your website.
Option 2 — Dynamic region override (recommended for a single deployment)
Instead of multiple agents, configure a single agent and override its region in code at embed time. Flexible and scalable when you support many regions from a single deployment.
<script type="module">
import Brainfish from "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-widget@latest/dist/web.js";
Brainfish.Widgets.init({
widgetKey: "bf_agent_YOUR_KEY",
overrides: {
regions: [
"GB", // United Kingdom
"CN", // China
"ZH_TW" // Taiwan (Traditional Chinese)
]
}
});
</script>
Replace bf_agent_YOUR_KEY with the widget key from your agent's configuration page.
How it works
When the agent initializes with regions set, it filters its knowledge sources to those tagged with one of the supplied region codes. If no region is specified, the agent searches all available knowledge.
You can combine regions with other overrides such as language, context, or custom labels — see the Brainfish Widget Overrides Guide for the full set.
FAQ
What format should region codes be in?
ISO 3166-1 alpha-2 country codes (e.g. GB, US, AU, DE). For traditional/simplified script splits like Taiwan, use ZH_TW. The full list is in Navigate to a specific region.
What happens to a user from an unspecified region? If no region matches, the agent falls back to all relevant knowledge across all regions.
Can I change the region after the agent loads?
Not currently. Region overrides are applied at init(). To change region dynamically, reinitialise the agent with new settings.
Is there a limit to how many regions I can pass? No enforced limit, but in practice declare only the regions relevant to your support strategy.
My region-specific agent isn't returning the right answers — how do I debug?
- Confirm the widget key is correct and the agent is published.
- Confirm the region codes match the ones you've tagged on your collections.
- Use browser DevTools → Network to inspect the agent's outbound requests and confirm region parameters are being passed.
Related articles
- How to enable Region Segmentation — workspace-level toggle and collection tagging.
- Navigate to a specific region — full list of supported region codes and Help Center URL parameters.
- Brainfish Widget Overrides Guide — every available embed-time override.
