Skip to content
NowThesis: Spanish questions → SQL over public budget data

Rodrigo Solbes

Engineering software and AI systems you can verify.

Computer Engineering student and Systems Assistant in Tampico, Mexico, with three years of experience across software, data and IT infrastructure. I build machine learning models that run in production inside my employer’s .NET ERP. Now I’m moving into software engineering and enterprise AI, building systems that show the evidence behind every answer.

Focus
Applied ML · Text-to-SQL
Based in
Tampico, MX · EN / ES
Eligible to work
Mexico · EU (Spanish citizen)
Degree
B.Eng. CompE · UAT ’27
schema presupuestoloaded · reconciled
Star schema of the Mexican federal budget warehouseA central fact table, hecho_gasto, with 1,285,233 rows, joined to twelve dimension tables.programa_presupuestario901 rowsunidad_responsable1,926 rowsramo50 rowspartida459 rowsmodalidad23 rowsentidad_federativa34 rowsactividad_institucional375 rowsfuente_financiamiento6 rowsfinalidad4 rowsfuncion28 rowssubfuncion91 rowstipo_gasto9 rowshecho_gasto1,285,233 rows
Fig. 1 · Federal budget warehouse, 2020–2025. Twelve dimension tables around one fact table. Hover over or tap a node.

§01Abstract

I work where enterprise data meets language models. At work, I built a calibrated churn model that predicts which customers are likely to stop buying. It runs inside a .NET ERP used by about 100 branches. In research, I’m building a system that answers Spanish questions about Mexico’s federal budget. It decides whether to answer with a generated SQL query or with passages from official regulations, and it declines to answer when the evidence isn’t there. What connects the two is building systems that are reproducible, least-privileged (each part gets only the access it needs), and honest about what they know.

Keywords — text-to-SQL·retrieval-augmented generation·churn modeling·probability calibration·dimensional modeling·least privilege·enterprise .NET

i.

Evidence over assertion

Every answer carries its proof: the SQL that ran, or the passage it cites. When the data can’t support an answer, the right response is to decline to answer.

ii.

Reproducible by default

Every source is recorded with its URL, date and hash. Prompts are version-controlled like code. Each configuration runs three times, and results are reported with the mean and spread.

iii.

Defense in depth

The database doesn’t trust the validator, and the validator doesn’t trust the model. Each layer is clearly labeled with what it can and can’t stop.

§02Selected work

Case studies in data systems, applied AI and full-stack engineering.

For each one: the problem, the architecture, how it was deployed, and the real numbers behind it.

Featured · AI agentPersonal projectOct 2026 Live

finance-coach

An AI money coach that plans every payment around every paycheck, and leaves the arithmetic to tested code.

View repository(opens in a new tab)
TypeScriptNext.js 16React 19Claude APIZodTurso · libSQLTailwind CSS

01The app

The coach planning payments paycheck by paycheck, with amounts and dates
The dashboard on a phone, installed as an app

Screenshots use made-up data.

02Problem

Banking apps show your balances, but not whether this month’s payments fit within this month’s paychecks. With weekly pay, several cards, interest-free installments (MSI) and small loans, the real question is about timing: what’s due before the next payday, and which part of each card balance must be paid in full to avoid interest.

03Approach

A chat coach powered by Claude. It uses tools to look up the user’s real accounts, payment plans and transactions, and it can update them. Every number it quotes comes from a deterministic calculation engine, not from the model. Users upload bank statements and receipts as PDFs, phone screenshots or CSV files, and these become transactions the user reviews.

agent tools to read, calculate and act
20
automated tests on the engine and tools
79
input formats: PDF, screenshot, CSV
3
reply languages: Spanish and English
2

04How the agent works

You ask

“Plan my next 4 paychecks”

Claude

Streaming tool loop with adaptive thinking

Answer

Streamed back; every figure comes from a tool

20 tools

Read

  • get_financial_overview
  • get_cash_flow
  • get_monthly_projection
  • get_spending_summary
  • search_transactions
  • list_records
  • list_payment_targets
  • list_memories

Calculate

  • calculate
  • plan_payoff

Act

  • save_record
  • delete_record
  • record_payment
  • record_money_in
  • log_transaction
  • update_transaction
  • delete_transaction
  • set_profile
  • remember
  • forget

Calculation engine

Due dates from each card’s statement day · MSI vs. pay-in-full balance · cash balance through every payday

libSQL / Turso

Accounts, plans, transactions, goals and chat history

