MADHAVSUNIL
About
Madhav Sunil is an AI engineer in Trivandrum who builds things that have to explain themselves: small language models for industrial machines, a wheelchair that climbs stairs, and a village of 36 people who gossip.
Right now
- Building governed retrieval and small models for industrial machines at NeST Digital.
- Auditing my old trading bot with Oracle Autopsy, after it claimed ₹10,000 became ₹1,60,000 on a flat market.
- Keeping Rumourtown running: whisper a rumour and watch 36 villagers pass it on.
Open to AI engineering roles and research collaborations.
Work
- Industrial IoT AI mapping: built the AI services that onboard industrial devices and standardise their telemetry, with a local 4B model reading OEM manuals and a 0.5B model mapping raw fields to a 10-industry canonical catalogue behind Designer/Challenger review, physical-unit checks and human approval. 100% precision on 90 held-out cases, 34 ms p99 latency, 986 automated tests, validated across 8 protocols (OPC-UA, MQTT, BACnet/IP, SNMP, REST, FTP, XMPP, OCPP).
- RFQ BOM intelligence: designed a four-stage pipeline turning customer technical data packs (PDF, Word, Excel, drawings, STEP/IGES) into structured engineering BOMs, with a 194-field extraction contract (74/74 validation checks) over 6,210 raw observations. Benchmarked PostgreSQL against Neo4j: 36/36 queries matched an independent oracle and PostgreSQL ran 3 to 4.6x faster at 124,202 records.
- Self-hosted AI platform: built an on-premise ML platform replacing a cloud AI accelerator suite (FastAPI, Next.js 14, PostgreSQL, Ollama, MinIO, Redis), with 201 API endpoints across RAG, NLP-to-SQL, fine-tuning, model registry, deployments and MCP, 17 Docker services with local, multi-tenant SaaS and edge modes, an agentic ML assistant (DeepSeek-Coder 33B) and 391 automated tests.
- ContractRAG: designed governed retrieval that binds every answer to an approved knowledge contract. In a live poisoned-corpus benchmark with an LLM generator it held knowledge leakage at 0% (vector and hybrid search: 60%), out-of-scope retrieval at 0% (vs 18%) and contract compliance at 100% (vs 40%), with zero unsafe or unsupported answers.
- Autonomous stair-climbing wheelchair: built the ROS2 Humble stack (10 packages, 61 nodes, 27 custom messages) for a hybrid wheelchair with mecanum drive and tri-star climb wheels: a 19-state controller using dual OAK-D depth cameras for stair-edge, drop-off and marker detection, IMU seat levelling, an STM32 motor bridge and an MQTT cloud layer. In a continuous 15.6-minute autonomous Gazebo mission it climbed 3 flights, descended 1, made 5 vision-guided turns and avoided an obstacle with zero manual takeovers.
- NLP-controlled robotic arm: 6-DOF arm driven by text or voice, using Whisper large-v3 and Llama 3.3 70B to produce servo plans for custom Arduino firmware, plus YOLOv8 vision with homography calibration for automatic targeting.
- Warehouse digital twin: headless FreeCAD-to-Unity pipeline converting CAD assemblies to glTF 2.0 and their mechanical joints into runtime Unity constraints.
- Reverse-engineered legacy systems and delivered end-to-end automation pipelines using RPA and Workato.
- Won First Prize in a company-wide Hackathon for an SQL-AI driven analytics platform.
- Conducted a comprehensive study on the relationship between pulmonary embolism (PE) and heart failure.
- Developed a hybrid deep reinforcement learning strategy (A3C + PPO) to enhance clinical model performance.
- Applied SMOTE and LIME, work that led directly to a peer-reviewed publication in Springer Nature.
- Mentored 20+ junior members in ML, deep learning and data pipeline design across hackathons and research projects.
- Delivered two end-to-end computer vision projects covering image classification and object detection pipelines.
- Built an AI-powered speech-to-text module for automated meeting transcription using NLP pipelines.
- Developed intelligent web scraping systems for structured data extraction and downstream analytics.
Tools I reach for
Research
Developed an interpretable deep RL framework (PPO + A3C) for early detection of pulmonary-embolism-induced heart failure. Integrated SMOTE-based class balancing and LIME-driven explainability to deliver clinically transparent, reliable predictions. Peer-reviewed and indexed in Springer Nature.
DOI: 10.1007/S44163-025-00560-X →Inside ContractRAG
Same model, same question. Only one of them is allowed to read everything.
Ten maintenance questions went to the same LLM, over documents with an off-topic file planted among them. Plain vector search reads whatever ranks highest. ContractRAG reads only what an approved knowledge contract allows, checks every claim against that evidence, and refuses when it cannot. These are the recorded runs.
What PPE is required for standard compressor maintenance tasks?
Plain vector search
Reads whatever ranks in the top five.
- S1Safety SOP
- S2Safety SOP
- M1Maintenance manual
- M2Maintenance manual
- X1Off-topic policy fileoutside contract
Safety glasses and cut-resistant gloves are required for standard compressor maintenance tasks according to SOP-MNT-014. Steel-toe boots and hearing protection may also be needed depending on the task's specific hazards as mentioned in Source 1: compressor_motor_safety_sop.md.
This answer was written with 1 off-topic passage in its context.
ContractRAG
May read the safety SOP and the maintenance manual. Nothing else.
- S1Safety SOP
- S2Safety SOP
- M1Maintenance manual
- M2Maintenance manual
- M3Maintenance manual
Safety glasses [Source 1] Cut-resistant gloves [Source 1] Steel-toe boots [Source 1] Hearing protection [Source 1]
The trade-off is real: ContractRAG refused four questions the documents could answer, so it handled half the set correctly where plain search handled all of it. In exchange it never read text it was not cleared for. Ten questions, eight passages, one recorded run, every answer labelled by a human reviewer. It shows the mechanism, not scale.
Things I've built


