Tech Lead at Bettergy · Málaga, Spain

I build production systems for AI, data and the infrastructure underneath them.

Backend and platform engineer working across retrieval and agent systems, multi-tenant platforms, time-series pipelines and Kubernetes. I own systems end to end, from design doc to on-call.

18,000+
conversations served by a retrieval platform I designed
52→89%
answer accuracy after building an LLM evaluation harness
−43%
infrastructure and model spend through rightsizing and model tiering
4 months
from blank repo to production for a multi-tenant IoT platform

Selected work

Systems in production

Bettergy · AI platform

Retrieval & document-verification platform

Multi-tenant retrieval over regulatory documentation with cited answers, plus an agentic workflow that verifies case files against a 29-item regulatory specification.

  • Hybrid BM25 + vector retrieval with cross-encoder reranking on pgvector
  • Idempotent ingestion pipeline: 11,500+ runs at 99.7% success
  • LangGraph state machine with human-in-the-loop checkpoints; review time from 3–4 hours to minutes

PythonDjangopgvectorCeleryLangGraphLangfuse

Bettergy · new product line

MIOT — multi-tenant IoT monitoring

Designed and launched a new revenue stream: telemetry ingestion from Modbus, MQTT and LoRaWAN devices with electricity-cost simulation over historical data.

  • Tenant isolation with PostgreSQL Row-Level Security across HTTP and async workers
  • TimescaleDB hypertables with real-time continuous aggregates
  • 189 API endpoints, 5-level RBAC, 4,000+ tests and 14 architecture checks in CI

Django NinjaTimescaleDBNext.jsKubernetes

Bettergy · core platform

Energy-certification platform

Core platform processing 1,200+ certificates a year for 97+ partner organizations, representing €40M in annual projects.

  • Versioned external API with scoped auth, throttling and dedicated queues
  • Certificate state machine enforced by PostgreSQL triggers, invariants verified in CI
  • PAdES digital signing with multiparty signature chains

DjangoPostgreSQLCeleryPAdES

University of Málaga · R&D

Soil-moisture data pipeline

Production pipeline for a national research project processing 300 GB/month of geospatial and meteorological data.

  • Replaced a paid system with in-house evapotranspiration and water-balance models
  • Runtime from 4+ hours to under a minute via vectorization and columnar storage
  • Regression Kriging across Andalusia; thesis graded 9.8/10 with Honors

PythonGeoPandasParquetDjango

Open source

Building in public

All projects
PythonIn progress

Agent Efficiency Lab

Per-task cost, latency and quality telemetry for LLM agents built on Google ADK, with model routing learned from evals and a semantic cache that measures its own false hits. Benchmarked on public agent benchmarks.

LLM evaluationmodel routinginference cachingOpenTelemetry

GoPlanned

Durable Executor

A small durable-execution engine for long-running agent workflows: Raft-replicated log, leases, idempotent activities, SLO-based alerting and fault-injection tests with published postmortems.

consensusexactly-once semanticsSREfault injection

C++Planned

Columnar Time-Series Engine

A columnar time-series store with Gorilla and delta-of-delta compression and vectorized execution, exposed as a DuckDB extension that supports federated queries with predicate and aggregate pushdown.

storage formatscompressionSIMDquery pushdown

Writing

Latest notes

All writing

First deep dives are on the way.

Experience

Where I've worked

  1. Tech LeadBettergy2025 — now
  2. Senior Software EngineerStartup Wise Guys2024 — 2025
  3. Founding EngineerBlueberry Málaga2023 — 2024
  4. Software Engineer, R&DUniversidad de Málaga2022 — 2023

B.Sc. Telecommunications Engineering, Universidad de Málaga.

Let's talk

Happy to chat about agents, distributed systems or data infrastructure.

im@rafafuentes.com