# yatheen28/ira_pbl architecture

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

- Interactive diagram: https://gitdiagram.com/yatheen28/ira_pbl
- Repository: https://github.com/yatheen28/ira_pbl

## Overview

VAJRA AI accepts a text claim, or an image through the backend OCR endpoint, then retrieves and ranks web evidence, enriches it with source analysis, generates a grounded verdict, and builds a knowledge graph. The React client submits text claims and presents results. The README documents these capabilities, and the route excerpt confirms the backend orchestration; several service implementations and frontend API wiring were not sampled, so uncertain connections are omitted.

Main entry points: [`backend/app/routes/verify.py`](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/routes/verify.py) (Verification routes), [`frontend/src/App.jsx`](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/App.jsx) (Application UI), [`frontend/src/hooks/useVerification.js`](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/hooks/useVerification.js) (Verification state), [`backend/app/services/semantic_ranker.py`](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/semantic_ranker.py) (Semantic ranking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Application UI<br/>[App.jsx]"]
  node_input["Claim input<br/>[ClaimInput.jsx]"]
  node_image_ui["Image upload UI<br/>[ImageUpload.jsx]"]
  node_hook["Verification state<br/>[useVerification.js]"]
  node_client_api["Verification API client<br/>[verification.js]"]
  node_results_ui["Results display<br/>[ResultsSection.jsx]"]
end

subgraph group_api["HTTP API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_verify_route["Verification routes<br/>[verify.py]"]
end

subgraph group_pipeline["Verification pipeline"]
  node_ocr["Image text extraction<br/>[ocr_service.py]"]
  node_language["Language normalization"]
  node_retriever["Web evidence retrieval<br/>[web_retriever.py]"]
  node_ranker["Semantic ranking<br/>[semantic_ranker.py]"]
end

subgraph group_analysis["Evidence analysis"]
  node_analyzer["Evidence analysis"]
  node_reliability["Source reliability"]
  node_verdict["Grounded verdict<br/>[verdict_engine.py]"]
  node_knowledge["Knowledge graph<br/>[knowledge_graph.py]"]
end

node_person(("Claim submitter"))
node_tavily{{"Tavily Search"}}
node_bge{{"BGE embedding model"}}
node_gemini{{"Gemini API"}}
node_easyocr{{"EasyOCR"}}

node_person -->|"uses"| node_app
node_app -->|"renders"| node_input
node_app -->|"renders"| node_image_ui
node_app -->|"starts verification"| node_hook
node_hook -->|"submits claim"| node_client_api
node_client_api -->|"HTTP request"| node_verify_route
node_backend -->|"registers routes"| node_verify_route
node_backend -->|"loads model"| node_ranker
node_verify_route -->|"normalizes claim"| node_language
node_language -.->|"translates"| node_gemini
node_verify_route -->|"searches claim"| node_retriever
node_retriever -->|"queries"| node_tavily
node_verify_route -->|"ranks results"| node_ranker
node_ranker -->|"embeds evidence"| node_bge
node_verify_route -->|"analyzes ranked evidence"| node_analyzer
node_analyzer -->|"scores sources"| node_reliability
node_verify_route -->|"generates verdict"| node_verdict
node_verdict -->|"analyzes evidence"| node_gemini
node_verify_route -->|"builds graph"| node_knowledge
node_verify_route -->|"extracts image text"| node_ocr
node_ocr -->|"recognizes text"| node_easyocr
node_hook -->|"displays response"| node_results_ui

click node_app "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/App.jsx"
click node_input "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ClaimInput.jsx"
click node_image_ui "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ImageUpload.jsx"
click node_hook "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/hooks/useVerification.js"
click node_client_api "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/api/verification.js"
click node_results_ui "https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ResultsSection.jsx"
click node_backend "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/main.py"
click node_verify_route "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/routes/verify.py"
click node_ocr "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/ocr_service.py"
click node_language "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/language_service.py"
click node_retriever "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/web_retriever.py"
click node_ranker "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/semantic_ranker.py"
click node_analyzer "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/evidence_analyzer.py"
click node_reliability "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/source_reliability.py"
click node_verdict "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/verdict_engine.py"
click node_knowledge "https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/knowledge_graph.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_app,node_input,node_image_ui,node_hook,node_client_api,node_results_ui toneBlue
class node_backend,node_verify_route toneAmber
class node_ocr,node_language,node_retriever,node_ranker,node_gemini toneMint
class node_analyzer,node_reliability,node_verdict,node_knowledge toneRose
class node_person,node_tavily,node_bge,node_easyocr toneIndigo
```

## Components

### React client

- [Application UI](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Claim input](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ClaimInput.jsx): `frontend/src/components/ClaimInput.jsx`
- [Image upload UI](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ImageUpload.jsx): `frontend/src/components/ImageUpload.jsx`
- [Verification state](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/hooks/useVerification.js): `frontend/src/hooks/useVerification.js`
- [Verification API client](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/api/verification.js): `frontend/src/api/verification.js`
- [Results display](https://github.com/yatheen28/ira_pbl/blob/main/frontend/src/components/ResultsSection.jsx): `frontend/src/components/ResultsSection.jsx`

### HTTP API

- [FastAPI application](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/main.py): `backend/app/main.py`
- [Verification routes](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/routes/verify.py): `backend/app/routes/verify.py`

### Verification pipeline

- [Image text extraction](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/ocr_service.py): `backend/app/services/ocr_service.py`
- [Language normalization](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/language_service.py): `backend/app/services/language_service.py`
- [Web evidence retrieval](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/web_retriever.py): `backend/app/services/web_retriever.py`
- [Semantic ranking](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/semantic_ranker.py): `backend/app/services/semantic_ranker.py`

### Evidence analysis

- [Evidence analysis](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/evidence_analyzer.py): `backend/app/services/evidence_analyzer.py`
- [Source reliability](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/source_reliability.py): `backend/app/services/source_reliability.py`
- [Grounded verdict](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/verdict_engine.py): `backend/app/services/verdict_engine.py`
- [Knowledge graph](https://github.com/yatheen28/ira_pbl/blob/main/backend/app/services/knowledge_graph.py): `backend/app/services/knowledge_graph.py`

### Other components

- **Claim submitter**
- **Tavily Search**
- **BGE embedding model**
- **Gemini API**
- **EasyOCR**

## Connections

- Claim submitter → Application UI: uses
- Application UI → Claim input: renders
- Application UI → Image upload UI: renders
- Application UI → Verification state: starts verification
- Verification state → Verification API client: submits claim
- Verification API client → Verification routes: HTTP request
- FastAPI application → Verification routes: registers routes
- FastAPI application → Semantic ranking: loads model
- Verification routes → Language normalization: normalizes claim
- Language normalization → Gemini API: translates
- Verification routes → Web evidence retrieval: searches claim
- Web evidence retrieval → Tavily Search: queries
- Verification routes → Semantic ranking: ranks results
- Semantic ranking → BGE embedding model: embeds evidence
- Verification routes → Evidence analysis: analyzes ranked evidence
- Evidence analysis → Source reliability: scores sources
- Verification routes → Grounded verdict: generates verdict
- Grounded verdict → Gemini API: analyzes evidence
- Verification routes → Knowledge graph: builds graph
- Verification routes → Image text extraction: extracts image text
- Image text extraction → EasyOCR: recognizes text
- Verification state → Results display: displays response
