# pavan1604-cmyk/rag-evaluation-and-metrics-dashboard architecture

> Architecture diagram of the GitHub repository pavan1604-cmyk/rag-evaluation-and-metrics-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard
- Repository: https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard

## Overview

This is a PDF question-answering RAG application with a Streamlit dashboard and a separate RAGAS evaluation workflow. Users ask questions through the dashboard; the pipeline loads and chunks the report, embeds and retrieves candidate passages, reranks them, then generates an answer. Evaluation runs a question/ground-truth dataset through the same pipeline, scores results with RAGAS, and writes a CSV that the dashboard presents. The dashboard also exposes retrieval diagnostics. The README is empty; unsampled dashboard behavior and storage wiring are not asserted.

Main entry points: [`src/rag_pipeline.py`](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/rag_pipeline.py) (RAG pipeline), [`dashboard/app.py`](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/dashboard/app.py) (Streamlit dashboard), [`evaluation/run_evaluation.py`](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/run_evaluation.py) (Evaluation runner), [`src/generator.py`](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/generator.py) (Answer generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_rag["RAG workflow"]
  node_report["Company report<br/>[company_report.pdf]"]
  node_pipeline["RAG pipeline<br/>[rag_pipeline.py]"]
  node_loader["PDF text loader<br/>[document_loader.py]"]
  node_chunker["Text chunker<br/>[chunker.py]"]
  node_embeddings["Text embeddings<br/>[embeddings.py]"]
  node_retriever["FAISS retriever<br/>[retriever.py]"]
  node_reranker["Cross-encoder reranker<br/>[reranker.py]"]
  node_generator["Answer generator<br/>[generator.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evalrunner["Evaluation runner<br/>[run_evaluation.py]"]
  node_evaldata["Evaluation questions"]
  node_ragas["RAGAS metrics<br/>[run_evaluation.py]"]
  node_ragasllm["RAGAS LLM adapter<br/>[ragas_llm.py]"]
  node_ragasembed["RAGAS embedding adapter"]
  node_results["Evaluation results"]
end

subgraph group_services["External services"]
  node_groq{{"Groq API"}}
end

node_user(("Questioner"))

node_user -->|"asks question"| node_dashboard
node_dashboard -->|"loads and queries"| node_pipeline
node_pipeline -->|"loads PDF"| node_loader
node_report -.->|"provides document"| node_loader
node_pipeline -->|"chunks text"| node_chunker
node_pipeline -->|"creates vectors"| node_embeddings
node_pipeline -->|"builds and searches"| node_retriever
node_pipeline -->|"reranks candidates"| node_reranker
node_pipeline -->|"generates answer"| node_generator
node_generator -->|"requests completion"| node_groq
node_evalrunner -->|"reads questions"| node_evaldata
node_evalrunner -->|"runs queries"| node_pipeline
node_evalrunner -->|"evaluates responses"| node_ragas
node_ragas -->|"uses LLM"| node_ragasllm
node_ragas -->|"uses embeddings"| node_ragasembed
node_ragasllm -->|"requests completion"| node_groq
node_evalrunner -->|"writes scores"| node_results
node_dashboard -.->|"displays evaluation"| node_results
node_dashboard -->|"embeds diagnostic query"| node_embeddings
node_dashboard -->|"searches candidates"| node_retriever
node_dashboard -->|"reranks candidates"| node_reranker

click node_dashboard "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/dashboard/app.py"
click node_report "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/data/company_report.pdf"
click node_pipeline "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/rag_pipeline.py"
click node_loader "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/document_loader.py"
click node_chunker "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/chunker.py"
click node_embeddings "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/embeddings.py"
click node_retriever "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/retriever.py"
click node_reranker "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/reranker.py"
click node_generator "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/generator.py"
click node_evalrunner "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/run_evaluation.py"
click node_evaldata "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/evaluation_dataset.csv"
click node_ragas "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/run_evaluation.py"
click node_ragasllm "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/ragas_llm.py"
click node_ragasembed "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/ragas_embeddings.py"
click node_results "https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/results/evaluation_results.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard toneBlue
class node_report,node_pipeline,node_loader,node_chunker,node_embeddings,node_retriever,node_reranker,node_generator toneAmber
class node_evalrunner,node_evaldata,node_ragas,node_ragasllm,node_ragasembed,node_results toneMint
class node_groq toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Streamlit dashboard](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/dashboard/app.py): `dashboard/app.py`

### RAG workflow

- [Company report](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/data/company_report.pdf): `data/company_report.pdf`
- [RAG pipeline](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/rag_pipeline.py): `src/rag_pipeline.py`
- [PDF text loader](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/document_loader.py): `src/document_loader.py`
- [Text chunker](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/chunker.py): `src/chunker.py`
- [Text embeddings](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/embeddings.py): `src/embeddings.py`
- [FAISS retriever](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/retriever.py): `src/retriever.py`
- [Cross-encoder reranker](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/reranker.py): `src/reranker.py`
- [Answer generator](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/generator.py): `src/generator.py`

### Evaluation

- [Evaluation runner](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/run_evaluation.py): `evaluation/run_evaluation.py`
- [Evaluation questions](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/evaluation_dataset.csv): `evaluation/evaluation_dataset.csv`
- [RAGAS metrics](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/evaluation/run_evaluation.py): `evaluation/run_evaluation.py`
- [RAGAS LLM adapter](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/ragas_llm.py): `src/ragas_llm.py`
- [RAGAS embedding adapter](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/src/ragas_embeddings.py): `src/ragas_embeddings.py`
- [Evaluation results](https://github.com/pavan1604-cmyk/rag-evaluation-and-metrics-dashboard/blob/main/results/evaluation_results.csv): `results/evaluation_results.csv`

### External services

- **Groq API**

### Other components

- **Questioner**

## Connections

- Questioner → Streamlit dashboard: asks question
- Streamlit dashboard → RAG pipeline: loads and queries (evidence: `dashboard/app.py`)
- RAG pipeline → PDF text loader: loads PDF (evidence: `src/rag_pipeline.py`)
- Company report → PDF text loader: provides document
- RAG pipeline → Text chunker: chunks text (evidence: `src/rag_pipeline.py`)
- RAG pipeline → Text embeddings: creates vectors (evidence: `src/rag_pipeline.py`)
- RAG pipeline → FAISS retriever: builds and searches (evidence: `src/rag_pipeline.py`)
- RAG pipeline → Cross-encoder reranker: reranks candidates (evidence: `src/rag_pipeline.py`)
- RAG pipeline → Answer generator: generates answer (evidence: `src/rag_pipeline.py`)
- Answer generator → Groq API: requests completion (evidence: `src/generator.py`)
- Evaluation runner → Evaluation questions: reads questions (evidence: `evaluation/run_evaluation.py`)
- Evaluation runner → RAG pipeline: runs queries (evidence: `evaluation/run_evaluation.py`)
- Evaluation runner → RAGAS metrics: evaluates responses (evidence: `evaluation/run_evaluation.py`)
- RAGAS metrics → RAGAS LLM adapter: uses LLM (evidence: `evaluation/run_evaluation.py`)
- RAGAS metrics → RAGAS embedding adapter: uses embeddings (evidence: `evaluation/run_evaluation.py`)
- RAGAS LLM adapter → Groq API: requests completion (evidence: `src/ragas_llm.py`)
- Evaluation runner → Evaluation results: writes scores (evidence: `evaluation/run_evaluation.py`)
- Streamlit dashboard → Evaluation results: displays evaluation
- Streamlit dashboard → Text embeddings: embeds diagnostic query (evidence: `dashboard/app.py`)
- Streamlit dashboard → FAISS retriever: searches candidates (evidence: `dashboard/app.py`)
- Streamlit dashboard → Cross-encoder reranker: reranks candidates (evidence: `dashboard/app.py`)
