Skip to content

Projects

Data engineering, architecture and AI projects: from lakehouses and MLOps to agents, MCP and AI deployed at the edge.

LLM Extraction with Evals: Know When to Trust the Output

CI/CD Status

Goal: Extracts invoice fields with Claude or Gemini, keeps the exact text behind every value, scores each field and sends doubtful documents to a person.

Impact: Shows why field accuracy alone misleads: a regex baseline gets 86% of fields right but only 25% of documents.

  • Python
  • Claude (structured outputs)
  • Gemini
  • Pydantic
  • pytest
  • GitHub Actions
Architecture
LLM extraction with evals: 1. 60 invoices are generated in 4 layouts, and the right answer for every field is kept as a gold label. 2. Three extractors read the same invoices: Claude with structured outputs, Gemini with a response schema, and a regex baseline that sets the bar. Each run is saved as a JSONL file, so it can be scored again without calling a model. 3. Values are normalized (1.234,50 = 1234.50) and compared with the gold labels, field by field. 4. Every value must come with a quote found in the invoice. If every value is backed, the invoice is auto-accepted; otherwise a person reviews it. 5. The scorecard puts runs side by side, and a gate command fails a CI job when field accuracy drops below the bar.ExtractorsScoringRoutingInvoices 60 generated, 4 layoutsClaude structured outputsGemini response schemaRegex baseline the bar to beatRun files JSONL, replayableGold labels known answersEvidence check quote in the docField scoring normalized, per fieldAuto-accept every value backedHuman review anything doubtfulScorecard side by side, CI gateCIruff + pytest · regex baseline run and scored on every pull request · Claude and Gemini runs need an API key

Claude Code Data Template: Guardrails for AI on Data Projects

CI/CD Status

Goal: A dbt + DuckDB starter where Claude Code follows data rules, and hooks block DROP, production targets and secrets before they run.

Impact: 34 hook tests and 12 dbt data tests, including a reconciliation that fails if a join starts dropping orders.

  • Claude Code (hooks, subagents, skills)
  • dbt
  • DuckDB
  • Python
  • pytest
  • GitHub Actions
Architecture
Claude Code data guardrails: 1. CLAUDE.md gives Claude the house rules: layers, grain, and what "done" means. Two subagents (reviewer, incident investigator) and two skills (new model, reconcile) cover common jobs. 2. Permissions let the dbt, pytest and ruff commands run without asking, and deny reading .env and force pushes. 3. Before a command runs, guard_bash blocks DROP, TRUNCATE, DELETE without WHERE, dbt against prod and force pushes. Before an edit, guard_files blocks secret files and anything that looks like a key or password. 4. After a model edit, check_model makes sure the model has tests and that marts list their columns instead of SELECT *.SessionBefore a tool runsrulestoolBashEditdbt buildedit modelafterCLAUDE.md layers, grain, doneClaude Code session in the repoSubagents + skills review, reconcilePermissions dbt allowed, .env hiddenguard_bash DROP, prod, force pushguard_files secrets, .env, keysdbt + DuckDB demo shop, 12 testscheck_model tests, no SELECT *FeedbackA blocked command or a failed check exits 2: Claude reads the reason and fixes it in its next stepCIruff + 11 hook tests + dbt build on DuckDB

table-diff: Prove a Data Migration Is Right

CI/CD Status

Goal: Compares a legacy table with its migrated copy by hash, from day to row to cell, and filters out the harmless noise every migration adds.

Impact: Compares 1,000,000 rows in 0.09s on a laptop and finds exactly the 3 planted bugs; exit codes make it a CI gate.

  • Python
  • DuckDB
  • SQL
  • pytest
  • GitHub Actions