05Engineering decisions

  • Math in code, not in the model

    The model never does arithmetic. Pure, tested functions compute schedules, due dates and balances; the coach reads their results or calls a calculate tool.

  • Tools that act, with guardrails

    Inputs are validated with Zod before any tool runs. Recording a payment updates balances, installment progress and due dates in a single step, and a duplicate check stops the same payment from being recorded twice.

  • Extraction with a human in the loop

    The model reads statements and receipts and returns structured output validated against a schema. If screenshots overlap, repeated rows are removed in the same request, and every row is reviewed before it’s saved.

  • Cache-friendly, append-only history

    Each conversation keeps the same system prompt from start to finish, and new messages are only appended, never edited. This keeps prompt caching effective across turns.

FeaturedUndergraduate thesis · Facultad de Ingeniería Tampico, UAT2026 – 2027 In progress

presupuesto-nlq-mx

Ask Mexico’s federal budget a question in Spanish, and see the SQL that answered it.

View repository
Python 3.14PostgreSQLpsycopg 3sqlglotYAMLLLM APIs

01Problem

Mexico publishes its federal budget as open data, but reading it takes both data skills and government-accounting knowledge. The figures are stored in tables keyed by alphanumeric codes that only make sense if you look them up in separate catalogs, and the rules that explain them are in regulatory PDFs. The data is open, but most people can’t use it.

02Approach

The system answers Spanish questions in one of two ways. The data route turns the question into SQL over a documented semantic layer (descriptive views), validates it, runs it under a read-only database role, and returns the results along with the exact query. The document route retrieves passages from official regulations and answers with citations. A router decides which route to use, and the system declines to answer when the evidence isn’t strong enough.

fact rows loaded and reconciled
1,285,233
fiscal years normalized, 2020–2025
6
dimension tables
12
security checks passing
11/11

03Architecture

Fig. 2 · System architecture and build status
  • Built
  • In progress
  • Planned
Question

Spanish, natural language

RouterPlanned

LLM vs trained classifier vs both routes

Data route · text-to-SQL

Semantic contextBuilt

Descriptive views + classification docs v1

SQL validationPlanned

One SELECT only; reject SET and set_config()

Read-only executionBuilt

consulta_nlq role, 15 s limit

Table + executed SQLPlanned

The query is always shown

Document route · RAG

Document indexPlanned

Articles and clauses with provenance

RetrievalPlanned

BM25 vs dense vs hybrid, ± reranking

Grounded generationPlanned

Faithfulness measured separately

Answer + citationsPlanned

Every claim points to a source

Foundations

PostgreSQL warehouseBuilt

Star schema · 1,285,233 rows · validated load

Evaluation setIn progress

61 questions drafted · human verification gate

Either route can end with the system declining to answer. When the evidence can’t support an answer, saying so is the right result.

04Engineering notes

The CSV and XLSX files don’t match.

The Ministry of Finance publishes each fiscal year in both CSV and XLSX formats. A row-by-row comparison showed they don’t contain the same data, so I choose the source format separately for each year. Every correction is declared in a normalization log, because an unrecorded fix looks the same as tampering with the data.

Each load runs as a single transaction. At the end, it checks that row counts and the totals for each stage (approved, accrued, paid) match the source exactly, down to the peso. If anything doesn’t match, the whole load is rolled back. So if a load log exists, validation passed.

YearSourceWhy
2020.xlsxCSV drops 10 rows
2021.xlsxCSV drops 2 rows and blanks amounts
2022.xlsxCSV drops 3 rows, adds 828,067 filler rows
2023.xlsxCSV drops 1 row and corrupts a key
2024.xlsxCSV overstates branch 51 by MXN 9,699 million
2025.csvBoth formats match; CSV loads faster
Table 1 · Source format per fiscal year, from docs/bitacora_normalizacion.md
Applied ML · In productionCompany work · Unitam

Customer Churn Prediction

Ranks 136K business customers of a retailer with about 100 branches by how likely they are to stop buying. Scores are updated monthly inside the company’s .NET ERP.

At-risk customers were flagged with a recency heuristic: a simple rule based on how recently they last bought. The business needed a ranked list it could act on, built from seven years of invoice history, with a risk percentage that can be trusted: a 30% risk should mean that about 3 in 10 of those customers stop buying.
PR-AUC (was 0.567)
0.617
Brier (was 0.260)
0.167
training snapshots
385K
PythonLightGBMPyTorchpandasSQL ServerC# · .NET2026
Full-stack · Client projectPrivate repositories

Casita Azul Real-Estate Platform

A public listings website and back office for a real-estate agency: a property catalog with maps and favorites, plus an admin console for properties, agents and users.

The agency needed its listings online and a way for staff to manage them without touching the database. Staff needed to publish properties with photo galleries, manage in-house and outside agents, control who can administer what, and see which listings get attention.
API endpoints
37
commits
104
Angular apps
2
Angular 20TypeScriptFlaskPostgreSQLSupabase AuthCloudflare R2DockerAug – Dec 2025

