TruthTracker is an advanced fact-checking system that uses AI to analyze and verify Twitter content in real-time. It combines multiple search engines, AI analysis, and source credibility assessment to provide comprehensive fact-checking results.
- Real-time Tweet Analysis: Fetch and analyze tweets instantly
- Multi-Source Verification: Aggregate data from Google, DuckDuckGo, and Wikipedia
- AI-Powered Analysis: Advanced claim verification using Groq AI
- Source Credibility: Evaluate source reliability and relevance
- Comprehensive Reports: Detailed fact-checking results with evidence
- Engagement Analysis: Consider social context and virality
- Async Processing: Handle multiple requests efficiently
- Python 3.9+
- Twitter API Bearer Token
- Groq API Key
- FastAPI
- uvicorn
- Clone the repository:
git clone https://github.com/yourusername/truthtracker.git
cd truthtracker- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create
.envfile:
GROQ_API_KEY=your_groq_api_key
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
ENVIRONMENT=development
LOG_LEVEL=INFO- Run the application:
uvicorn app.main:app --reloadPOST /api/v1/check/tweet{
"tweet_id": "1234567890",
"background_check": false
}POST /api/v1/check/text{
"text": "Your text to fact check",
"background_check": false
}GET /api/v1/check/{check_id}{
"check_id": "uuid",
"status": "completed",
"started_at": "2024-11-24T12:00:00Z",
"completed_at": "2024-11-24T12:00:30Z",
"results": {
"responses": [
"Fact Check Results",
"Evidence Analysis",
"Source Analysis"
],
"analysis": {
"verdict": "True/False/Partially True",
"confidence": "high/medium/low",
// ... more analysis details
}
}
}fact_checker/
βββ app/
β βββ api/
β β βββ routes.py # API endpoints
β β βββ models.py # Pydantic models
β β βββ dependencies.py
β βββ core/
β β βββ twitter.py # Twitter integration
β β βββ search.py # Search tools
β β βββ analysis.py # Groq analysis
β β βββ workflow.py # Fact-check workflow
β βββ services/
β β βββ fact_checker.py
β βββ utils/
β βββ logging.py
βββ requirements.txt
βββ .env.example
βββ README.md
| Variable | Description | Required |
|---|---|---|
| GROQ_API_KEY | Your Groq API key | Yes |
| TWITTER_BEARER_TOKEN | Twitter API bearer token | Yes |
| ENVIRONMENT | development/production | No |
| LOG_LEVEL | INFO/DEBUG/WARNING/ERROR | No |
| CACHE_TTL | Cache time-to-live in seconds | No |
| MAX_WORKERS | Maximum worker threads | No |
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI for the web framework
- Groq for AI analysis
- Twitter API for data access
- All the contributors and supporters
For support and questions, please open an issue on GitHub.
Built with β€οΈ and Python