Architecture
table-diff: migration validation: 1. Both tables are read as they are: Parquet, CSV, JSON or a DuckDB table. Noise rules (float decimals, trimmed spaces, empty = NULL) stop harmless differences from counting. 2. Partition pass: one SQL query counts rows and sums a row hash per partition, for example per day, on each side. If every partition matches, the check stops here. 3. Only inside partitions that differ: the row pass finds keys missing on either side, and the cell pass names the columns that changed, with examples. 4. The result comes out as Markdown or JSON, and as an exit code (0 match, 1 differences, 2 error), so a CI job can fail on a bad migration.InputsDuckDB: every pass is SQLviewsif diffLegacy table files or a DB tableMigrated table same key, new platformNoise rules floats, spaces, NULLsPartition pass count + hash per dayRow pass missing or extra keysCell pass which columns changedReport Markdown or JSONExit code 0 match · 1 diff · 2 errorCIruff + pytest on Python 3.11–3.13 · demo diff of 200,000 generated rows

Data Incident Casebook

CI/CD Status

Goal: Three reproducible data incidents worked like investigations: symptom, hypotheses, evidence, root cause, fix and a guard that stays.

Impact: Match rate restored from 57% to 98%, a 15% revenue overstatement closed, and 5 reusable guard checks.

  • Python
  • DuckDB
  • SQL
  • pytest
  • GitHub Actions
Architecture
Data incident casebook: 1. Each incident builds its own data and a small DuckDB pipeline in SQL (raw, staging, report), then breaks it the way real pipelines break: a silent join loss, a key format change, duplicate events. 2. The investigation starts from the symptom and lists hypotheses, cheapest to check first: did the source change, did a step drop rows, did a key change? 3. Each hypothesis gets one evidence query from a shared check library (reconcile counts, match rate, key shapes, duplicate share) and is confirmed or rejected by the numbers. 4. The confirmed cause gets the smallest safe fix, and a guard check from the same library stays in the pipeline so it cannot happen silently again. 5. Everything is written to a Markdown case file with before and after numbers, all computed from the data.IncidentInvestigationOutcomesymptomsame checksGenerated data no client dataPipeline under test raw → staging → reportHypotheses cheapest firstEvidence queries one per hypothesisCheck library reconcile, keys, dupesRoot cause confirmed by dataCase files Markdown in docs/Fix smallest safe changeGuard checks stay in the pipelineCIruff + pytest on Python 3.11–3.13 · `casebook run all` rebuilds the three case files

AI-Powered Data Lake: Claude + MCP Server

Goal: Medallion-architecture data lake that ingests CRM, ERP and API data, uses Claude to advise on data quality, generate SQL and business insights, and exposes the lake to agents through an MCP server

Impact: End-to-end pipeline from raw data to business-ready KPIs, where AI agents query the lakehouse directly via MCP

  • Claude (Sonnet + Opus)
  • MCP
  • AWS S3
  • Glue
  • Athena
  • PySpark
  • dbt
  • CloudFormation
  • pytest
Architecture
AI-Powered Data Lake: 1. Connectors read three sample sources (CRM JSON, ERP CSV, paged API JSON), validate each record and flatten nested fields. 2. Claude Sonnet profiles every new dataset as it lands in Bronze. 3. Silver: rows are typed, dates moved to UTC, exact duplicates removed, then checked for completeness, valid ranges and unique IDs. When a check fails, Sonnet suggests a fix. 4. Gold: ERP orders become daily metrics, KPIs and a report with a short AI summary. Claude Opus, the slower model, is used only here, for business insights on the Gold data. 5. An MCP server lets agents browse the catalog, table schemas and quality reports. Its SQL tool answers in demo mode for now.SourcesPython pipeline: Bronze → Silver → GoldAgent accessJSONCSVJSONBronzeprofilefailed checksSilverGoldMCPCRM contacts JSON sampleERP orders CSV sampleAPI events paged JSON sampleConnectors validate, flattenClaude Sonnet profiles, advisesClean + dedupe types, UTC, dupesQuality rules nulls, ranges, IDsClaude Opus business insightsDaily metrics KPIs from ordersBusiness report KPIs + AI summaryMCP server schemas, qualityAI agents Claude, CursorAWS as codeCloudFormation: S3 lake · Glue catalog + PySpark job · Athena + dbt models · SNS alertsCIruff + 92 pytest tests on every pull request · Claude calls mocked without an API key

Offline AI Tutor with Gemma 4 for Rural Peru

