# rubanchakravarthib308-spec/rag-reliability-lab architecture

> Architecture diagram of the GitHub repository rubanchakravarthib308-spec/rag-reliability-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rubanchakravarthib308-spec/rag-reliability-lab
- Repository: https://github.com/rubanchakravarthib308-spec/rag-reliability-lab

## Overview

RAG Reliability Lab is a deterministic testbed for checking whether retrieved evidence supports generated answers and for measuring regressions over time. Its core workflow retrieves ranked evidence, delegates answer generation to a supplied answerer, then evaluates citations and claim support. Lexical retrieval is the pipeline default; embedding retrieval is a separate provider-driven option. The documented benchmark capability is included, but its implementation was not sampled, so its internal connections are not asserted. The map is based on README statements and the provided source excerpts; unsampled benchmark details remain uncertain.

Main entry points: [`src/rag_reliability_lab/pipeline.py`](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/pipeline.py) (Reliability pipeline), [`src/rag_reliability_lab/benchmark_cli.py`](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark_cli.py) (Benchmark command), [`src/rag_reliability_lab/evaluation.py`](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/evaluation.py) (Reliability evaluator), [`src/rag_reliability_lab/benchmark.py`](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark.py) (Benchmark runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Answer workflow"]
  node_pipeline["Reliability pipeline<br/>[pipeline.py]"]
  node_answerer["Answerer"]
  node_demo["Deterministic demo<br/>[demo.py]"]
end

subgraph group_retrieval["Evidence retrieval"]
  node_documents["Evidence documents<br/>[types.py]"]
  node_lexical["Lexical ranking<br/>[retrieval.py]"]
  node_semantic["Embedding ranking<br/>[retrieval.py]"]
  node_embeddings["Embedding provider<br/>[embeddings.py]"]
  node_static_provider["Static provider<br/>[embeddings.py]"]
end

subgraph group_reliability["Reliability checks"]
  node_evaluation["Reliability evaluator<br/>[evaluation.py]"]
  node_claims["Claim support<br/>[evaluation.py]"]
  node_domain_types["Result models<br/>[types.py]"]
end

subgraph group_benchmark["Benchmark reporting"]
  node_benchmark_data["Versioned benchmark<br/>[v1.json]"]
  node_benchmark_runner["Benchmark runner<br/>[benchmark.py]"]
  node_benchmark_cli["Benchmark command<br/>[benchmark_cli.py]"]
  node_reports["JSON and Markdown reports<br/>[benchmark.py]"]
  node_ci["CI quality gate"]
end

node_user(("Questioner"))

node_user -->|"asks"| node_pipeline
node_pipeline -->|"retrieves by default"| node_lexical
node_pipeline -->|"requests answer"| node_answerer
node_pipeline -->|"evaluates answer"| node_evaluation
node_demo -->|"runs"| node_pipeline
node_lexical -->|"ranks"| node_documents
node_semantic -->|"ranks"| node_documents
node_semantic -->|"requests vectors"| node_embeddings
node_static_provider -->|"implements"| node_embeddings
node_evaluation -->|"checks support"| node_claims
node_evaluation -->|"returns results"| node_domain_types
node_benchmark_cli -->|"runs"| node_benchmark_runner
node_benchmark_cli -->|"writes reports"| node_reports
node_benchmark_cli -->|"signals regression"| node_ci
node_benchmark_runner -.->|"uses cases"| node_benchmark_data
node_benchmark_runner -.->|"summarizes metrics"| node_reports

click node_pipeline "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/pipeline.py"
click node_demo "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/demo.py"
click node_documents "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/types.py"
click node_lexical "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/retrieval.py"
click node_semantic "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/retrieval.py"
click node_embeddings "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/embeddings.py"
click node_static_provider "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/embeddings.py"
click node_evaluation "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/evaluation.py"
click node_claims "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/evaluation.py"
click node_domain_types "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/types.py"
click node_benchmark_data "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmarks/v1.json"
click node_benchmark_runner "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark.py"
click node_benchmark_cli "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark_cli.py"
click node_reports "https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark.py"

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_pipeline,node_answerer,node_demo toneBlue
class node_documents,node_lexical,node_semantic,node_embeddings,node_static_provider toneAmber
class node_evaluation,node_claims,node_domain_types toneMint
class node_benchmark_data,node_benchmark_runner,node_benchmark_cli,node_reports,node_ci toneRose
class node_user toneIndigo
```

## Components

### Answer workflow

- [Reliability pipeline](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/pipeline.py): `src/rag_reliability_lab/pipeline.py`
- **Answerer**
- [Deterministic demo](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/demo.py): `src/rag_reliability_lab/demo.py`

### Evidence retrieval

- [Evidence documents](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/types.py): `src/rag_reliability_lab/types.py`
- [Lexical ranking](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/retrieval.py): `src/rag_reliability_lab/retrieval.py`
- [Embedding ranking](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/retrieval.py): `src/rag_reliability_lab/retrieval.py`
- [Embedding provider](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/embeddings.py): `src/rag_reliability_lab/embeddings.py`
- [Static provider](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/embeddings.py): `src/rag_reliability_lab/embeddings.py`

### Reliability checks

- [Reliability evaluator](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/evaluation.py): `src/rag_reliability_lab/evaluation.py`
- [Claim support](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/evaluation.py): `src/rag_reliability_lab/evaluation.py`
- [Result models](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/types.py): `src/rag_reliability_lab/types.py`

### Benchmark reporting

- [Versioned benchmark](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmarks/v1.json): `src/rag_reliability_lab/benchmarks/v1.json`
- [Benchmark runner](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark.py): `src/rag_reliability_lab/benchmark.py`
- [Benchmark command](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark_cli.py): `src/rag_reliability_lab/benchmark_cli.py`
- [JSON and Markdown reports](https://github.com/rubanchakravarthib308-spec/rag-reliability-lab/blob/main/src/rag_reliability_lab/benchmark.py): `src/rag_reliability_lab/benchmark.py`
- **CI quality gate**

### Other components

- **Questioner**

## Connections

- Questioner → Reliability pipeline: asks (evidence: `README.md`)
- Reliability pipeline → Lexical ranking: retrieves by default (evidence: `src/rag_reliability_lab/pipeline.py`)
- Reliability pipeline → Answerer: requests answer (evidence: `src/rag_reliability_lab/pipeline.py`)
- Reliability pipeline → Reliability evaluator: evaluates answer (evidence: `src/rag_reliability_lab/pipeline.py`)
- Deterministic demo → Reliability pipeline: runs (evidence: `src/rag_reliability_lab/demo.py`)
- Lexical ranking → Evidence documents: ranks (evidence: `src/rag_reliability_lab/retrieval.py`)
- Embedding ranking → Evidence documents: ranks (evidence: `src/rag_reliability_lab/retrieval.py`)
- Embedding ranking → Embedding provider: requests vectors (evidence: `src/rag_reliability_lab/retrieval.py`)
- Static provider → Embedding provider: implements (evidence: `src/rag_reliability_lab/embeddings.py`)
- Reliability evaluator → Claim support: checks support (evidence: `src/rag_reliability_lab/evaluation.py`)
- Reliability evaluator → Result models: returns results (evidence: `src/rag_reliability_lab/evaluation.py`)
- Benchmark command → Benchmark runner: runs (evidence: `src/rag_reliability_lab/benchmark_cli.py`)
- Benchmark command → JSON and Markdown reports: writes reports (evidence: `src/rag_reliability_lab/benchmark_cli.py`)
- Benchmark command → CI quality gate: signals regression (evidence: `README.md`)
- Benchmark runner → Versioned benchmark: uses cases (evidence: `README.md`)
- Benchmark runner → JSON and Markdown reports: summarizes metrics (evidence: `README.md`)
