Airgentic Help
User-segmented prompts let you deliver different instructions to your AI agent based on a user's location. When a user asks a question, the system automatically looks up their country, city, or region and injects location-specific content into the prompt — without any code changes or manual routing.
{{segment:Country}}.| Tag | Session Field | Description |
|---|---|---|
{{segment:Country}} |
User's country | e.g. India, China, United States |
{{segment:City}} |
User's city | e.g. Mumbai, Sydney, London |
{{segment:Region}} |
User's region/state | e.g. Western Australia, California |
Location is determined automatically from the user's IP address when they connect.
Suppose you run a university enrolment service and want to show country-specific entry requirements. Your main agent prompt might include:
REGION-SPECIFIC GUIDANCE
{{segment:Country}}
If no country-specific guidance is available, provide general international student information.
Then create Segmented Prompts for the countries you want to target. When a student from India asks about requirements, the agent sees the India-specific content. A student from China sees the China-specific content. A student from France (with no segmented prompt) sees just the fallback text.

The new segmented prompt opens in the editor with a template. Add your location-specific instructions below the template text.
After creating a segmented prompt for Country = India, you might add content like:
The user is in the Country:India segment. Apply the following relevant instructions for this segment when responding:
For students from India:
- Accepted qualifications: CBSE Class XII, ISC, State Boards
- Minimum marks: 75% in relevant subjects
- English requirement: IELTS 6.5 or equivalent
- Popular pathways: Foundation programs available for students not meeting direct entry
You can use multiple segment tags in the same prompt for more granular segmentation:
{{segment:Country}}
{{segment:Region}}
{{segment:City}}
Each tag is resolved independently. If a segmented prompt exists, its content is injected; if not, the tag is silently removed.
When testing in Admin Chat, the Trace Log shows which segment substitutions were applied for each request. Look for the Segment prompt substitutions event, which displays the attribute names and values that were matched:
{
"event": "Segment prompt substitutions",
"data": {
"Country": "India",
"City": "Mumbai"
}
}
This helps you verify that segmented prompts are being loaded correctly for different user locations.
Segmented prompts are cached in memory after the first load, so there is no performance penalty for using them. The cache is automatically cleared when you reload your service configuration, allowing new or updated segmented prompts to take effect immediately.