Advanced AI-Powered Research Assistant v2.0
π Try it Live on Hugging Face Spaces π
- π― Intelligent Web Search: Uses DuckDuckGo to find the most relevant sources
- π Advanced Content Analysis: Automatically extracts and processes content from multiple websites
- π€ AI-Powered Synthesis: Leverages Google's Gemini 2.0 Flash to create comprehensive reports
- π Professional Reports: Generates both Markdown and beautifully formatted PDF reports
- π¨ Modern UI: Sleek, responsive interface with gradient backgrounds and smooth animations
- π Secure API Handling: Built-in validation with detailed error messages and troubleshooting
- β‘ Fast & Reliable: Automated research in minutes with real-time progress tracking
- π‘οΈ Safe File Handling: Automatic filename sanitization for cross-platform compatibility
- π± Responsive Design: Works perfectly on desktop, tablet, and mobile devices
- Python 3.8 or higher
- Google Gemini API key (get it from AI Studio)
- Internet connection for web research
-
Clone or download this repository
git clone <your-repo-url> cd hell
-
Automated Setup (Recommended)
python setup.py
-
Manual Setup
pip install -r requirements.txt
-
Get your Gemini API key
- Visit Google AI Studio
- Create an account or sign in
- Generate a new API key
- Copy the complete API key (usually 30-50 characters)
- Keep this key secure and don't share it publicly
-
Automated Setup
python setup.py
-
Manual Setup
pip install -r requirements.txt
-
Run the application
python app.py
-
Get your API key
- Visit Google AI Studio
- Generate your Gemini API key
Before running the main application, you can test your API key independently:
python test_api_key.py
Or test with your API key directly:
python test_api_key.py "your-api-key-here"
This will help you identify and resolve API key issues before using the main application.
-
Run the application
python app.py
-
Open your browser
- The application will automatically open in your default browser
- Or navigate to the URL shown in the terminal (usually
http://127.0.0.1:7860
)
-
Start researching
- Enter your Gemini API key in the designated field
- Click "π Validate API Key" to test your key (recommended)
- Type your research topic (e.g., "Latest developments in AI", "Climate change solutions 2024")
- Click "π Start Deep Research"
- Wait for the comprehensive report to be generated (1-2 minutes)
- Download your report in either:
- π Markdown format (.md file)
- π Professional PDF with formatted layout, branding, and citations
- π― Professional Hero Section: Eye-catching gradient header with DeepResearchAgent-AI branding
- π Smart API Setup: Collapsible step-by-step guide for API key configuration
- π Real-time Validation: Instant feedback on API key status with detailed error messages
- π Progress Tracking: Visual progress indicators during research process
- π± Fully Responsive: Optimized for desktop, tablet, and mobile devices
- π¨ Modern Glassmorphism: Professional styling with gradients, shadows, and blur effects
- π High Contrast: Dark text on light backgrounds for perfect readability
- β‘ Fast Loading: Optimized performance with efficient caching
hell/
βββ app.py # Main application with modern UI and PDF generation
βββ README.md # Comprehensive documentation
βββ requirements.txt # All dependencies including PDF generation
βββ setup.py # Automated setup and testing script
- π Intelligent Search: Uses DuckDuckGo to find the most relevant and recent sources
- π Content Processing: Fetches and extracts meaningful content from multiple web pages
- π€ AI Analysis: Google's Gemini 2.0 Flash analyzes all gathered information
- π Professional Reports: Generates comprehensive reports with:
- Executive Summary with key findings
- Detailed Analysis with explanations and examples
- Real-world Applications and use cases
- Future Trends and predictions
- Professional Citations with source links
- Branded PDF Layout with your platform name and styling
- β Filename Generation: Now correctly uses topic name instead of report content
- β File Safety: Proper sanitization of special characters (?, <, >, :, /, , |, *)
- β UI Visibility: Fixed white text issues with high-contrast dark text on light backgrounds
- β Responsive Design: Fully responsive layout that works on all devices
- β Error Handling: Robust error handling for PDF generation and file creation
- β Modern Glassmorphism: Professional glass-like effects with blur and transparency
- β Gradient Backgrounds: Beautiful color gradients throughout the interface
- β High Contrast Text: Dark text on light backgrounds for perfect readability
- β Responsive Layout: Adapts seamlessly to different screen sizes
- β Professional Styling: Enhanced buttons, inputs, and layout components
- β Status Indicators: Clear success/error messages with color coding
- β Professional Layout: Multi-page PDF with headers, footers, and branding
- β DeepResearchAgent-AI Branding: Platform name prominently displayed
- β Organized Sections: Table of contents with proper formatting
- β Source Citations: Complete bibliography with links
- β Modern Typography: Professional fonts and color scheme
You can set your Gemini API key as an environment variable:
Windows (PowerShell):
$env:GEMINI_API_KEY="your-api-key-here"
Linux/Mac:
export GEMINI_API_KEY="your-api-key-here"
You can modify the following parameters in app.py
:
max_results
: Number of search results to fetch (default: 10)max_sources
: Number of sources to analyze (default: 5)content_length
: Maximum content length per source (default: 5000 characters)
- Academic Research: Gather information on scientific topics
- Market Analysis: Research industry trends and competitors
- Technology Updates: Stay current with latest developments
- Investment Research: Analyze market opportunities
- Educational Content: Create comprehensive study materials
gradio
: Web interface frameworkgoogle-generativeai
: Google's Gemini AI APIddgs
: Web search functionality (formerly duckduckgo-search)requests
: HTTP requests for web scrapingbeautifulsoup4
: HTML parsing and content extraction
- API Limits: Be mindful of your Gemini API usage limits and costs
- Rate Limiting: The tool includes delays between requests to be respectful to websites
- Content Length: Content is automatically truncated to avoid token limits
- Source Quality: The tool filters out low-quality sources automatically
- Never share your API key publicly
- The API key is handled securely and not stored permanently
- Use environment variables for production deployments
- "No relevant sources found"
- Try different keywords or a more specific search term
- Check your internet connection
- β Copy the complete key - make sure you didn't miss any characters
- β Check for extra spaces at the beginning or end of the key
- β Try refreshing the AI Studio page and copying the key again
- β Make sure you're signed in to the correct Google account
- β
Use the test script:
python test_api_key.py "your-key"
- β Try creating a new API key if the current one doesn't work
- Check your usage at https://aistudio.google.com/
- Wait for the quota to reset (usually monthly)
- Consider upgrading your plan if needed
- Check your internet connection
- Try again in a few minutes
- Disable VPN if you're using one
- Check if Google services are accessible in your region
- Regenerate your API key at https://aistudio.google.com/
- Make sure the API key is enabled for Gemini API
- Check if your Google Cloud project has the necessary permissions
-
"Search error: operation timed out"
- This is usually a temporary network issue
- Try running the search again
- Check your internet connection
-
Import errors with ddgs
- Make sure you've uninstalled the old
duckduckgo-search
package - Install the new
ddgs
package:pip install ddgs
- Run the setup script:
python setup.py
- Make sure you've uninstalled the old
-
Installation issues
- Make sure you have Python 3.8+ installed
- Try installing dependencies one by one
- Use the provided setup script for automated installation
-
Filename errors or download issues
- The app automatically sanitizes filenames to remove invalid characters
- Special characters like
?
,<
,>
,:
,/
,\
,|
,*
are replaced with underscores - Very long research topics are automatically truncated for safe file creation
If you encounter issues:
- Check the console output for detailed error messages
- Verify all dependencies are installed correctly
- Ensure your API key is valid and has sufficient quota
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
For questions or support, please create an issue in the repository.
Happy Researching! πβ¨