Documentation Index
Fetch the complete documentation index at: https://mintlify.com/RubenDarioGuerreroNeira/Ecosistema-IA-Colombia/llms.txt
Use this file to discover all available pages before exploring further.
src/bot/constants/keywords.ts is the single source of truth for all intent detection in Salud IA Bot. Rather than scattering trigger strings across handler methods, every keyword list, region array, bypass marker, and greeting pattern is exported from this module and imported by bot.update.ts. This makes it straightforward to extend coverage or tune specificity without touching handler logic.
Exported Constants
YOPAL_KEYWORDS
An exhaustive array of phrases that identify queries about health services in Yopal, Casanare. The list combines generic proximity queries (cerca de mi, hospital cercano en yopal) with the exact names of local providers registered in the dataset (e.g., capresoca, clinica casanare, esesalud, coosalud). When any term matches, the message is routed to YopalHealthService.
RISK_ANALYSIS_KEYWORDS
Keywords that signal a disease-level risk or mental health query — not a predictive/forecast query (those are caught earlier by inline normPred checks in onText). Current terms cover major communicable diseases and mental health conditions:
ENVIRONMENTAL_KEYWORDS
Triggers for environmental and vector-borne disease queries, including air-quality-adjacent conditions. Note the intentional overlap with RISK_ANALYSIS_KEYWORDS (e.g., dengue, zika) — routing priority order in onText determines which handler wins:
CYCLE_KEYWORDS
An array of objects that map colloquial life-cycle terms to canonical age-group identifiers. Used by vaccination and public health services to filter datasets by demographic segment:
GRAPHIC_KEYWORDS
Phrases that trigger ChartQueryService to generate a chart image instead of a text response. Covers both accented and unaccented spellings to handle the full range of mobile keyboard input:
DEPARTMENTS
The full array of the 32 Colombian departments used by the region-detection helper (detectRegion). Values match the official names with diacritics:
CAPITALS
The 31 departmental capital cities (plus Bogotá). Checked alongside DEPARTMENTS for region detection so that users can refer to a city instead of its department:
MAJOR_VALLE_TOWNS
Supplementary municipalities in the Valle del Cauca department. These fall outside the capital (Cali) but are served by the CaliHealthService dataset and need their own entries for accurate region detection:
OTHER_REGION_NAMES
Additional region aliases and EPS (health insurer) names that should trigger region-aware routing even when the user does not mention a full department or capital name:
BYPASS_MARKERS
A set of string markers that services embed at the start of structured responses. When BotUpdate retrieves a summary from StatsService and finds any of these markers in the result, it sends the response directly to the user without forwarding it to the LLM for rephrasing. This prevents the AI from paraphrasing or degrading structured data outputs:
GREETING_REGEX
A single compiled regular expression that detects greeting messages and /start commands. Matched messages are handled by handleGreeting(), which returns a personalised welcome with the user’s first name and a summary of bot capabilities:
Intent Routing Priority in onText()
BotUpdate.onText() applies the following priority chain. Each handler returns true if it consumed the message (causing an early return) or false to fall through to the next priority level.
| Priority | Trigger | Handler / Service |
|---|---|---|
| 0 | Service capability queries (qué info tienes de…) | handleServiceCapabilitiesQuery() |
| 1 | Structural data queries (counts, lists) | handleStructuralDataQuery() |
| 2 | Mental health diagnoses / risk profiles | MentalHealthQuestionsService.handleMentalHealthQuery() |
| 2.5 | Public health queries (SIVIGILA) | handleSaludPublicaQuestions() |
| 3.5 | Predictive alerts, forecasts, early warnings | handleNewPredictiveServices() via PredictiveQuestionsService |
| 4 | Chart / graphic generation | handleChartQuery() via ChartQueryService |
| 5 | Greetings / /start | handleGreeting() |
| 6 | Cali-specific provider queries | handleServiceCali() via CaliHealthService |
| 6.5 | Antioquia provider queries | handleAntioquiaQuery() via AntioquiaHealthService |
| 7 | General provider search (region detected) | handleProviderSearch() |
| 8 | Yopal-specific provider queries | handleYopalQuery() via YopalHealthService |
| 9 | ML-based disease prediction | handlePrediction() |
| 10 | Air quality queries | handleAirQualityQuery() via AirQualityQuestionsService |
| 11 | General statistics + bypass check | StatsService.getSummary() + BYPASS_MARKERS |
| 12 | Sexual health Q&A | handleSexualHealthQuery() via SexualHealthService |
| 13 | ML risk classification | handleMLClassification() |
| 14 | Public health events by name | handleSaludPublica() via SaludPublicaService |
| 15 | General LLM fallback | handleGeneralQuery() via GenkitService |
Bypass Marker Flow
The bypass system prevents double-processing of structured responses. WhenStatsService.getSummary() returns data (priority 11), the result is checked against BYPASS_MARKERS before any LLM call is made:
--- ANÁLISIS or --- RANKING), BotUpdate sends it directly and returns — the LLM never sees it. If there is no bypass marker, the context data is appended to the LLM prompt at priority 15 to enrich the general response.