# rasbon99/factcheckerai architecture

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

- Interactive diagram: https://gitdiagram.com/rasbon99/factcheckerai
- Repository: https://github.com/rasbon99/factcheckerai

## Overview

FOX AI is a news-claim fact-checking application: users submit a claim through the dashboard, the controller forwards it to the backend, and the backend orchestrates claim preprocessing, evidence discovery and filtering, GraphRAG analysis, and reporting. Its knowledge graph supports evidence retrieval and visual explanations; a separate evaluation branch benchmarks GraphRAG against documented baselines and datasets. The excerpts confirm controller-to-backend calls and internal preprocessing/RAG responsibilities; backend wiring and several dashboard/reporting details rely on the README and module layout, so uncertain links are omitted.

Main entry points: [`backend.py`](https://github.com/rasbon99/factcheckerai/blob/main/backend.py) (Pipeline backend), [`controller.py`](https://github.com/rasbon99/factcheckerai/blob/main/controller.py) (API controller), [`GraphRAG/query_engine.py`](https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/query_engine.py) (Evidence query), [`GraphRAG/rag_pipeline.py`](https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/rag_pipeline.py) (GraphRAG orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_controller["API controller<br/>[controller.py]"]
  node_sql[("Conversation database<br/>[sqldb.py]")]
  node_report["Interactive results<br/>[dashboard.py]"]
end

subgraph group_factcheck["Fact-check Pipeline"]
  node_backend["Pipeline backend<br/>[backend.py]"]
  node_preprocess["Claim and evidence prep"]
  node_scraper["Search and source filter<br/>[scraper.py]"]
  node_credibility["Domain credibility data<br/>[iffy_index.csv]"]
end

subgraph group_knowledge["Knowledge and Models"]
  node_rag["GraphRAG orchestrator<br/>[rag_pipeline.py]"]
  node_graphmanager["Graph loading and views<br/>[graph_manager.py]"]
  node_query["Evidence query<br/>[query_engine.py]"]
  node_neo4j[("Knowledge graph store<br/>[neo4j_api.py]")]
  node_ollama["Local model service<br/>[ollama_api.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evalrunners["Benchmark runners"]
  node_datasets["Evaluation datasets<br/>[dataset_manager.py]"]
  node_tracker["Experiment metrics"]
  node_analysis["Effectiveness and efficiency"]
end

node_user(("Claim submitter"))
node_groq["Groq inference"]

node_user -->|"submits claim"| node_dashboard
node_dashboard -->|"sends request"| node_controller
node_controller -->|"forwards request"| node_backend
node_controller -->|"requests history"| node_backend
node_controller -->|"requests cleanup"| node_backend
node_backend -->|"preprocesses claim"| node_preprocess
node_backend -->|"retrieves sources"| node_scraper
node_scraper -->|"checks domains"| node_credibility
node_scraper -->|"checks relevance"| node_groq
node_backend -->|"runs evidence analysis"| node_rag
node_rag -->|"loads evidence"| node_graphmanager
node_rag -->|"queries evidence"| node_query
node_graphmanager -->|"writes graph"| node_neo4j
node_query -->|"retrieves evidence"| node_neo4j
node_query -->|"embeds query"| node_ollama
node_query -->|"generates verdict"| node_groq
node_preprocess -->|"summarizes and extracts"| node_groq
node_backend -->|"persists conversations"| node_sql
node_backend -->|"returns results"| node_report
node_report -->|"shows cited report"| node_user
node_graphmanager -->|"provides graph views"| node_report
node_evalrunners -->|"loads claims"| node_datasets
node_evalrunners -->|"records runs"| node_tracker
node_analysis -->|"analyzes metrics"| node_tracker
node_evalrunners -.->|"benchmarks GraphRAG"| node_rag

click node_dashboard "https://github.com/rasbon99/factcheckerai/blob/main/Dashboard/dashboard.py"
click node_controller "https://github.com/rasbon99/factcheckerai/blob/main/controller.py"
click node_backend "https://github.com/rasbon99/factcheckerai/blob/main/backend.py"
click node_preprocess "https://github.com/rasbon99/factcheckerai/blob/main/Preprocessor/preprocessing_pipeline.py"
click node_scraper "https://github.com/rasbon99/factcheckerai/blob/main/WebScraper/scraper.py"
click node_credibility "https://github.com/rasbon99/factcheckerai/blob/main/Datasets/iffy_index.csv"
click node_rag "https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/rag_pipeline.py"
click node_graphmanager "https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/graph_manager.py"
click node_query "https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/query_engine.py"
click node_neo4j "https://github.com/rasbon99/factcheckerai/blob/main/Neo4j/neo4j_api.py"
click node_ollama "https://github.com/rasbon99/factcheckerai/blob/main/Ollama/ollama_api.py"
click node_sql "https://github.com/rasbon99/factcheckerai/blob/main/Database/sqldb.py"
click node_report "https://github.com/rasbon99/factcheckerai/blob/main/Dashboard/dashboard.py"
click node_evalrunners "https://github.com/rasbon99/factcheckerai/tree/main/Evaluation/Runners"
click node_datasets "https://github.com/rasbon99/factcheckerai/blob/main/Evaluation/Utils/dataset_manager.py"
click node_tracker "https://github.com/rasbon99/factcheckerai/blob/main/Evaluation/Utils/experiment_tracker.py"
click node_analysis "https://github.com/rasbon99/factcheckerai/tree/main/Evaluation/Analysis"

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,node_controller,node_sql,node_report toneBlue
class node_backend,node_preprocess,node_scraper,node_credibility toneAmber
class node_rag,node_graphmanager,node_query,node_neo4j,node_ollama toneMint
class node_evalrunners,node_datasets,node_tracker,node_analysis toneRose
class node_user,node_groq toneIndigo
```

## Components

### User Interface

- [Dashboard](https://github.com/rasbon99/factcheckerai/blob/main/Dashboard/dashboard.py): `Dashboard/dashboard.py`
- [API controller](https://github.com/rasbon99/factcheckerai/blob/main/controller.py): `controller.py`
- [Conversation database](https://github.com/rasbon99/factcheckerai/blob/main/Database/sqldb.py): `Database/sqldb.py`
- [Interactive results](https://github.com/rasbon99/factcheckerai/blob/main/Dashboard/dashboard.py): `Dashboard/dashboard.py`

### Fact-check Pipeline

- [Pipeline backend](https://github.com/rasbon99/factcheckerai/blob/main/backend.py): `backend.py`
- [Claim and evidence prep](https://github.com/rasbon99/factcheckerai/blob/main/Preprocessor/preprocessing_pipeline.py): `Preprocessor/preprocessing_pipeline.py`
- [Search and source filter](https://github.com/rasbon99/factcheckerai/blob/main/WebScraper/scraper.py): `WebScraper/scraper.py`
- [Domain credibility data](https://github.com/rasbon99/factcheckerai/blob/main/Datasets/iffy_index.csv): `Datasets/iffy_index.csv`

### Knowledge and Models

- [GraphRAG orchestrator](https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/rag_pipeline.py): `GraphRAG/rag_pipeline.py`
- [Graph loading and views](https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/graph_manager.py): `GraphRAG/graph_manager.py`
- [Evidence query](https://github.com/rasbon99/factcheckerai/blob/main/GraphRAG/query_engine.py): `GraphRAG/query_engine.py`
- [Knowledge graph store](https://github.com/rasbon99/factcheckerai/blob/main/Neo4j/neo4j_api.py): `Neo4j/neo4j_api.py`
- [Local model service](https://github.com/rasbon99/factcheckerai/blob/main/Ollama/ollama_api.py): `Ollama/ollama_api.py`

### Evaluation

- [Benchmark runners](https://github.com/rasbon99/factcheckerai/tree/main/Evaluation/Runners): `Evaluation/Runners`
- [Evaluation datasets](https://github.com/rasbon99/factcheckerai/blob/main/Evaluation/Utils/dataset_manager.py): `Evaluation/Utils/dataset_manager.py`
- [Experiment metrics](https://github.com/rasbon99/factcheckerai/blob/main/Evaluation/Utils/experiment_tracker.py): `Evaluation/Utils/experiment_tracker.py`
- [Effectiveness and efficiency](https://github.com/rasbon99/factcheckerai/tree/main/Evaluation/Analysis): `Evaluation/Analysis`

### Other components

- **Claim submitter**
- **Groq inference**

## Connections

- Claim submitter → Dashboard: submits claim
- Dashboard → API controller: sends request
- API controller → Pipeline backend: forwards request
- API controller → Pipeline backend: requests history
- API controller → Pipeline backend: requests cleanup
- Pipeline backend → Claim and evidence prep: preprocesses claim
- Pipeline backend → Search and source filter: retrieves sources
- Search and source filter → Domain credibility data: checks domains
- Search and source filter → Groq inference: checks relevance
- Pipeline backend → GraphRAG orchestrator: runs evidence analysis
- GraphRAG orchestrator → Graph loading and views: loads evidence
- GraphRAG orchestrator → Evidence query: queries evidence
- Graph loading and views → Knowledge graph store: writes graph
- Evidence query → Knowledge graph store: retrieves evidence
- Evidence query → Local model service: embeds query
- Evidence query → Groq inference: generates verdict
- Claim and evidence prep → Groq inference: summarizes and extracts
- Pipeline backend → Conversation database: persists conversations
- Pipeline backend → Interactive results: returns results
- Interactive results → Claim submitter: shows cited report
- Graph loading and views → Interactive results: provides graph views
- Benchmark runners → Evaluation datasets: loads claims
- Benchmark runners → Experiment metrics: records runs
- Effectiveness and efficiency → Experiment metrics: analyzes metrics
- Benchmark runners → GraphRAG orchestrator: benchmarks GraphRAG
