A document analysis tool that checks for contradictions and inconsistencies in uploaded files using AI-powered natural language processing.
backend/: Python FastAPI server that handles file uploads, AI analysis, and report generationfrontend/: Simple HTML/CSS/JavaScript frontend for user interactionuploads/: Storage directory for uploaded documentsreports/: Storage directory for generated reports.env: Environment variables for API keys and configurationrequirements.txt: Python dependencies
- Python 3.8 or higher
- Node.js (for the frontend development server)
- OpenRouter API key (for AI functionality)
# Clone your repository if needed
# git clone <repository-url>
cd smart-doc-checkerCreate a .env file in the root directory with the following variables:
OPENROUTER_API_KEY=your_openrouter_api_key_here
SITE_URL=http://localhost:5173
SITE_NAME=Smart Doc Checker
OPENMETER_API_URL=http://localhost:8888
OPENMETER_API_KEY=your_openmeter_api_key_here
pip install -r requirements.txt# From the root directory
cd backend
uvicorn app:app --reload --port 8000You can serve the frontend files using a simple HTTP server. For example:
# From the root directory
cd frontend
python -m http.server 5173- Open your browser and navigate to
http://localhost:5173 - Upload documents using the file upload interface
- Click "Analyze" to check for contradictions
- View the analysis results
- Generate a PDF report of the findings
- Document upload and processing
- AI-powered contradiction detection
- PDF report generation
- User-friendly interface
- Error handling for policy restrictions and other issues
- The application has been enhanced with robust error handling for external service failures (like OpenMeter)
- All operations continue to work even when external services are unavailable
- Detailed logging helps track and debug issues
- Frontend includes comprehensive error handling with clear messages for users
- OpenMeter integration features automatic retries with exponential backoff for transient failures
- Monitor.py includes detailed error handling for URL monitoring with specific exception handling
- All API errors are properly logged with consistent format
A verification script is included to test all endpoints and confirm the application is working correctly:
python verification.pyThe frontend includes detailed logging of requests, responses, and form data to help diagnose issues.
- The application uses OpenRouter's API for AI functionality
- Ensure your API key has the necessary permissions
- Large files may take longer to process