How to use Source Label query parameters
Add these parameters to your embed code or API request to control which labeled sources the agent draws from.
For setup instructions, refer to 👉 Enable and Use Labels for Your Agent.
The labels parameter
labels parameterTells the agent which labeled sources to search. You may use both label names and their IDs.
| Format | Syntax | Logic |
|---|---|---|
| Simple list | labels="A,B,C" | OR - returns any source that has at least one of these labels |
| Array | labels='[["A","B"],["C","D"]]' | AND/OR - inner brackets OR, outer brackets AND |
Array logic: To be included, a source needs at least one matching label from every bracket.
[["A","B"],["C","D"]] = (A or B) AND (C or D)
The labels_exclusive parameter
labels_exclusive parameterControls whether sources with no labels are included in results.
| Value | Outcome |
|---|---|
true | Only sources matching your labels |
false (default) | Sources matching your labels, plus any sources with no label |
Limits
| Limit | Value |
|---|---|
| Max groups (array format) | 20 |
| Max labels per group | 50 |
| Max labels total | 500 |
Edge cases
| Scenario | Behavior |
|---|---|
| Invalid label | Ignored - the other labels and conditions still apply. |
No labels + labels_exclusive="true" | No sources served. The agent will return the I'm sorry response. |
Related articles
- Enable and Use Labels for Your Agent
- Assign Labels to Your Knowledge Base Pages
- Test Source Label Filtering
Updated about 1 hour ago