Goal: Educational tutor running Gemma 4 locally on a community edge server, so primary students without internet can use AI from basic phones over local WiFi

Impact: Built for GDG Lima's Build with Gemma competition (Local AI & Edge track): AI deployed where the user is, with no connectivity required

  • Gemma 4
  • Ollama
  • Google ADK
  • FastAPI
  • Angular
  • RAG (TF-IDF, scikit-learn)
  • Docker Compose
Architecture
Offline AI Tutor (Gemma 4): 1. A student opens the Angular web app and asks a question; it goes to the FastAPI backend. The plan is phones on the school WiFi, but the app still points at localhost, so today it runs on the server computer itself. 2. FastAPI hands the question to a Google ADK tutor agent with a primary-school prompt: MINEDU curriculum, three short sentences, plain text. 3. The agent always calls its one tool first: a TF-IDF search over chunks of official MINEDU booklets for the student’s grade. With no material for that grade or subject, it says so instead of making things up. 4. Gemma 4 writes the answer: on the school computer through Ollama with no internet, or through the Gemini API in cloud mode. The agent is the same in both. 5. Before class, a script reads the PDFs with PyMuPDF, saves the chunks in SQLite and rebuilds the TF-IDF index. Chats are saved in SQLite too.AgentKnowledge baseRESTchatstoollocalcloudindexStudent browser Angular web appFastAPI chat + students APIGemini API Gemma 4, cloud modeGoogle ADK tutor agentGemma 4 local via OllamaTF-IDF search material search toolMINEDU PDFs official bookletsPyMuPDF pages → chunksSQLite students, chats, chunksModesMODE=local: Gemma 4 on Ollama, no internet · MODE=cloud: same agent, Gemma 4 through the Gemini APICIruff + pytest for the API · Angular build and unit tests

Enterprise RAG & LLM Platform

CI/CD Status

Goal: RAG system with hybrid search (vectors + BM25), LLM integration, and automated evaluation using Ragas

Impact: Complete knowledge management pipeline with quality metrics (Ragas), API metrics, and structured logs

  • ChromaDB
  • OpenAI/Groq
  • FastAPI
  • Ragas
  • Prometheus
  • Docker
  • CI/CD
Architecture
Enterprise RAG Platform: 1. The ingest script loads PDF, DOCX and TXT files, splits them on natural boundaries with some overlap, embeds each chunk (OpenAI or a local model) and stores the vectors in ChromaDB. 2. A client sends a question to POST /rag on the FastAPI service. 3. The hybrid retriever searches ChromaDB and fuses the results with BM25 keyword hits using Reciprocal Rank Fusion (k = 60). The ingest script does not build the BM25 index yet, so today only vector results come back. 4. The best chunks become the context, and an OpenAI-compatible LLM (OpenAI or Groq) writes the answer. 5. A Ragas evaluator scores answers for faithfulness, answer relevancy and context precision. It runs by hand, not in CI yet.Ingest scriptquestionvectorscontextDocuments PDF, DOCX, TXTRecursive split chunks with overlapEmbeddings OpenAI or localChromaDB vector storeRagas evals 3 quality metricsLLM service OpenAI or GroqClient POST /ragFastAPI REST + docsHybrid retriever RRF, k = 60BM25 index built only in testsObservabilityPrometheus metrics on every route · JSON logs with a correlation ID per requestCIblack + flake8 + 51 pytest tests · Ragas evals are not in CI yet

US Accidents Data Lakehouse (Spark)

CI/CD Status

Goal: Spark-based lakehouse with Medallion Architecture (Bronze/Silver/Gold), streaming pipelines, ML training, and Airflow orchestration

Impact: Bronze/Silver/Gold Spark pipeline with batch and streaming ingestion, date-partitioned Parquet, and a Random Forest model that predicts severity

  • PySpark
  • Structured Streaming
  • Spark ML
  • Parquet
  • Airflow
  • Docker
