# ruhulamin-rakib/agrvf architecture

> Architecture diagram of the GitHub repository ruhulamin-rakib/agrvf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ruhulamin-rakib/agrvf
- Repository: https://github.com/ruhulamin-rakib/agrvf

## Overview

AGRVF is a notebook-based framework for verifying consumer-product claims. The documented workflow mines and prepares data, identifies products and interprets claims, retrieves local evidence, then optionally uses web evidence before credibility scoring, stance analysis, verdict selection, and explanation generation. The README documents these stages and outputs, but no source excerpts were available; subsystem-level implementation details and call ownership are therefore represented only where the documentation supports them.

Main entry points: [`notebooks/agrvf_Layer-BCD.ipynb`](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb) (Layers B–D), [`notebooks/agrvf_layer-A.ipynb`](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_layer-A.ipynb) (Layer A), [`data/processed/amazon/amazon_products_agrvf.parquet`](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/amazon/amazon_products_agrvf.parquet) (Amazon catalog), [`data/processed/openbeautyfacts/openbeautyfacts_agrvf.parquet`](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/openbeautyfacts/openbeautyfacts_agrvf.parquet) (Ingredient records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_construction["Data construction"]
  node_layer_a["Layer A"]
  node_classifier["Claim classifier"]
  node_vectorizer["TF-IDF vectorizer"]
  node_claims[("Claim datasets")]
  node_catalog[("Amazon catalog")]
  node_ingredients[("Ingredient records")]
  node_scientific[("Scientific corpora")]
end

subgraph group_understanding["Claim understanding"]
  node_layer_bcd["Layers B–D"]
  node_product_match["Product identification"]
  node_claim_parse["Claim understanding"]
  node_structured[("Structured claims")]
end

subgraph group_evidence["Evidence retrieval"]
  node_local_retrieval["Local retrieval"]
  node_local_evidence[("Local evidence")]
  node_web_fallback["Web fallback"]
end

subgraph group_reasoning["Scoring and verdict"]
  node_aecs["AECS scoring"]
  node_stance["Stance classification"]
  node_verdict[("Verdict and explanation")]
end

node_researcher(("Claim submitter"))
node_web(("Live web"))

node_layer_a -->|"trains"| node_classifier
node_layer_a -->|"trains"| node_vectorizer
node_layer_a -->|"produces"| node_claims
node_layer_a -->|"prepares"| node_catalog
node_layer_a -->|"prepares"| node_ingredients
node_layer_a -->|"prepares"| node_scientific
node_researcher -->|"submits claim"| node_layer_bcd
node_layer_bcd -->|"runs"| node_product_match
node_layer_bcd -->|"runs"| node_claim_parse
node_product_match -->|"matches against"| node_catalog
node_layer_bcd -->|"writes"| node_structured
node_layer_bcd -->|"runs"| node_local_retrieval
node_local_retrieval -->|"reads"| node_catalog
node_local_retrieval -->|"reads"| node_ingredients
node_local_retrieval -->|"reads"| node_scientific
node_local_retrieval -->|"writes"| node_local_evidence
node_layer_bcd -.->|"runs if needed"| node_web_fallback
node_web_fallback -.->|"retrieves from"| node_web
node_layer_bcd -->|"scores evidence"| node_aecs
node_layer_bcd -->|"classifies stance"| node_stance
node_layer_bcd -->|"writes result"| node_verdict

click node_layer_a "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_layer-A.ipynb"
click node_classifier "https://github.com/ruhulamin-rakib/agrvf/blob/main/models/claim_classifier_logreg_v1.joblib"
click node_vectorizer "https://github.com/ruhulamin-rakib/agrvf/blob/main/models/tfidf_vectorizer_v1.joblib"
click node_claims "https://github.com/ruhulamin-rakib/agrvf/tree/main/data/processed/claims"
click node_catalog "https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/amazon/amazon_products_agrvf.parquet"
click node_ingredients "https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/openbeautyfacts/openbeautyfacts_agrvf.parquet"
click node_scientific "https://github.com/ruhulamin-rakib/agrvf/tree/main/data/processed"
click node_layer_bcd "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_product_match "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_claim_parse "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_structured "https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/layer_b/layer_b_structured_output.parquet"
click node_local_retrieval "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_local_evidence "https://github.com/ruhulamin-rakib/agrvf/blob/main/results/layer_c/layer_c_local_evidence.parquet"
click node_web_fallback "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_aecs "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_stance "https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb"
click node_verdict "https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/layer_d/layer_d_final_output.parquet"

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_layer_a,node_classifier,node_vectorizer,node_claims,node_catalog,node_ingredients,node_scientific toneBlue
class node_layer_bcd,node_product_match,node_claim_parse,node_structured toneAmber
class node_local_retrieval,node_local_evidence,node_web_fallback toneMint
class node_aecs,node_stance,node_verdict toneRose
class node_researcher,node_web toneIndigo
```

## Components

### Data construction

- [Layer A](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_layer-A.ipynb): `notebooks/agrvf_layer-A.ipynb`
- [Claim classifier](https://github.com/ruhulamin-rakib/agrvf/blob/main/models/claim_classifier_logreg_v1.joblib): `models/claim_classifier_logreg_v1.joblib`
- [TF-IDF vectorizer](https://github.com/ruhulamin-rakib/agrvf/blob/main/models/tfidf_vectorizer_v1.joblib): `models/tfidf_vectorizer_v1.joblib`
- [Claim datasets](https://github.com/ruhulamin-rakib/agrvf/tree/main/data/processed/claims): `data/processed/claims`
- [Amazon catalog](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/amazon/amazon_products_agrvf.parquet): `data/processed/amazon/amazon_products_agrvf.parquet`
- [Ingredient records](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/openbeautyfacts/openbeautyfacts_agrvf.parquet): `data/processed/openbeautyfacts/openbeautyfacts_agrvf.parquet`
- [Scientific corpora](https://github.com/ruhulamin-rakib/agrvf/tree/main/data/processed): `data/processed`

### Claim understanding

- [Layers B–D](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Product identification](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Claim understanding](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Structured claims](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/layer_b/layer_b_structured_output.parquet): `data/processed/layer_b/layer_b_structured_output.parquet`

### Evidence retrieval

- [Local retrieval](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Local evidence](https://github.com/ruhulamin-rakib/agrvf/blob/main/results/layer_c/layer_c_local_evidence.parquet): `results/layer_c/layer_c_local_evidence.parquet`
- [Web fallback](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`

### Scoring and verdict

- [AECS scoring](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Stance classification](https://github.com/ruhulamin-rakib/agrvf/blob/main/notebooks/agrvf_Layer-BCD.ipynb): `notebooks/agrvf_Layer-BCD.ipynb`
- [Verdict and explanation](https://github.com/ruhulamin-rakib/agrvf/blob/main/data/processed/layer_d/layer_d_final_output.parquet): `data/processed/layer_d/layer_d_final_output.parquet`

### Other components

- **Claim submitter**
- **Live web**

## Connections

- Layer A → Claim classifier: trains
- Layer A → TF-IDF vectorizer: trains
- Layer A → Claim datasets: produces
- Layer A → Amazon catalog: prepares
- Layer A → Ingredient records: prepares
- Layer A → Scientific corpora: prepares
- Claim submitter → Layers B–D: submits claim
- Layers B–D → Product identification: runs
- Layers B–D → Claim understanding: runs
- Product identification → Amazon catalog: matches against
- Layers B–D → Structured claims: writes
- Layers B–D → Local retrieval: runs
- Local retrieval → Amazon catalog: reads
- Local retrieval → Ingredient records: reads
- Local retrieval → Scientific corpora: reads
- Local retrieval → Local evidence: writes
- Layers B–D → Web fallback: runs if needed
- Web fallback → Live web: retrieves from
- Layers B–D → AECS scoring: scores evidence
- Layers B–D → Stance classification: classifies stance
- Layers B–D → Verdict and explanation: writes result
