Skip to content

Generative AI Engineer (Part 1) — Interview 15

Q: What is the difference between a Data Scientist and an AI Engineer? What does "AI Engineer" mean in your context?

  • As a Lead Data Scientist at [Company], my primary focus is on designing and developing advanced machine learning models, conducting data analysis, and driving insights from large datasets to solve business problems.
  • The role of an AI Engineer, in contrast, is broader and more engineering-focused. An AI Engineer is responsible for architecting, building, deploying, and maintaining end-to-end AI systems and applications in production environments.
  • In my experience, an AI Engineer:
  • Designs and implements scalable AI pipelines, including data ingestion, preprocessing, model training, evaluation, and deployment.
  • Integrates machine learning and deep learning models (including LLMs and RAG architectures) into enterprise applications, ensuring they are robust, secure, and production-ready.
  • Works extensively with MLOps practices—such as CI/CD for models, automated retraining, monitoring, and model versioning—to ensure reliability and continuous improvement.
  • Collaborates closely with cross-functional teams (backend, frontend, DevOps, data engineering) to deliver holistic AI solutions that align with business objectives.
  • Focuses on operationalizing AI, including API development, cloud deployment (AWS, Azure), and integrating AI with existing enterprise systems.
  • In summary, while a Data Scientist is primarily focused on model development and analytics, an AI Engineer bridges the gap between research and production, ensuring AI solutions are scalable, maintainable, and deliver real business value. My current responsibilities span both areas, but as a Lead Data Scientist, I am increasingly involved in AI engineering tasks, especially for enterprise GenAI solutions like KGPT and intent classification platforms.

interviewee: So in AI engineering, basically, uh, uh, we can, uh.


Q: What is the distinction between an AI Engineer and a Data Scientist?

  • In my experience, the roles of AI Engineer and Data Scientist, while related, have distinct focuses and responsibilities in an enterprise AI environment:

  • AI Engineer:

  • Primarily responsible for designing, building, deploying, and maintaining AI systems and applications in production.
  • Focuses on end-to-end AI solution engineering, including model integration, API development, orchestration of data and model pipelines, and ensuring scalability, security, and reliability.
  • Works extensively with MLOps practices—CI/CD for models, monitoring, automated retraining, and cloud deployment (e.g., AWS SageMaker, Azure AI).
  • Implements robust testing, prompt engineering, and optimization for LLMs, RAG pipelines, and agentic workflows.
  • Collaborates closely with backend, frontend, and DevOps teams to deliver holistic AI-powered products.
  • Example from my current role: Architecting and deploying the KGPT (Knowledge GPT) assistant, integrating LLMs, RAG, and vector search into scalable APIs for enterprise use.

  • Data Scientist:

  • Focuses on data exploration, statistical analysis, feature engineering, and building machine learning models to extract insights or make predictions.
  • Responsible for model development, experimentation, and evaluation—often using Python, scikit-learn, XGBoost, deep learning frameworks, etc.
  • Works on data preprocessing, EDA, and selecting the right algorithms for business problems.
  • May hand off models to AI Engineers for productionization and scaling.
  • Example from my experience: Designing and benchmarking intent classification models, performing feature engineering, and evaluating model performance before deployment.

  • In summary, Data Scientists focus on model development and analytics, while AI Engineers ensure those models are robustly integrated, deployed, and maintained as part of scalable AI systems in production. In my current role as Lead Data Scientist/AI Engineer, I bridge both areas—leading model development and also architecting production-grade AI solutions.


Q: What is the most complex use case you are using RAG (Retrieval-Augmented Generation) for?

  • The most complex use case where I have implemented RAG is in the automated data relabeling and annotation pipeline for the Universal Intent Determination System (UIDS) at [Company].
  • The challenge was to improve intent classification accuracy, especially given the multilingual dataset (supporting 41 languages) and the limitations of third-party annotation tools, which led to inconsistently labeled data.
  • To address this, I designed an internal RAG pipeline that leverages LLMs and vector databases (ChromaDB) to automate and enhance the data labeling process:
  • Ground Truth Embedding: We embed the ground truth labeled data into a vector store (ChromaDB) for efficient semantic retrieval.
  • Semantic Retrieval: For each new or ambiguous data point, the system retrieves the most semantically similar labeled examples from the vector store.
  • LLM-Assisted Labeling: The retrieved context is provided to an LLM (via OpenAI/Azure APIs), which then suggests or validates the intent label for the new data point, using few-shot and contextual prompt engineering.
  • Synthetic Data Generation: The pipeline can also generate synthetic training examples for underrepresented intents, further improving model robustness.
  • Hybrid Evaluation: We benchmark LLM-based labeling against traditional model predictions, aggregating results and metrics for continuous improvement.
  • This RAG-based relabeling system significantly improved data quality, reduced manual annotation effort, and accelerated model retraining cycles, directly impacting the overall accuracy and reliability of the intent classification platform.
  • Additionally, the pipeline is fully integrated with AWS S3 for artifact management and supports both local and cloud-based workflows, making it scalable and production-ready for enterprise environments.

