May 26, 2026 · 6 min read · Data
Corrected 14 November 2026: the API calls below are ones that work today. The earlier version showed a state_code filter on /v1/cities that does not exist, and made-up answers.
Hyderabad is two cities. Your travel AI should know which one.
Hyderabad, Telangana, India: 10 million people, the Charminar, biryani, Golconda Fort. Hyderabad, Sindh, Pakistan: 1.7 million people, the Pacco Qillo, Mughal-era tombs, distinct cuisine. Generic LLMs without grounding pick one based on surrounding tokens. They are often wrong.
What goes wrong
"Tell me about the Charminar in Hyderabad." Asked plainly, most frontier models answer correctly — Telangana. But change the surrounding context. Mention biryani: still correct. Mention "Sindh region cuisine": the model wavers. Mention "Indus river": a model without grounding can place the Charminar on the Indus. The Charminar is on the Musi.
The model is doing pattern completion across two adjacent high-frequency clusters. Both cities are real. Both have Mughal architecture. Both have distinctive culinary traditions. The statistical signature is similar enough that token bias decides the answer.
The disambiguation key
The fix is structural: never let the system reason about
"Hyderabad" without an attached country code, and ideally an
attached subdivision code. The find_city tool takes
the name and the country code and returns the city's id and its
subdivision code; the city context route gives the subdivision's
name as well:
POST https://api.travelminds.ai/v1/agent/tool/find_city
Authorization: Bearer YOUR_KEY
Content-Type: application/json
{"name": "Hyderabad", "iso_alpha2": "IN"}
{
"id": "c3e750a5-9565-4c1d-95f4-b15078044e91",
"name": "Hyderabad",
"iso_alpha2": "IN",
"state_code": "IN-TG",
"matched_via": "exact_name",
"alternatives": []
}
GET https://api.travelminds.ai/v1/cities/c3e750a5-9565-4c1d-95f4-b15078044e91/context
Authorization: Bearer YOUR_KEY
{
"city_id": "c3e750a5-9565-4c1d-95f4-b15078044e91",
"name": "Hyderabad",
"iso_alpha2": "IN",
"admin": {"state_code": "IN-TG", "state_name": "Telangana", ...},
...
}
POST https://api.travelminds.ai/v1/agent/tool/find_city
{"name": "Hyderabad", "iso_alpha2": "PK"}
{
"id": "a0e0859d-3676-4249-9032-104a844b27d5",
"name": "Hyderabad",
"iso_alpha2": "PK",
"state_code": null,
"matched_via": "exact_name",
"alternatives": []
}
The country code alone separates these two cities. Inside one
country, the subdivision code separates more pairs. Our record for
Hyderabad in Pakistan has no subdivision code yet, so its
state_code is null in both answers; check for that before
you rely on the field. GET /v1/cities has no name filter:
it lists cities by score, filtered by iso_alpha2.
The country code is also the right primitive
for downstream systems — visa rules key off iso_alpha2, transit
schedules key off iso_alpha2 plus state, currency keys off
iso_alpha2.
Other classic same-name pairs
- Lahore: the Pakistani megacity in Punjab, PK; and historical references to Lahore-area villages on the Indian side. Pre-1947 sources use the name liberally on both sides of what is now the border.
- Cambridge: the original in England, plus Cambridge Massachusetts (Harvard, MIT), Cambridge Ontario, Cambridge New Zealand, Cambridge Maryland, and a dozen more in the United States alone.
- Mathura: the major pilgrimage city in Uttar Pradesh associated with Krishna; and Mathura villages in Punjab and elsewhere with no religious significance.
- Kashi / Varanasi / Banaras: same place, three names — the inverse problem, where one entity is referenced by aliases. iso_alpha2 plus state_code plus a canonical id solves both directions.
- Vijayawada / Bezawada: same place, modern and historic name.
- Goa: the Indian state versus Goa, a town in Iran. Less common, real in geographic gazetteers.
- Tripoli: the Libyan capital and the Lebanese city. Both ancient, both Mediterranean, both real.
The product implication
If your AI travel product accepts free-text city names from users and passes them straight to a model, you have a disambiguation bug that surfaces randomly. The fix is to resolve every city name to a (name, iso_alpha2, state_code) triple before the model sees it, and to surface a disambiguation prompt to the user when the triple is ambiguous.
"Did you mean Hyderabad, India or Hyderabad, Pakistan?" is a one-line UI fix that prevents an entire class of confidently wrong answers downstream. The data layer just needs to make that question askable.