OS Simulators: Memory & CPU Scheduling

Two operating system simulators with live visualization: a paged memory manager built by a team of five, and a CPU scheduler.

Paging, TLB hits, page faults and scheduling policies are easy to describe but hard to visualize. The goal was to show, step by step, how an OS allocates memory and CPU time, and what happens when many processes run at once.
max processes
50
scheduling policies
4
page replacement
FIFO
C99GTKMakeLinux · MinGWNov – Dec 2025

Point-of-Sale System

Manages sales, inventory, customers and users for a small retailer, with role-based access, receipts and email notifications.

A retail business needed to register sales in real time, keep inventory accurate, manage customers and staff, and give managers reports, with each role seeing only what it should.
PythonFlaskMySQLJavaScriptAug – Dec 2025
§03Experience & credentials

Three years from server rooms to production ML.

From IT infrastructure and independent consulting to enterprise .NET, and now machine learning inside an ERP used by about 100 branches.

Timeline

  1. Jul 2026 – Presentnow

    Systems Assistant (Software Development)

    Unitam Uniformes · Tampico, MX

    • Full-time development on UNITAM NT, the company’s ERP and point-of-sale platform (C#, .NET Framework 4.7.1, WinForms, DevExpress, SQL Server), used across about 100 retail branches.
    • Shipped a customer-churn model: monthly batch scoring written back to SQL Server and surfaced in the ERP’s reports. See the case study above.
    • Built reporting modules, using a five-layer architecture, that replaced reports people used to assemble by hand. Also wrote and optimized T-SQL procedures, fixing query timeouts and data-attribution bugs in regional sales reports.
    • Integrated BBVA and Banamex payment terminals into the point of sale (in bank certification) and automated order generation for a key wholesale client.
    • Gathered requirements from the marketing, sales and finance teams. My technical assessment showed that a TikTok Shop → Shopify → ERP integration wasn’t practical yet.
    C#.NET FrameworkDevExpressSQL ServerT-SQLPythonLightGBM
  2. Jan – Jun 2026

    Academic Exchange, Computer Engineering

    Universidad de Burgos · Spain

    • Data mining in Python (classification, clustering, association rules), network analysis with NetworkX, and reverse engineering and refactoring of Java code to meet formal quality metrics.
    PythonData miningNetworkXJava
  3. Feb – Dec 2025

    Software Developer & IT Consultant

    Solbes Soluciones Inteligentes · Tampico, MX

    • My own consulting practice, serving 10–12 local businesses from start to finish: requirements, development, deployment and support.
    • Delivered client software, including a real-estate platform and a questionnaire app for a psychology practice, plus point-of-sale systems with inventory and reporting. Automation scripts cut manual data entry by 60%.
    • Deployed servers, networks and security-camera systems for small-business clients.
    PythonTypeScriptAngularFlaskPostgreSQLDocker
  4. Jan 2023 – Sep 2025

    IT Support & Infrastructure (part-time)

    CIYASA S.A. de C.V. · Tampico, MX

    • Sole IT resource for the offices: kept on-site servers at about 99% uptime and set up dual-ISP failover, so if one internet provider fails, the other takes over.
    • Administered Google Workspace and Google Cloud, and wrote Python tools for monitoring and automation, plus internal utilities and documentation portals.
    PythonLinuxGCPNetworking
  5. Aug 2022 – May 2027

    B.Eng. Computer Engineering

    Universidad Autónoma de Tamaulipas · Tampico, MX

    • GPA 9.13 / 10. Thesis in progress: natural-language querying of Mexico’s public budget data (featured above).
    • Coursework spans linear algebra, probability and statistics, numerical methods, algorithms, operating systems, networks and databases, with AI and embedded systems in the final year.
    AlgorithmsOperating systemsDatabasesAI

Recognition

  • 1st place · team

    CTF MetaRed Mexico National Championship

    Capture the Flag · 2025

  • 1st place · team

    ANIEI CTF at ANUIES-TIC

    Capture the Flag · 2025

Capabilities

ML & Data
LightGBMPyTorchscikit-learnpandasCalibrationText-to-SQLRAG
Languages
PythonC#SQLTypeScriptCJava
Databases
SQL Server · T-SQLPostgreSQLMySQLFirebaseDimensional modeling
Enterprise .NET
.NET FrameworkWinFormsDevExpressLayered architectureReporting
Web & APIs
AngularFlaskRESTSupabaseDocker
Infra & Security
LinuxGCPNetworkingLeast privilegeCTF

§04Contact

Let’s build systems people can check.

I’m open to software engineering and enterprise AI roles, internships and research collaborations, remote or on-site. As a Spanish citizen, I can work anywhere in the EU without needing visa sponsorship. I reply in English or Spanish.