1. Data Ingestion & Preprocessing - Raw data (user queries and intent labels) is ingested from CSV files, either locally or from AWS S3. - Data cleaning, filtering, and preprocessing are performed using Python scripts and SKLearnProcessor jobs in SageMaker. - Cleaned datasets and intermediate artifacts are stored back in S3 for traceability.

2. Synthetic Data Generation & Augmentation - For intents with limited data, LLMs (OpenAI/Azure endpoints) are used to generate synthetic examples via modular prompt engineering. - Synthetic and original data are merged and versioned in S3.

3. Vector Embedding & Indexing - Sentence transformer models generate embeddings for all queries. - Embeddings are indexed into a vector database (e.g., ChromaDB) to enable semantic retrieval, supporting RAG and annotation workflows.

4. Pipeline Orchestration (State Machine) - The workflow is orchestrated using a state graph (LangGraph), where each step (data prep, translation, embedding, training, inference, evaluation) is a node. - This modular design allows for easy extension, conditional branching, and robust error handling.

5. Model Training & Experiment Tracking - Training jobs (SetFit, CatBoost, XGBoost, etc.) are executed on SageMaker, leveraging managed compute and scalable infrastructure. - MLFlow is integrated for experiment tracking—logging hyperparameters, metrics, and model artifacts for reproducibility.

6. Model Evaluation & Selection - Evaluation scripts compute metrics such as accuracy, precision, recall, MRR, and context utilization. - Best-performing models are selected and registered in the model registry.

7. Deployment & Inference - Selected models are deployed as SageMaker real-time endpoints. - REST APIs (FastAPI) are exposed for integration with enterprise applications. - Inference requests are routed through API Gateway and Lambda, with optional translation for multilingual support.

8. Monitoring, Logging & Feedback - Centralized logging (log_manager.py) captures pipeline events for debugging and monitoring. - Inference events and user feedback are persisted asynchronously via SQS into DynamoDB and PostgreSQL for continuous improvement.

9. CI/CD & Infrastructure as Code - Deployment scripts (Bash, CloudFormation, Azure DevOps, Jenkins) automate infrastructure provisioning, model deployment, and endpoint management. - Security best practices are enforced using IAM roles, KMS, VPC endpoints, and S3 bucket policies.


  • This architecture is cloud-native, modular, and highly extensible—supporting both local development and scalable production workloads. Each pipeline step is independently testable, and the design supports rapid experimentation, robust monitoring, and seamless integration with enterprise systems.

Q: What makes RAG (Retrieval-Augmented Generation) different from using a standard LLM-only approach for intent annotation and prediction?

  • RAG (Retrieval-Augmented Generation) combines the strengths of both semantic retrieval and LLM reasoning, while a standard LLM-only approach relies solely on the model’s pre-trained knowledge and prompt context.
  • Here’s what sets RAG apart in our annotation and intent prediction workflow:
  • Ground Truth Anchoring: RAG uses a curated set of ground truth examples (manually labeled utterances for each intent) as a reference. For each new query, the pipeline retrieves the most semantically similar examples from this set, ensuring the LLM always has highly relevant, domain-specific context.
  • Few-Shot Prompting at Scale: Instead of relying on generic or random few-shot examples, RAG dynamically selects the best-matching examples for each query, making the prompt more targeted and improving prediction accuracy—especially for rare or ambiguous intents.
  • Reduced Hallucination: By grounding the LLM’s reasoning in real, labeled data, RAG significantly reduces the risk of hallucinated or off-topic intent predictions, which is a common issue with LLM-only approaches.
  • Consistency and Robustness: The retrieval step ensures that the LLM’s output is consistent with the organization’s intent taxonomy and labeling standards, leading to higher annotation quality and easier downstream model training.
  • Scalability for Large Intent Sets: With 639 intents and thousands of utterances, RAG efficiently narrows down the candidate space for the LLM, making it feasible to handle large-scale, multi-intent classification tasks.
  • Continuous Improvement: As new labeled data or synthetic examples are added, the retrieval base can be updated without retraining the LLM, allowing the system to adapt quickly to new intents or language variations.
  • In summary, RAG bridges the gap between static LLM knowledge and dynamic, enterprise-specific data, delivering more accurate, explainable, and maintainable intent annotation compared to a pure LLM approach.