Afnan Hussain

Afnan Hussain

Gold Medalist ML Engineer Specializing in Agentic Systems and Reinforcement Learning

Based in: Lahore, PunjabCurrently: ML Engineer - I, Dubizzle GroupExperience: 2 years

Hire me

Afnan is a high-achieving ML Engineer at Dubizzle Group with extensive experience building production-grade AI agents, temporal memory services, and reinforcement learning pipelines. He holds a Gold Medal in Data Science and specializes in fine-tuning LLMs using advanced techniques like GRPO, PPO, and RLHF.

Experience

ML Engineer - I

Dubizzle GroupLahore, PunjabworkJun 2026 – Present

Summary

Built and deployed AI voice and WhatsApp agents for key business verticals - Bayut (KSA) real estate, Dubizzle Cars (UAE) automotive, and messaging-centric client interaction workflows - using a tool-calling architecture with ElevenLabs, Muqsam, and Telnyx SIP, handling over 10,000 automated calls in production. Own end-to-end architecture and delivery of Cortex, a centralized temporal-memory service currently live for all business verticals of Dubizzle Group that gives AI agents a pre-built context card on a client before a conversation starts, solving the "cold-start" problem. Built on an async pipeline (RabbitMQ) that reconciles facts over time into a temporal knowledge graph (Graphiti + Neo4j), with multi-tenant isolation and secure auth designed in from the start. Own end-to-end orchestration architecture for AI agent outreach campaigns, decoupling campaign logic from execution so any team can launch a new campaign flow, agent, or channel entirely from the frontend - with zero dev intervention. This cut new-campaign turnaround from an engineering task to a same-day config change, and now powers 13 production workflows running live outreach at company scale.

What I did

  • Designed the software architecture and selected the stack, including Graphiti and Neo4j, for the agent memory system.
  • Managed deployment and latency for the production memory layer.

Results

  • Handled over 10,000 automated calls in production.
ElevenLabsMuqsamTelnyx SIPRabbitMQGraphitiNeo4jAI AgentsWhatsApp APITool-calling architecture

Associate Machine Learning Engineer

Dubizzle GroupLahore, PunjabworkMar 2025 – Jun 2026

Summary

Optimized Whisper-based transcription services across all Dubizzle Group tenants, reducing GPU VRAM from 10GB to 4GB per model with no accuracy loss, achieving 50%+ cost reduction and 2× throughput improvement. Designed and deployed a Multi-Armed Bandit (MAB) agent allocation system with dynamic alpha tuning, KMeans clustering, and rolling performance tracking. Actively used by Bayut (KSA) and Zameen (PK) at scale. Led ongoing R&D and maintenance for the MAB system, conducting deep data analysis of agent performance and real-world outcomes to drive data-informed enhancements and sustained efficiency improvements. Developed a hybrid NER and keyword extraction pipeline combining KeyBERT, TextRank, and spaCy with confidence-aware filtering and name masking for high-precision entity recognition. Deployed ML-based lead classification models on AWS using Lambda, ECR, and S3 for scalable, serverless inference in production. Established Docker best practices across the team, leading design of multi-stage builds, GPU-enabled containers, and load-balancing pipelines on RunPod.

Results

  • Reduced GPU VRAM from 10GB to 4GB per model.
  • Achieved 50%+ cost reduction and 2× throughput improvement.
  • Successfully deployed MAB system used by Bayut (KSA) and Zameen (PK) at scale.
WhisperMulti-Armed BanditKMeansKeyBERTTextRankspaCyAWS LambdaAWS ECRAWS S3DockerRunPodGPU-enabled containers

Data Science Intern

Glowingsoft TechnologiesLahore, PunjabinternshipJun 2023 – Sep 2023

Summary

Built web scrapers using Selenium and BeautifulSoup to automate data extraction pipelines for client projects. Developed deep learning models for image recognition and NLP tasks; produced data visualizations using Matplotlib, Seaborn, and Plotly.

Results

  • Scraped more than 100 YouTube videos for educational purposes.
  • Achieved over 98% scraper accuracy on websites including YouTube, IMDB, and Twitter.