Architecture
US Accidents Spark lakehouse: 1. US Accidents CSV files from Kaggle are read with a fixed schema and written to Bronze as Parquet, partitioned by year and month. A streaming version reads the same folder in 30-second micro-batches. 2. Silver: strings are cleaned, nulls handled, duplicate IDs removed and out-of-range values filtered. 3. Gold: time, location, weather and road features for each accident. 4. A Spark ML Random Forest learns accident severity (1 to 4) from the Gold features. The daily Airflow DAG runs ingest, Silver, Gold and training in order. 5. Inference loads the saved model and scores Gold rows in batch.Daily Airflow DAGBronzeBronzeSilverGoldmodelUS Accidents Kaggle CSVBatch ingest fixed schemaStreaming ingest 30 s micro-batchesClean + checks nulls, dupes, rangesGold features time, place, weatherRandom Forest Spark ML, severity 1–4Inference batch scoringStorageevery layer is Parquet; Bronze and Silver are partitioned by year and monthCIblack + flake8 + mypy + pytest per layer · Docker image build

Market Risk Analytics Platform

Goal: Trades and prices become positions and market value on Databricks; a historical VaR (95%, 99%) notebook is written and waits for its Silver price table

Impact: The same chain defined as a Databricks job and a Control-M flow, plus a local DuckDB version that CI rebuilds and tests on every pull request

  • Databricks
  • Delta Lake
  • PySpark
  • Airflow
  • Control-M
  • DuckDB
  • GitHub Actions
Architecture
Markets Data Hub: market risk: 1. Trades and market prices arrive as CSV files. 2. Trades are summed into a net position per instrument (Silver), and prices are cleaned into a Bronze Delta table. 3. Gold: each position times its last close gives the market value per instrument. This is the chain the Databricks job and the Control-M flow run, and CI rebuilds the same models in DuckDB and tests them. 4. A historical VaR notebook (95% and 99%, per position and portfolio) is written, but it reads a Silver prices table that no step creates yet, so it does not run in the pipeline.Runs end to endWritten, not wiredTrades CSV filesMarket prices CSV filesPositions net qty per instrumentBronze prices cleaned, DeltaMarket value position × last closeVaR notebook historical 95 / 99Silver prices no step writes itJobs as codeDatabricks job and Control-M flow run the 3-step chain · Airflow DAG (daily 06:00, 4-hour SLA) calls notebooks not in the repoLocal & CIthe same chain as DuckDB SQL, rebuilt and tested on every pull request · black + flake8

Retail Analytics Platform (dbt + Databricks)

Goal: Modern analytics engineering platform with dimensional modeling (Kimball), incremental models, and dbt_expectations tests

Impact: Analytics pipeline with customer segmentation (RFM), customer history (SCD Type 2), and incremental daily facts

  • dbt
  • Databricks
  • dbt_expectations
  • Z-ORDER
  • SQLFluff
  • GitHub Actions
Architecture
Retail analytics with dbt on Databricks: 1. Customers, orders and products load as dbt seeds, and staging views clean names and types. 2. Intermediate models compute RFM and lifetime value per customer, and join orders with customers and products. A snapshot keeps customer history as SCD Type 2. 3. Marts: customer, product and date dimensions, order and sales facts, and a daily sales table that updates incrementally with MERGE. 4. Delta post-hooks run OPTIMIZE (ZORDER on dimension keys), and dbt exposures list the dashboards that read the marts.IntermediateMarts (Delta)dbt seeds raw CSV tablesStaging views, clean typesCustomer metrics RFM, lifetime valueEnriched orders orders + customersHistory snapshot, SCD Type 2Dimensions customer, product, dateFacts orders, salesDaily sales incremental mergeDashboards dbt exposuresDatabrickspost-hooks run OPTIMIZE on marts, ZORDER BY key on dimensions · dbt and dbt_expectations testsCISQLFluff lint (warnings only) · dbt deps + parse · dbt build is skipped without Databricks credentials

Telco Churn MLOps Platform

CI/CD Status

Goal: MLOps pipeline with MLflow tracking and registry, FastAPI serving and deploys to Cloud Run

Impact: Model registry, an API with request metrics and a deploy on every release; weekly retraining and Evidently drift checks are written but not running yet

  • XGBoost
  • MLflow
  • FastAPI
  • Evidently AI
  • Docker
  • Terraform (Cloud Run)
  • GitHub Actions
