---
title: "Configuring Region Segmentation for Agents"
description: "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."
canonical_url: "https://help.brainfi.sh/articles/configuring-region-segmentation-for-self-service-agents-a5FxDPHxFi"
md_url: "https://help.brainfi.sh/articles/configuring-region-segmentation-for-self-service-agents-a5FxDPHxFi.md"
---
# 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](/articles/how-to-enable-region-segmentation-7NU85bUPvM).

## 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.

1. **Agents → Create new agent** for each region (UK, EU, AU, etc.).
2. Configure each agent's region under **Knowledge Settings**.
3. Embed each agent on the region-specific pages of your website.

![](https://help.brainfi.sh/api/attachments.redirect?id=0d4e4391-de0a-4c65-980b-468e28fc6737)

## 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.

```html
<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](/articles/brainfish-widget-overrides-guide-K96JtYxorD) 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](/articles/navigate-to-a-specific-region-CAZAa7bel2).

**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?**

1. Confirm the widget key is correct and the agent is published.
2. Confirm the region codes match the ones you've tagged on your collections.
3. 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](/articles/how-to-enable-region-segmentation-7NU85bUPvM) — workspace-level toggle and collection tagging.
- [Navigate to a specific region](/articles/navigate-to-a-specific-region-CAZAa7bel2) — full list of supported region codes and Help Center URL parameters.
- [Brainfish Widget Overrides Guide](/articles/brainfish-widget-overrides-guide-K96JtYxorD) — every available embed-time override.
