Spaces:
Sleeping
Sleeping
| 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 | |
| ``` | |