mlops-rag-agent / README.md
atulkrs's picture
Deploy Level 3 Agentic RAG pipeline for MLOps/DevOps Q&A
eec2887 verified
|
Raw
History Blame Contribute Delete
4.14 kB
---
title: MLOps RAG Agent
emoji: πŸ€–
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.18.0
app_file: app.py
pinned: false
license: mit
python_version: "3.10"
short_description: Level 3 Agentic RAG for MLOps/DevOps Q&A
---
# πŸ€– MLOps / DevOps Agentic RAG Agent
A **Level 3 Agentic RAG** pipeline for MLOps and DevOps Q&A, featuring query rewriting, iterative retrieval, self-reflection, source citation, and fallback handling.
## Architecture
```
User Query
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Level 3 Agentic RAG Pipeline β”‚
β”‚ β”‚
β”‚ 1. Query Rewriting (Flan-T5-base) β”‚
β”‚ └─ Reformulates query for better retrieval β”‚
β”‚ β”‚
β”‚ 2. Semantic Retrieval β”‚
β”‚ β”œβ”€ Embeddings: all-MiniLM-L6-v2 (384-dim) β”‚
β”‚ β”œβ”€ Vector Store: ChromaDB (cosine similarity) β”‚
β”‚ └─ Indexing: LlamaIndex (SentenceSplitter) β”‚
β”‚ β”‚
β”‚ 3. Relevance Filtering (Self-Reflection) β”‚
β”‚ └─ Flan-T5 checks if each chunk is relevant β”‚
β”‚ β”‚
β”‚ 4. Answer Generation (Flan-T5-base) β”‚
β”‚ └─ Context-grounded answer synthesis β”‚
β”‚ β”‚
β”‚ 5. Answer Self-Reflection (Flan-T5-base) β”‚
β”‚ └─ Judges completeness β†’ triggers re-retrieval β”‚
β”‚ β”‚
β”‚ 6. Iterative Retrieval (up to 2 iterations) β”‚
β”‚ └─ Follow-up queries if answer is inadequate β”‚
β”‚ β”‚
β”‚ 7. Fallback Handling β”‚
β”‚ └─ General answer when no relevant docs found β”‚
β”‚ β”‚
β”‚ 8. Source Citation β”‚
β”‚ └─ Source doc + cosine similarity per chunk β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
Gradio UI (Answer + Query Info + Reflection + Citations)
```
## Tech Stack
| Component | Technology |
|-----------|------------|
| Orchestration | LlamaIndex Core |
| Vector Store | ChromaDB (persistent) |
| Embeddings | sentence-transformers/all-MiniLM-L6-v2 |
| Generator | google/flan-t5-base |
| UI | Gradio |
## Knowledge Base
The curated knowledge base covers five MLOps/DevOps domains:
- **AWS SageMaker** β€” Training jobs, HPO, endpoints, Pipelines, Feature Store, Model Monitor, Clarify
- **Kubernetes** β€” Pods, Deployments, HPA/KEDA, GPU management, Kubeflow, KServe, Helm
- **CI/CD** β€” GitHub Actions, Jenkins, ArgoCD/GitOps, DVC, MLflow model registry, testing strategies
- **Terraform** β€” HCL syntax, remote state, modules, EKS/SageMaker provisioning, Terragrunt
- **Model Monitoring** β€” Data drift, concept drift, Evidently AI, Alibi Detect, Prometheus/Grafana, Great Expectations
## Example Questions
- How do I configure auto-scaling for a SageMaker inference endpoint?
- What is the difference between data drift and concept drift?
- How do I use Terraform to provision an EKS cluster with GPU nodes?
- Explain how to set up a CI/CD pipeline for model retraining with GitHub Actions.
- How do I deploy a model with canary rollout on Kubernetes using KServe?
- What metrics should I monitor for ML models in production?
## Running Locally
```bash
git clone https://huggingface.co/spaces/atulkrs/mlops-rag-agent
cd mlops-rag-agent
pip install -r requirements.txt
python app.py
```