Truth Seeker is a full-stack, state-of-the-art Fake News Detection application that combines Machine Learning style classification with Dense Semantic Retrieval-Augmented Generation (RAG) to verify the authenticity of news claims.
Unlike simple heuristic models, Truth Seeker leverages a dual-tier validation approach:
- Linguistic Style Profiling: Fast stylistic analysis to detect clickbait patterns, biased language, and typical fake news syntax using a machine learning model.
- Dense Semantic RAG (Fact-Checking): Fact verification using a vector database containing authenticated news, followed by an LLM-based reasoning engine that synthesizes proof into a final structured verdict.
+-------------------+
| User Input Text |
+---------+---------+
|
+--------------+--------------+
| |
v v
+--------------------+ +---------------------+
| Quick Style Scan | | Deep Verification |
| (Linguistic ML) | | (Semantic RAG) |
+---------+----------+ +----------+----------+
| |
v v
+-----------------------+ +-----------------------+
| PassiveAggressive | | ChromaDB query using |
| Classifier (TF-IDF) | | all-MiniLM-L6-v2 |
+-----------+-----------+ +-----------+-----------+
| |
| v
| +-----------------------+
| | Semantic Matching |
| | (L2 Distance < 1.25)|
| +-----------+-----------+
| |
| v
| +-----------------------+
| | Context Synthesis |
| | Groq/Llama-3.3 LLM |
| +-----------+-----------+
| |
+--------------+--------------+
|
v
+-------------------------+
| React Frontend Dashboard|
+-------------------------+
- Quick Style Scan (ML Predictor): Analyzes write-style patterns (trained on the WELFake dataset) to flag clickbait or suspicious text structures using a PassiveAggressive Classifier.
- Deep Verification (Dense Semantic RAG):
- Retrieves facts directly from ChromaDB using dense vectors generated by the
all-MiniLM-L6-v2transformer model (replaces old TF-IDF term-matching RAG). - Synthesizes retrieved evidence using Llama 3.3 (70B) via the Groq API (or Gemini API) to generate clean structured JSON outputs showing the verdict, reasoning, and confidence score.
- Falls back gracefully to local vector distance heuristic evaluation if no API keys are provided.
- Retrieves facts directly from ChromaDB using dense vectors generated by the
- Modern User Interface: A responsive React app offering clear interactive visualization of stylistic matches, confidence metrics, and context citation splits.
- Frontend: React.js, Vanilla CSS
- Backend: FastAPI, Uvicorn, Pydantic
- Vector Store: ChromaDB (dense semantic indexing)
- Embedding Model:
sentence-transformers/all-MiniLM-L6-v2(running locally via Hugging Face/Chromadb utilities) - LLM Synthesis: Llama 3.3 70B (via Groq API) or Gemini models
- Stylistic Predictor: Python
scikit-learn(PassiveAggressive Classifier, TF-IDF representation) - Dataset: WELFake (72,134 news records)
├── backend/
│ ├── routes/ # FastAPI endpoint routers (predict, deep_predict)
│ ├── services/ # Business logic (RAG service, PAC ML predictor)
│ │ ├── predictor.py # Linguistic style classification
│ │ └── rag_service.py # ChromaDB query + LLM fact-checking synthesis
│ ├── utils/ # Helper utilities (text cleaning, diagnostics)
│ ├── ingest_chroma.py # Populates ChromaDB vector store with factual news
│ ├── ingest_data.py # (Legacy) TF-IDF index builder
│ └── main.py # FastAPI App Entrypoint
├── frontend/ # React client app
├── models/ # Saved ML weights (model.pkl, vectorizer.pkl)
├── notebooks/ # Jupyter notebooks for model training (WELFake PAC model)
├── chroma_db/ # Local Chroma vector database directory
├── data/ # Dataset folder containing processed CSVs
└── requirements.txt # Backend dependencies
Create a .env file in the project root based on .env.example:
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.3-70b-versatile
PORT=8000
HOST=0.0.0.0- Navigate to the backend directory and set up a virtual environment:
cd backend python -m venv venv # On Windows: venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
- Install Python requirements:
pip install -r ../requirements.txt
- Ingest the Vector DB: Build the ChromaDB vector index from the factual dataset:
python ingest_chroma.py
- Run the API server:
The backend will start at http://localhost:8000.
python main.py
- Open a new terminal window and navigate to the frontend directory:
cd frontend - Install Node packages:
npm install
- Run the development server:
The React dashboard will open at http://localhost:3000.
npm start
Verify that your RAG pipeline and Groq integration work correctly by running the diagnostic test script:
python backend/utils/verify_rag.pyThis script queries the database with a test claim, invokes Groq, and reports the performance.