A full-stack AI-powered misinformation detection system that uses multi-agent architecture to verify claims through intelligent decomposition, search, and evaluation.
- Multi-Agent System: Specialized AI agents for classification, decomposition, search, and evaluation
- Intelligent Claim Analysis: Automatically classifies claims by domain, type, verifiability, and urgency
- Smart Decomposition: Breaks down complex claims into verifiable sub-claims
- Parallel Search: Generates and executes multiple search queries concurrently
- Evidence Evaluation: Analyzes search results to determine claim veracity
- Real-time Workflow Visualization: Track the verification process step-by-step
- Modern UI: Beautiful, responsive interface built with React and TailwindCSS
- Result History: Browse and review past verification results
The backend uses a multi-agent architecture powered by AWS Bedrock (Claude 3.5 Sonnet):
- Classifier Agent: Analyzes and categorizes claims
- Decomposer Agent: Breaks complex claims into verifiable components
- Search Agent: Generates targeted search queries
- Evaluator Agent: Synthesizes evidence and determines veracity
- Modern, responsive UI with TailwindCSS
- Real-time workflow visualization
- Interactive result display with expandable sections
- Lucide React icons for enhanced UX
- Python: 3.8 or higher
- Node.js: 14.x or higher
- npm: 6.x or higher
- AWS Account: With Bedrock access configured
- Perplexity API Key: For search functionality
git clone https://github.com/yourusername/mid-aws.git
cd mid-awspip install fastapi uvicorn python-dotenv pydantic requests strands-frameworkOr create a requirements.txt:
fastapi
uvicorn[standard]
python-dotenv
pydantic
requests
strands-frameworkThen install:
pip install -r requirements.txtCreate a .env file in the root directory:
# Perplexity API Configuration
PERPLEXITY_API_KEY=your_perplexity_api_key_here
# AWS Configuration (if not using default credentials)
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_keyNote: The application uses AWS Bedrock with Claude 3.5 Sonnet. Ensure your AWS credentials have appropriate Bedrock permissions.
cd misinfo-detector-app
npm installCreate a .env file in the misinfo-detector-app directory:
REACT_APP_API_URL=http://localhost:8000From the root directory:
python api.pyOr use the restart script:
chmod +x restart_backend.sh
./restart_backend.shThe API will be available at:
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
From the misinfo-detector-app directory:
npm startThe application will open at http://localhost:3000
- Enter a Claim: Type or paste the claim you want to verify
- Submit: Click "Verify Claim" to start the analysis
- Watch the Workflow: See real-time progress through classification, decomposition, search, and evaluation
- Review Results: Examine the detailed analysis, evidence, and verdict
- Explore History: Browse past verification results
GET /
GET /healthReturns API status and configuration.
POST /verify
Content-Type: application/json
{
"claim": "Your claim text here"
}Returns complete verification analysis including classification, decomposition, search results, and evaluation.
GET /resultsReturns list of all saved verification results.
GET /results/{filename}Returns a specific verification result by filename.
- FastAPI: Modern, fast web framework for building APIs
- AWS Bedrock: Claude 3.5 Sonnet for AI agents
- Strands Framework: Multi-agent orchestration
- Perplexity API: Advanced search capabilities
- Uvicorn: ASGI server
- Pydantic: Data validation
- React 19.2: UI library
- TailwindCSS: Utility-first CSS framework
- Lucide React: Beautiful icon library
- Create React App: Build tooling
mid-aws/
βββ api.py # FastAPI backend server
βββ search.py # Multi-agent detection system
βββ data.py # Data models and utilities
βββ web.py # Additional web utilities
βββ restart_backend.sh # Backend restart script
βββ verification_results/ # Saved verification results
βββ .env # Backend environment variables
βββ .gitignore # Git ignore rules
βββ misinfo-detector-app/ # React frontend
βββ public/ # Static assets
βββ src/
β βββ components/ # React components
β βββ api/ # API integration
β βββ App.js # Main app component
β βββ index.js # Entry point
βββ package.json # Frontend dependencies
βββ tailwind.config.js # TailwindCSS configuration
βββ .env # Frontend environment variables
Edit search.py to customize:
NUM_SEARCH_QUERIES = 10 # Number of search queries to generate
MAX_PARALLEL_WORKERS = 3 # Parallel search workers
SEARCH_TIMEOUT = 30 # Search timeout in seconds
MAX_TOKENS_CONFIG = 4096 # Max tokens for AI responsesThe backend is configured to accept requests from:
Modify api.py to add additional origins if needed.
# Test health endpoint
curl http://localhost:8000/health
# Test verification endpoint
curl -X POST http://localhost:8000/verify \
-H "Content-Type: application/json" \
-d '{"claim": "The Earth is flat"}'cd misinfo-detector-app
npm test-
Input: "The Great Wall of China is visible from space"
-
Classification:
- Domain: Science/Geography
- Type: Factual
- Verifiability: High
- Urgency: Low
-
Decomposition:
- Sub-claim 1: The Great Wall of China exists
- Sub-claim 2: The wall has specific dimensions
- Sub-claim 3: The wall is visible from space with naked eye
-
Search: 10 targeted queries executed in parallel
-
Evaluation:
- Verdict: Mostly False
- Confidence: High
- Evidence: Detailed analysis with sources
API Key Not Configured
# Ensure .env file exists with PERPLEXITY_API_KEY
cat .envAWS Bedrock Access Denied
- Verify AWS credentials are configured
- Check IAM permissions for Bedrock access
- Ensure Claude 3.5 Sonnet model access is enabled
Port Already in Use
# Kill process on port 8000
lsof -ti:8000 | xargs kill -9API Connection Failed
- Verify backend is running on port 8000
- Check REACT_APP_API_URL in
.env - Ensure CORS is properly configured
Dependencies Not Installing
# Clear npm cache and reinstall
rm -rf node_modules package-lock.json
npm installContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- AWS Bedrock: For providing AWS nova pro
- Perplexity AI: For advanced search capabilities
- Strands Framework: For multi-agent orchestration
- React Team: For the amazing UI library
- TailwindCSS: For the utility-first CSS framework
For questions or support, please open an issue on GitHub.
Built with β€οΈ using AI-powered multi-agent systems