TrueEye

TrueEye Banner

License: MIT Python 3.10+ FastAPI LangFlow Ready NixOS

🧿 TrueEye β€” Intelligent Media Literacy System

TrueEye is an AI‑powered tool designed to analyze news articles and web content to detect narrative bias, identify the target audience and reveal hidden intentions or manipulative rhetorical structures. In other words, it doesn’t just detect fake news β€” it analyzes who the content is written for and why.

This repository provides a production‑grade Python package containing both the REST API and a simple frontend. The code is structured under src/trueeye with proper type hints, tests, continuous integration and development tooling. A local analysis stub is provided for offline testing.

πŸš€ Demo

The previous Hugging Face Space demo is no longer maintained. You can run your own instance locally using the instructions below.

πŸš€ Usage Options

TrueEye offers two usage modes depending on your needs:

πŸ‘‰ Quick start: ./start.sh (See complete instructions below)

⚑ Option B: Direct LangFlow Flow (Quick to try)

πŸ‘‰ See: README_FLOW.md for flow instructions


🧩 What Does TrueEye Do?

When given a news article URL, TrueEye performs three consecutive analyses:

  1. Bias & Narrative Tone β€” Detects narrative polarity (positive, negative, neutral), identifies rhetorical strategies (fear, polarization, irony) and summarizes the content while flagging questionable claims.
  2. Audience Profiling β€” Infers demographic and emotional profile of the target reader and identifies values, beliefs or cognitive biases being exploited.
  3. Intent & Risk Evaluation β€” Detects manipulative discourse or hidden agendas and highlights information gaps and potential societal risk.

The report includes links to trustworthy sources for fact‑checking.

βš™οΈ Architecture Overview

The project consists of two main components:

The heavy lifting is performed by a remote LangFlow pipeline via the FLOW_API_URL environment variable. For offline testing you can set TE_PROVIDER=local and the API will return a stubbed response.

πŸ“ Project Structure

TrueEye_v1/
β”œβ”€β”€ src/trueeye/
β”‚   β”œβ”€β”€ __init__.py      # Exposes create_app()
β”‚   β”œβ”€β”€ api.py           # FastAPI application factory and endpoints
β”‚   β”œβ”€β”€ models.py        # Pydantic models
β”‚   β”œβ”€β”€ utils.py         # Helper functions
β”‚   └── static/
β”‚       └── index.html   # Frontend UI
β”œβ”€β”€ tests/               # Test suite
β”œβ”€β”€ pyproject.toml       # Project metadata and dependencies
β”œβ”€β”€ .pre-commit-config.yaml
β”œβ”€β”€ .github/workflows/ci.yml
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ SECURITY.md
β”œβ”€β”€ LICENSE.txt          # Non‑commercial license
└── README.md            # Project documentation (this file)

πŸ’» Running on NixOS/Nix

πŸš€ Quick Start (One Command)

# Option 1: Using start.sh script (recommended)
./start.sh

# Option 2: Using Makefile
make start

# Option 3: Direct Nix command
nix-shell --run "trueeye-dev"

πŸ”§ Initial Setup

The project includes automatic configuration. On first use:

  1. An .env file will be automatically created from .env.example
  2. The Python environment will be configured with all dependencies
  3. The application will start in local mode (no external connection)

βš™οΈ Environment Variables Configuration

# To edit configuration:
./start.sh config
# or
make config

# For manual configuration:
cp .env.example .env
# Then edit .env with your favorite editor

Main variables:

πŸ§ͺ Available Commands

# Commands with start.sh:
./start.sh start    # Start application (default)
./start.sh test     # Run tests
./start.sh config   # Edit configuration
./start.sh shell    # Open development shell
./start.sh help     # Show help

# Commands with Makefile:
make start         # Start application
make test          # Run tests
make config        # Edit configuration
make shell         # Open development shell
make clean         # Clean temporary files
make check         # Verify configuration
make help          # Show help

πŸ—οΈ Estructura del Proyecto

🐚 Nix Development Shell

The project includes a fully configured shell.nix that provides:

πŸ’‘ Special Features

# 1. Clone/access the project
cd /path/to/trueeye_v1

# 2. Run (everything gets configured automatically)
./start.sh

# 3. Access the application
firefox http://localhost:8000

πŸ” System Verification

To verify that everything is properly configured:

# Verify dependencies and configuration
make check

# View environment information
make dev-info

# Run tests to validate functionality
./start.sh test

πŸ“š Technologies and Tools

Backend

Frontend

Development

Integration

✍️ Author

Gonzalo Romero (DeepRat)

AI, Software & Systems Engineer Β· Prompt Engineer Β· Full‑Stack Developer

πŸ”— Web Hugging Face GitHub LinkedIn Medium