SeleniumBeautifulSoupMatplotlibSeabornPlotlyDeep LearningNLP

Skills

Technical

PythonPython
Agentic AI
NLP
NumPy
LangChain
Scikit-learn
Reinforcement Learning
Pandas
GRPO
PyTorchPyTorch
Whisper
LLM Fine-Tuning
Multi-Armed Bandits
TextRank
SQLSQL
TensorFlowTensorFlow
SimPo
TTRL
RLHF
LangGraph
LlamaIndex
FastAPIFastAPI
DockerDocker
AWS
Chroma
DuckDB
Graphiti
Neo4j
RabbitMQ
NLTK
SpaCy
KeyBERT
ElevenLabs API
PPO
Selenium
RedisRedis
Computer Vision
RunPod
OpenCVOpenCV
TypeScriptTypeScript
pgvector
Node.jsNode.js
Smolagents
n8n
MindsDB
MCP
Genesis Cloud
Software Architecture
Reward Modeling

Projects

LADDER: Self-Improving LLMs via Recursive Decomposition

Developerpersonal
Built the LADDER framework for LLM self-improvement via recursive variant generation and GRPO training, with Test-Time RL (TTRL) for dynamic output refinement during inference. Achieved consistent accuracy improvements across lookup, analysis, and visualization benchmarks.
GRPOTTRLOpenAIDuckDB

CodeInsight: Automated Code Documentation System

Lead Developeracademic
Designed a hierarchical LLM pipeline for generating structured documentation from codebases with a Chat with Document module using RAG for context-aware querying. Integrated RLHF using PPO to improve alignment and accuracy of LLM-generated outputs.
LLMsRLHFPPOLangChainFastAPI

Fine-Tuning Multi-Hop Reasoning Agents with GRPO

Researcher/Developerpersonal
Built a full reinforcement learning training pipeline using OpenPipe ART for GRPO-based fine-tuning of LLMs on multi-hop reasoning tasks with structured rollouts, logprob tracking, and reward modeling. Published technical writeup on Medium.
RLOpenPipe ARTQwen2.5HotpotQA

Reasoning Model using SimPo and GRPO

ML Engineerpersonal
Trained a reasoning model on SkyT1-10K using SimPo and GRPO, aligning LLM outputs with human-like reasoning through preference-based reinforcement learning.
LLM AlignmentRLSkyT1-10KSimPoGRPO

DocuMentor AI

Developerpersonal
Built an agentic RAG system with automatic document relevance grading, query rewriting, and context-aware answer generation over PDF and TXT sources.
Agentic RAGLangChainChromaOllamaStreamlit

Cortex

Sole Ownerpersonal
A memory layer for AI agents that manages interaction history and relevance, ensuring agents can connect with customers using context from up to 90 days prior.
GraphitiNeo4j

Education

Bachelor of Science

National University of Computer and Emerging SciencesData ScienceGPA 3.54Aug 2021 – May 2025

Societies & activities

Ranked 3rd in cohortDean's List (4x)

Intermediate (FSC)

Punjab Group of CollegesPre-EngineeringAug 2019 – May 2021

Recognition

Awards

Gold Medal, Data Science

National University of Computer and Emerging Sciences2025

Awarded for academic excellence in the BS Data Science program.

Silver Medal (2x)

National University of Computer and Emerging Sciences

Certifications

Building Agentic RAG Using LlamaIndex

DeepLearning.AI2024

LangChain: Chat With Your Data

DeepLearning.AI2024

Generative AI with Large Language Models

DeepLearning.AI / CourseraExpires 20252024

Google Data Analytics Professional Certificate

GoogleExpires Aug 20232023

Patents & publications

Fine-Tuning Multi-Hop Reasoning Agents with GRPO

publication2025

Technical writeup on reinforcement learning training pipelines for multi-hop reasoning.

Read it
Hire AfnanReach out about a role, a contract or a conversation.For recruiters

Afnan's twin is AI, it can make mistakes.