# KB Tags: Use Different Knowledge Base Sources for Different Customers

Tag Knowledge Base sources with a variable and a value, so the AI only answers from them when the conversation matches, for example one region, plan or product.

> Source: https://www.robylon.ai/docs/knowledgebase/kb-tags
> Section: Knowledge Base

KB tags decide which sources the AI can answer from in a conversation. Each tag is a variable and a value, such as `region: EU` or `plan: Pro`. A tagged source is only used when the conversation's variable has that value. A source with no tags is used in every conversation.

Use them when some content applies to some customers and not others, such as a returns policy that differs by country, or features that only Pro customers have.

## How do KB tags decide which sources are used?

When the agent searches your Knowledge Base, it compares each source's tags with the variables in the current conversation:

* **No tags:** the source is always used.
* **Tagged:** the source is used only when the conversation's variable has the same value. A source tagged `region: EU` is used when `region` is `EU`, and skipped when it is `US` or empty.
* **Several tags:** all of them must match. A source tagged `region: EU` and `plan: Pro` is used only for Pro customers in the EU.
* **One value per tag:** a source can have one value for each variable.

The match is on the exact value, including upper and lower case, so `eu` does not match `EU`.

## How do I add KB tags to a source?

Add them under **KB Tags** when you [add a source](https://www.robylon.ai/docs/knowledgebase), or later by opening the source. Pick the variable, then type the value. Tags set on a website folder apply to all its pages.

<Tip>
Keep values short and consistent, such as `region: EU`, never a mix of `EU`, `Europe` and `eu`.
</Tip>

## How does a conversation get the values the tags check?

A tag only works if the conversation has a value for its variable. The tag name is one of your [variables](https://www.robylon.ai/docs/data-and-integrations/variables-intents-entities), so the value can come from anywhere that variable is set.

The most common way is a workflow: a **Set Variables** block sets the value before the AI answers, for example from an API response or the customer's choice. See [Logic blocks](https://www.robylon.ai/docs/product/logic#how-does-set-variables-work).

If the conversation does not have the variable at all, that tag does not filter anything, so sources tagged with it can still be used. If the variable is set but empty, only sources tagged with an empty value match. To keep tagged sources out until you know the customer, set the variable to a value such as `unknown` early in the workflow.

## When should I not use KB tags?

When content applies to everyone. Leave it untagged, so it is always available. Tag only what must be kept apart, because a tagged source the conversation doesn't match is never used, even when it has the answer.
