Skip to main content

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.

Salud IA Bot is an AI-powered public health assistant built for Colombian citizens. Millions of people in Colombia face barriers to accessing timely, reliable information about disease outbreaks, vaccination coverage, and local health services — barriers that contribute to preventable illness and overloaded clinics. Salud IA Bot solves this by acting as a direct bridge between the complex datasets maintained by Colombia’s public health system (SIVIGILA, PAI vaccination records, CIE-10 mental health diagnoses) and everyday citizens through a familiar interface: Telegram. Powered by Meta LLaMA 3.1 70B via OpenRouter and backed by a NestJS + SQLite architecture, it delivers epidemiological analytics, composite risk scoring, chart visualizations, and local provider lookups — all without hallucinating on critical health data.

Key Capabilities

Epidemiological Analytics

Query SIVIGILA microdatos for disease incidence rankings, demographic comparisons (gender, age group, urban vs. rural), and national summaries. Ask in plain Spanish — the bot interprets natural language and returns structured statistics.

Composite Risk Scoring

A multidimensional scoring algorithm crosses SIVIGILA case volumes, vaccination coverage gaps, rurality index, and vulnerable population data to classify risk as BAJO, MEDIO, ALTO, or CRÍTICO for diseases such as dengue, tuberculosis, malaria, and zika.

Mental & Sexual Health Guidance

Dedicated modules handle CIE-10 mental health diagnoses and sexual/reproductive health FAQs. The bot provides care pathways, prevention information (STIs, HIV), and emergency guidance (e.g., gender-based violence routes) from structured local knowledge bases.

Local Health Provider Search

Search for clinics, hospitals, and specialist services in Antioquia, Boyacá, Yopal, and Cali. Supports proximity-based lookup (geo search in Yopal with a 5 km default radius), specialty filtering (dentistry, gynecology, pharmacy), and urgency-level filtering.

Chart Visualization

Dynamic chart generation via QuickChart integration. Request bar, pie, or line charts for air quality, mental health diagnosis distributions, vaccination coverage by department, SIVIGILA disease frequency, and gender-disaggregated case breakdowns.

Early Warning System

A predictive subsystem detects queries about predicción, pronóstico, alertas tempranas, and clasificación de riesgo, then orchestrates MlPredictionService, AdvancedPredictionService, and EarlyWarningService to return time-series forecasts and automatic outbreak alerts.

Architecture Overview

Salud IA Bot is built on a modular NestJS backend with three primary layers: the Bot Layer (BotUpdate controller + nestjs-telegraf), the Services Layer (domain-specific services for each health topic and region), and the Data Layer (TypeORM + better-sqlite3 reading from a pre-seeded SQLite database). The central intelligence pattern is RAG (Retrieval-Augmented Generation). When a message arrives, BotUpdate detects the intent and routes it to the appropriate service, which fetches real statistical context from SQLite, then injects that context as a structured prompt to the LLaMA 3.1 model via OpenRouter. The LLM never generates statistics from its weights alone — it always reasons over data retrieved from the local database. For urgency queries in Cali specifically, a zero-hallucination bypass routes the request directly to a SQLite query and formats the response without touching the LLM at all, guaranteeing 100% data fidelity.
👤 User → Telegram API → BotUpdate (NestJS)

                   Intent Detection (NLP)
                ┌──────────┼──────────────┐
           Analytics     Charts       Geo/Urgency
                ↓            ↓              ↓
          StatsService  ChartService  SQLite bypass

         RAG context → LLaMA 3.1 via OpenRouter

         Telegram reply (text or photo)

Data Domains

The bot integrates four official Colombian health data domains, all pre-processed from XML into a local SQLite database (data/salud-ia-bot.db):
DomainSourceContent
SIVIGILA EventsInstituto Nacional de SaludCommunicable disease microdatos — case counts, sex, age group, urban/rural, municipality
Mental Health CIE-10Ministerio de SaludDiagnoses and care records coded to ICD-10; used by MentalHealthStatsService
Sexual & Reproductive HealthInternal knowledge baseFAQs on contraception, STI prevention, HIV, and care pathway navigation
Regional Providers & VaccinationDepartmental health registries + PAIHealth center locations for Antioquia, Boyacá, Yopal, and Cali; PAI vaccination coverage by department

Tech Stack

ComponentTechnologyPurpose
FrameworkNestJS v11Modular, scalable backend architecture with dependency injection
LLMMeta LLaMA 3.1 70B Instruct via OpenRouterSpecialized response generation with RAG-injected public health context
AI ClientOpenAI SDK (openai npm package)OpenAI-compatible client pointed at OpenRouter’s API endpoint
Botnestjs-telegraf / TelegrafTelegram Bot API integration and webhook/update handling
DatabaseTypeORM + better-sqlite3Local SQLite persistence; zero XML parsing at runtime in production
Data Processingfast-xml-parser + xml2jsOne-time migration of official XML health datasets into SQLite
ChartsQuickChartDynamic chart image generation (bar, pie, line) served as Telegram photo replies
Config ValidationJoiSchema-validated environment variables — missing required vars exit the process immediately
Proxy Supporthttps-proxy-agentOptional HTTP proxy for Telegram API access on restricted hosting providers

Build docs developers (and LLMs) love