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.
The previous Hugging Face Space demo is no longer maintained. You can run your own instance locally using the instructions below.
TrueEye offers two usage modes depending on your needs:
- β Modern web interface with custom UI
- β Robust REST API with FastAPI
- β Reproducible environment with Nix/NixOS
- β Automatic setup with a single command
- β Integrated tests and complete documentation
- β Offline mode for development without external APIs
π Quick start: ./start.sh
(See complete instructions below)
- β
5-minute setup by importing
TrueEyeBeta.json
- β No complex configurations - just import and use
- β Visual playground integrated in LangFlow
- β Easy to modify prompts and logic from the UI
- β Cross-platform - works on any OS
π See: README_FLOW.md
for flow instructions
When given a news article URL, TrueEye performs three consecutive analyses:
- Bias & Narrative Tone β Detects narrative polarity (positive, negative, neutral), identifies rhetorical strategies (fear, polarization, irony) and summarizes the content while flagging questionable claims.
- Audience Profiling β Infers demographic and emotional profile of the target reader and identifies values, beliefs or cognitive biases being exploited.
- 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.
The project consists of two main components:
- π§ Backend β A REST API built with FastAPI and packaged as a
Python library. The API is created via
trueeye.create_app()
and can be run usinguvicorn
. - π§± Frontend β A minimal static web interface built with TailwindCSS (served from the package's static directory). It allows users to input a URL, trigger analysis and view the result.
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.
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)
# 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"
The project includes automatic configuration. On first use:
- An
.env
file will be automatically created from.env.example
- The Python environment will be configured with all dependencies
- The application will start in local mode (no external connection)
# 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:
TE_PROVIDER=local
β Test mode (no external API)TE_PROVIDER=remote
β Production mode (requiresFLOW_API_URL
)PORT=8000
β Server portHOST=0.0.0.0
β Server host
# 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
The project includes a fully configured shell.nix
that provides:
- β Python 3.10+ with all dependencies
- β FastAPI and Uvicorn pre-configured
- β Testing tools (pytest, httpx)
- β Development utilities (mypy, curl, jq)
- β Custom scripts to make usage easy
- β Automatic loading of environment variables
- β Automatic PYTHONPATH configuration
- Automatic configuration: Creates
.env
if it doesn't exist - Environment validation: Verifies configuration at startup
- Multiple interfaces: Bash script, Makefile, Nix commands
- Development mode: Auto-reload with
--reload
- Integrated testing: Test suite ready to use
- Automatic cleanup: Temporary file management
# 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
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
- FastAPI β High-performance Python web framework
- Uvicorn β ASGI server with asyncio support
- Pydantic β Data validation with type hints
- Requests β HTTP client for API integration
- HTML5/JavaScript β Minimal and functional frontend
- TailwindCSS β Utility-first CSS framework
- Marked.js β Markdown processing for responses
- Nix/NixOS β Reproducible environment management
- pytest β Testing framework
- mypy β Static type checking
- Shell Scripts β Task automation
- LangFlow API β AI analysis pipeline (remote mode)
- Local mode β Stub responses for offline development
Gonzalo Romero (DeepRat)
AI, Software & Systems Engineer Β· Prompt Engineer Β· FullβStack Developer
π Web | Hugging Face | GitHub | LinkedIn | Medium