Architecture
Telco churn MLOps: 1. The Telco churn dataset is downloaded with the Kaggle API, cleaned, encoded and given extra features. 2. An XGBoost classifier is trained next to a Random Forest baseline. Parameters, metrics and the model go to MLflow, and the model is registered. 3. The FastAPI service loads the Production model from the registry (or the latest one) and serves /predict, /predict/batch, /health and request metrics. 4. On a release, a workflow builds the API image, pushes it and deploys it to Cloud Run. A weekly retrain workflow is written, but it has never passed and GitHub paused it. Evidently drift checks are written but no job runs them yet.TrainingServingregistermodeldeployTelco dataset Kaggle APIFeatures clean, encodeEvidently drift checks, not runXGBoost vs RF baselineMLflow runs + model registryFastAPI /predict, /healthCloud Run Docker image, gcloudAutomationdeploy on release: Docker → GCR → Cloud Run · Terraform modules for Cloud Run, storage, IAM · weekly retrain pausedCIblack + flake8 + mypy + 51 pytest tests

Road Accident Prevention in Peru (Thesis)

Goal: Normalization, analysis and prediction of road accidents in Peru using 2008–2023 historical data

Impact: Excel-to-Parquet ETL tested in CI, lag and region features, three Spark ML models compared with time-series cross-validation, and a dashboard with the 2024–2025 forecast

  • Python
  • PySpark
  • Spark ML (Random Forest, GBT, GLM)
  • Parquet
  • Jupyter
Architecture
Road Accident Prediction, Peru: 1. The ETL reads the 2008–2023 Excel workbook, where every sheet has its own layout, and turns it into long tables by region, year and category, saved as Parquet. CI runs it on the real file. 2. In PySpark, each region gets lag features, region codes and a COVID-years flag. 3. Three Spark ML models (linear GLM, Random Forest, gradient-boosted trees) are compared with time-series cross-validation. Random Forest wins. 4. Its predictions, including a 2024–2025 forecast, are saved as CSV and loaded into an HTML dashboard. 5. A separate Flask page asks for region, time of day and weather, but it uses a fixed formula, not the trained model.ETL, tested in CIJupyter + Spark MLtrainExcel workbook 2008–2023 dataPython ETL sheets → long tablesParquet region × yearFlask demo no model behind itPySpark features lags, region, COVIDDashboard HTML + JSONRandom Forest best of GLM, RF, GBTPredictions CSV, 2024–2025 tooCIruff + pytest, including a full ETL run on the real workbook

JobFlow: GenAI Job Search Agent

Goal: Agent that finds Data Engineer roles daily, scores them against your CV and uses an LLM to write a tailored application pack per job

Impact: Automated daily run that deduplicates postings, filters out unrelated roles and outputs a tailored PDF CV, cover letter and recruiter message per job

  • Python
  • JobSpy
  • SQLite
  • Groq / OpenAI
  • RenderCV
  • GitHub Actions
Architecture
JobFlow GenAI Agent: 1. Every morning a GitHub Actions job runs JobSpy over LinkedIn, Indeed, Google Jobs and ZipRecruiter for data engineering roles posted in the last 72 hours. 2. Rows are cleaned and saved to SQLite. A job seen before is ignored, and jobs that already got an apply pack are skipped. 3. Each new job is scored against the CV: word overlap (55%), must-have tools such as Airflow or Spark (30%) and nice-to-haves (15%). Jobs under the minimum score are dropped. 4. For the top 15, an OpenAI-compatible LLM (Groq or OpenAI) writes a tailored CV, rendered to PDF with RenderCV, a cover letter and a short recruiter message, in English or Spanish to match the job.Daily runApply pack per jobcleannewtop 15Job boards LinkedIn, Indeed +2JobSpy last 72 hoursYour CV PDF + YAMLSQLite no repeatsLLM Groq or OpenAI APIMatch score CV overlap + keywordsTailored CV PDF via RenderCVCover letter EN or ESRecruiter note short messageScheduleGitHub Actions, every day at 07:00 Lima · the output folder is saved with the runCIruff + pytest