Data & AI Architect · Senior Data Engineer · 9+ years in industry · Kathmandu, working remotely with US and EU teams
As Senior Data Engineer at UXCam, I lead a team of five engineers and own the architecture of a data platform processing 50 TB and 100M+ events a day, with an agentic AI platform built into it. I design the platform, its governance and its AI, and I build what I design. Security, compliance and access control to data and internal systems are enforced by the platform, not the model.
Open to Senior or Lead Data Engineer, AI Engineer and Data & AI Architect roles, long-term contract or full-time · Résumé · Work with me
What I led in production: rebuilding a data platform for scale and recovery · governing AI output before it becomes product state
- Migrations that don't stop the product. Measure first, then migrate in stages with a way back: analytics from OLTP to a big data lakehouse; two single-server Postgres databases, one a pgvector store, to Citus.
- Platforms chosen on evidence. A proof of concept on criteria fixed in advance, then ingestion, lakehouse and serving that stay correct, recoverable and affordable: 99.9% uptime, 40% lower infrastructure cost.
- Governance an auditor can check. Classification, masking, contracts and access review in the data model; SOC 2 controls for the platform; erasure measured, not assumed.
- AI built into the platform. An agentic AI platform (RAG, MCP servers, LangGraph and Google ADK agents) and an LLM-based video-analysis platform for session recordings. Agents reach data only through access the platform enforces; their output is typed, evaluated and reviewable before it becomes state. With the governed workflow, recurring analytics requests are delivered 60% faster (role-level, before and after).
How I design a platform — two reference architectures for a scenario common across the industry, published in full and measured
- data-platform-architecture — a SaaS company leaving Postgres, from the current state measured at its peak rate (reports on the primary took the product's p95 from 40 to 525 ms) to 18 decisions with machine-checked evidence. Databricks and Snowflake scored 93.4 and 91.8 on the same proof of concept, inside a five-point tie band fixed in advance, so the 36-month cost decided it for Snowflake. Rehearse the CDC cutover: reconcile one reader, switch it, check the answers, roll it back. · case study
- ai-platform-architecture — the same company's text-to-SQL assistant over governed data: told to stay in one customer's data, Qwen3, Llama 3.3 and gpt-oss leaked on 23 of 120 requests; a default-deny query rewrite refuses 44 of 44 hand-written escapes; a semantic layer took Llama 3.3 70B from 55 to 70 of 70. · case study
- Choosing where the data lives — the decision guide behind them: RDS, Citus, TimescaleDB, ClickHouse, Trino, Iceberg and pgvector, by workload, with the measurements behind each rule.
Tools you can run today — each one checks for a failure that is common in production, and installs with one command
- pg-cdc-doctor — read-only checker for CDC from PostgreSQL 13 to 19: a stalled slot that fills the disk, a slot lost on failover, a recreated slot that skips rows, a subscriber that stops on a new column. Debezium, Kafka Connect, native replication and 13 CDC services; fix SQL for review, GitHub Action. ·
pip install pg-cdc-doctor - evalproof — LLM evaluation as measurement: calibrate the judge against a gold sample, correct its pass rate (ACC/PPI), and gate CI only on significant regressions. Local-first with Ollama; ships as a GitHub Action. · case study · live app ·
pip install evalproof - greenproof — a definition-of-done gate for code written by LLM coding agents: it runs the checks itself, reads its policy from the base revision so a change cannot weaken its own gate, and names each weakened test or check by rule, file and line. ·
pipx install greenproof
More production work
Data platforms
- An analytics lakehouse for a contact-centre platform — S3, Trino, Airflow and AWS Glue, delivered configured, with security, access control, HA and DR.
Databases
- Two Postgres servers that ran out of room, moved to Citus — an application database and a pgvector store, scaled out with the data model doing most of the work.
- Managed or self-run PostgreSQL — a capacity plan and a fleet of RDS and Aurora databases, tuned and failover-tested; the same rule decided both.
AI systems
- Short-text classification and alerting for a lakehouse team — a classifier that failed in production, rebuilt around the unit of work, on Databricks.
Open source — each with its method and measurements in the repository; case studies, grouped the same way, at basantbhattarai.com.np/work
- streaming-platform — Kafka, Flink, ClickHouse and Iceberg with Avro contracts and a freshness SLO; every event counted at every layer, exactly-once through broker kills, TaskManager kills and stalls. · case study
- spark-sql-kinesis
— Kinesis source and sink for Spark 4.2 Structured Streaming on AWS SDK v2. Upgrades in place: the checkpoint format is byte-identical, so no drain. · case study
- governed-agent — an AI agent whose output becomes state only after a schema, a policy, a grounding check and, where required, a person: LangGraph + MCP, FastAPI with a PostgreSQL outbox, a Next.js review UI, measured on qwen3:8b, with the same checks rerun unchanged on Claude Sonnet 5.5 as a partial transfer check. · case study
- distributed-db-lab — Postgres scale-out with Citus (migration planner, online rebalance under load with zero errors, tenant isolation), TimescaleDB at scale, and a 2×2 replicated ClickHouse cluster; every failure measured. · case study
- db-failover-lab — six database engines, eight failover scenarios on real multi-node clusters: measured HA, sharding and backup/restore for PostgreSQL 18, Redis, MongoDB, ScyllaDB, SolrCloud and Galera. · case study
Upstream — work with another project's maintainers
- awslabs/spark-sql-kinesis-connector#99 — an opt-in option to stop reading a shard once it is caught up, requested in the project's issue #11; open, awaiting maintainer review.
- citusdata/citus#7333 — a minimal reproduction on Citus 14.2 of node removal leaving cleanup records behind, with the code path; an earlier report of mine, #4776, led to unnamed-constraint support on distributed tables.
Ten more repositories
Data platforms
- dataset-registry — ownership before consumption, as a product: owners, freshness SLOs, versioned JSON Schema contracts, OpenLineage lineage, and breaking changes that wait for consumer acknowledgement. Go, PostgreSQL, Next.js. · case study
- data-stack-lab — hands-on data engineering projects, one per tool, on one generated SaaS dataset with known answers, each checked in CI. dbt: a Type 2 dimension kept all 5,048 invoices on the plan they billed, where Type 1 moved 15.1% of revenue. Airflow 3: backfilled newest-first, high-water-mark loads lost 96.56% of a month with every run green. Data quality: nine injected defects; blocking let 0 of 3,198 bad rows through, and only control totals, volume and per-platform share saw the rows that never arrived. Spark: re-running one day with the default overwrite mode left 1 of 365 daily partitions. Databricks: a truncated file corrected under the same name was skipped by
COPY INTOand Auto Loader, losing 1,638 events. · case study - lakehouse-lab — Iceberg on MinIO with Apache Polaris vending table-scoped credentials to Trino and StarRocks; dbt + Airflow medallion, compaction and rollback, every figure measured. · case study
- rag-pipeline — scrape-to-RAG lakehouse: Airflow, Spark bronze/silver/gold on Delta and MinIO, Chroma, a FastAPI answer service, OpenLineage.
AI systems
- realtime-ml — real-time fraud scoring where leakage, training/serving skew and label delay are measured: Feast, LightGBM, MLflow, shadow serving, drift alerts and a paired-statistics promotion gate. · case study
- retrieval-bench — pgvector, Qdrant and OpenSearch on the same embeddings: recall–latency curves, filtered-search recall collapse and its fixes, build cost, writes under load, and hybrid vs vector nDCG on public BEIR data. · case study
- short-text-triage — label the string, not the row: multilingual embeddings, HDBSCAN and margin-banded assignment on a reproducible generated corpus; CI re-checks the figures. · case study
- prevalence-shift — why counting predicted labels flattens a trend, and how ACC, SLD and prediction-powered inference fix it; CI re-runs all 1,000 replications. · case study · live app
Databases and distributed systems
- postgres-ha-lab — Patroni + etcd on amd64 Rocky 8 under QEMU and pgBackRest over mutual TLS: failover, replica rebuild and point-in-time restore actually performed. · case study
Delivery and infrastructure
- platform-deployments — GitOps for governed-agent on a three-node Kubernetes cluster: Argo CD, an Argo Rollouts canary that aborted a bad release on its own in 6 of 6 runs, CloudNativePG, Kyverno and OpenTelemetry, plus Terraform for EKS. · case study
Recent writing: seven measured pieces
Measured, with the method stated; writing by subject
- RDS, Citus, TimescaleDB, ClickHouse, Trino, Iceberg or pgvector: choosing where the data lives
- Erasing one person rewrote 31.8 million rows. With their e-mail in one table, 60,000.
- The day's work took 38 seconds. The warehouse was billed for 11 minutes.
- We deleted the user from the Delta table. Time travel still returned all 100 rows.
- Told to stay in one customer's data, the models leaked 23 times in 120
- For text-to-SQL, the definitions mattered more than the model
- The read replica was meant to take the reports. 3 of 35 finished.
Stack
In production: Python · SQL · Scala · Spark · Kafka · Kinesis · Airflow · dbt · Iceberg · Trino · ClickHouse · PostgreSQL · Citus · pgvector · Kubernetes · Terraform · AWS · LangGraph · Google ADK · MCP
In labs and projects: Databricks · Unity Catalog · Flink · DuckDB · Go · TypeScript · Argo CD · OpenTofu · MLflow · Feast · Next.js
basantbhattarai.com.np · Résumé · Work with me · LinkedIn · contact@basantbhattarai.com.np


