# anurag07-crypto/reprolens architecture

> Architecture diagram of the GitHub repository anurag07-crypto/reprolens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anurag07-crypto/reprolens
- Repository: https://github.com/anurag07-crypto/reprolens

## Overview

ReproLens checks paper claims against repository source; it does not rerun experiments. The primary workflow parses a paper, extracts claims, prepares and indexes repository code, retrieves evidence, validates LLM verdicts and citations, then writes a report for the web UI. The graph also preserves the documented evaluation branch. Edges are based on README statements and shown source references; unsampled implementation details are not inferred.

Main entry points: [`src/pipeline.py`](https://github.com/anurag07-crypto/reprolens/blob/main/src/pipeline.py) (Analysis pipeline), [`src/llm.py`](https://github.com/anurag07-crypto/reprolens/blob/main/src/llm.py) (LLM and embeddings), [`src/index_repo.py`](https://github.com/anurag07-crypto/reprolens/blob/main/src/index_repo.py) (Source indexing), [`src/retrieve.py`](https://github.com/anurag07-crypto/reprolens/blob/main/src/retrieve.py) (Hybrid evidence retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Claim analysis"]
  node_pipeline["Analysis pipeline<br/>[pipeline.py]"]
  node_paper["Paper text extraction<br/>[parse_paper.py]"]
  node_claims["Claim extraction<br/>[extract_claims.py]"]
end

subgraph group_sources["Repository sources"]
  node_repo_list["Repository list<br/>[repos.txt]"]
  node_repo_download["Repository acquisition<br/>[download_repos.py]"]
  node_source_docs["Line-numbered source"]
  node_index["Source indexing<br/>[index_repo.py]"]
  node_vector_store[("ChromaDB index<br/>[index_repo.py]")]
end

subgraph group_judgment["Evidence judgment"]
  node_retrieval["Hybrid evidence retrieval<br/>[retrieve.py]"]
  node_llm["LLM and embeddings<br/>[llm.py]"]
  node_verification["Verdict and citation checks<br/>[verify.py]"]
end

subgraph group_product["Report experience"]
  node_reports["Analysis reports"]
  node_api["Report API<br/>[main.py]"]
  node_web["Report web interface<br/>[App.tsx]"]
end

subgraph group_evaluation["Evaluation"]
  node_eval_data["Hand-labeled claims<br/>[labels.csv]"]
  node_eval_baseline["Retrieval-free baseline<br/>[baseline.py]"]
  node_eval_metrics["Verdict metrics<br/>[evaluate.py]"]
end

node_user(("Researcher"))
node_groq{{"Groq chat API"}}
node_embedding_model{{"Local embedding model"}}

node_user -->|"starts analysis"| node_pipeline
node_pipeline -->|"extracts text"| node_paper
node_pipeline -->|"extracts claims"| node_claims
node_pipeline -->|"reads repositories"| node_repo_list
node_pipeline -->|"acquires source"| node_repo_download
node_repo_download -->|"exports files"| node_source_docs
node_pipeline -->|"indexes repository"| node_index
node_index -->|"loads chunks"| node_source_docs
node_index -->|"embeds chunks"| node_llm
node_index -->|"stores vectors"| node_vector_store
node_pipeline -->|"retrieves per claim"| node_retrieval
node_retrieval -->|"queries vectors"| node_vector_store
node_retrieval -->|"loads lexical chunks"| node_index
node_retrieval -->|"embeds query"| node_llm
node_pipeline -->|"verifies evidence"| node_verification
node_verification -->|"requests judgment"| node_llm
node_llm -->|"calls chat model"| node_groq
node_llm -->|"embeds locally"| node_embedding_model
node_pipeline -->|"writes report"| node_reports
node_user -->|"views results"| node_web
node_web -->|"requests reports"| node_api
node_api -->|"reads report files"| node_reports
node_api -->|"lists repositories"| node_repo_list
node_eval_baseline -->|"reads existing reports"| node_reports
node_eval_baseline -->|"classifies without retrieval"| node_llm
node_eval_metrics -->|"compares labels"| node_eval_data
node_eval_metrics -->|"evaluates predictions"| node_reports

click node_pipeline "https://github.com/anurag07-crypto/reprolens/blob/main/src/pipeline.py"
click node_paper "https://github.com/anurag07-crypto/reprolens/blob/main/src/parse_paper.py"
click node_claims "https://github.com/anurag07-crypto/reprolens/blob/main/src/extract_claims.py"
click node_repo_list "https://github.com/anurag07-crypto/reprolens/blob/main/data/repos.txt"
click node_repo_download "https://github.com/anurag07-crypto/reprolens/blob/main/src/download_repos.py"
click node_source_docs "https://github.com/anurag07-crypto/reprolens/tree/main/data/repo_docs"
click node_index "https://github.com/anurag07-crypto/reprolens/blob/main/src/index_repo.py"
click node_vector_store "https://github.com/anurag07-crypto/reprolens/blob/main/src/index_repo.py"
click node_retrieval "https://github.com/anurag07-crypto/reprolens/blob/main/src/retrieve.py"
click node_llm "https://github.com/anurag07-crypto/reprolens/blob/main/src/llm.py"
click node_verification "https://github.com/anurag07-crypto/reprolens/blob/main/src/verify.py"
click node_reports "https://github.com/anurag07-crypto/reprolens/tree/main/reports"
click node_api "https://github.com/anurag07-crypto/reprolens/blob/main/app/api/main.py"
click node_web "https://github.com/anurag07-crypto/reprolens/blob/main/app/web/src/App.tsx"
click node_eval_data "https://github.com/anurag07-crypto/reprolens/blob/main/data/labels.csv"
click node_eval_baseline "https://github.com/anurag07-crypto/reprolens/blob/main/eval/baseline.py"
click node_eval_metrics "https://github.com/anurag07-crypto/reprolens/blob/main/eval/evaluate.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_paper,node_claims toneBlue
class node_repo_list,node_repo_download,node_source_docs,node_index,node_vector_store toneAmber
class node_retrieval,node_llm,node_verification,node_groq toneMint
class node_reports,node_api,node_web toneRose
class node_eval_data,node_eval_baseline,node_eval_metrics,node_user,node_embedding_model toneIndigo
```

## Components

### Claim analysis

- [Analysis pipeline](https://github.com/anurag07-crypto/reprolens/blob/main/src/pipeline.py): `src/pipeline.py`
- [Paper text extraction](https://github.com/anurag07-crypto/reprolens/blob/main/src/parse_paper.py): `src/parse_paper.py`
- [Claim extraction](https://github.com/anurag07-crypto/reprolens/blob/main/src/extract_claims.py): `src/extract_claims.py`

### Repository sources

- [Repository list](https://github.com/anurag07-crypto/reprolens/blob/main/data/repos.txt): `data/repos.txt`
- [Repository acquisition](https://github.com/anurag07-crypto/reprolens/blob/main/src/download_repos.py): `src/download_repos.py`
- [Line-numbered source](https://github.com/anurag07-crypto/reprolens/tree/main/data/repo_docs): `data/repo_docs`
- [Source indexing](https://github.com/anurag07-crypto/reprolens/blob/main/src/index_repo.py): `src/index_repo.py`
- [ChromaDB index](https://github.com/anurag07-crypto/reprolens/blob/main/src/index_repo.py): `src/index_repo.py`

### Evidence judgment

- [Hybrid evidence retrieval](https://github.com/anurag07-crypto/reprolens/blob/main/src/retrieve.py): `src/retrieve.py`
- [LLM and embeddings](https://github.com/anurag07-crypto/reprolens/blob/main/src/llm.py): `src/llm.py`
- [Verdict and citation checks](https://github.com/anurag07-crypto/reprolens/blob/main/src/verify.py): `src/verify.py`

### Report experience

- [Analysis reports](https://github.com/anurag07-crypto/reprolens/tree/main/reports): `reports`
- [Report API](https://github.com/anurag07-crypto/reprolens/blob/main/app/api/main.py): `app/api/main.py`
- [Report web interface](https://github.com/anurag07-crypto/reprolens/blob/main/app/web/src/App.tsx): `app/web/src/App.tsx`

### Evaluation

- [Hand-labeled claims](https://github.com/anurag07-crypto/reprolens/blob/main/data/labels.csv): `data/labels.csv`
- [Retrieval-free baseline](https://github.com/anurag07-crypto/reprolens/blob/main/eval/baseline.py): `eval/baseline.py`
- [Verdict metrics](https://github.com/anurag07-crypto/reprolens/blob/main/eval/evaluate.py): `eval/evaluate.py`

### Other components

- **Researcher**
- **Groq chat API**
- **Local embedding model**

## Connections

- Researcher → Analysis pipeline: starts analysis (evidence: `README.md`)
- Analysis pipeline → Paper text extraction: extracts text (evidence: `src/pipeline.py`)
- Analysis pipeline → Claim extraction: extracts claims (evidence: `src/pipeline.py`)
- Analysis pipeline → Repository list: reads repositories (evidence: `README.md`)
- Analysis pipeline → Repository acquisition: acquires source (evidence: `src/pipeline.py`)
- Repository acquisition → Line-numbered source: exports files (evidence: `README.md`)
- Analysis pipeline → Source indexing: indexes repository (evidence: `src/pipeline.py`)
- Source indexing → Line-numbered source: loads chunks (evidence: `src/index_repo.py`)
- Source indexing → LLM and embeddings: embeds chunks (evidence: `src/index_repo.py`)
- Source indexing → ChromaDB index: stores vectors (evidence: `src/index_repo.py`)
- Analysis pipeline → Hybrid evidence retrieval: retrieves per claim (evidence: `src/pipeline.py`)
- Hybrid evidence retrieval → ChromaDB index: queries vectors (evidence: `src/retrieve.py`)
- Hybrid evidence retrieval → Source indexing: loads lexical chunks (evidence: `src/retrieve.py`)
- Hybrid evidence retrieval → LLM and embeddings: embeds query (evidence: `src/retrieve.py`)
- Analysis pipeline → Verdict and citation checks: verifies evidence (evidence: `src/pipeline.py`)
- Verdict and citation checks → LLM and embeddings: requests judgment (evidence: `src/verify.py`)
- LLM and embeddings → Groq chat API: calls chat model (evidence: `src/llm.py`)
- LLM and embeddings → Local embedding model: embeds locally (evidence: `src/llm.py`)
- Analysis pipeline → Analysis reports: writes report (evidence: `src/pipeline.py`)
- Researcher → Report web interface: views results (evidence: `README.md`)
- Report web interface → Report API: requests reports (evidence: `app/web/src/App.tsx`)
- Report API → Analysis reports: reads report files (evidence: `app/api/main.py`)
- Report API → Repository list: lists repositories (evidence: `app/api/main.py`)
- Retrieval-free baseline → Analysis reports: reads existing reports (evidence: `eval/baseline.py`)
- Retrieval-free baseline → LLM and embeddings: classifies without retrieval (evidence: `eval/baseline.py`)
- Verdict metrics → Hand-labeled claims: compares labels (evidence: `README.md`)
- Verdict metrics → Analysis reports: evaluates predictions (evidence: `README.md`)
