A Perplexity-inspired search and question-answering system that combines Google's Gemini API and Exa's search capabilities to provide enhanced search results and intelligent answers.
- Intelligent Query Generation: Uses Gemini to transform natural language questions into optimized search queries
- Recent News Search: Fetches news articles from the past week using Exa's search API
- Smart Summarization: Automatically summarizes search results using Gemini
- Related Questions: Generates relevant follow-up questions based on search results
- Similar Content Discovery: Finds related articles based on URL similarity
- Source Transparency: Links to original sources for all information
- YouTube Filtering: Automatically excludes YouTube results for focused article-based search
- Python 3.10
- Active Gemini API key (from Google AI Studio)
- Active Exa API key
You'll need to obtain API keys from:
- Google AI Studio for Gemini access
- Exa for search functionality
Set up your environment variables:
GEMINI_API_KEY=your_gemini_api_key
EXA_API_KEY=your_exa_api_key
# Install required packages
pip install exa-py google-generativeai
The project consists of three main components:
python news.py
# Enter your question when prompted
- Processes your question through Gemini for query optimization
- Searches recent news via Exa API
- Returns summaries and related questions
python related_questions.py
- Generates contextual follow-up questions
- Specializes in technology and product-related queries
python similar.py
- Discovers articles similar to a reference URL
- Provides diverse sources by excluding same-domain content
- User inputs a question
- Question is processed by Gemini API for optimal search query formation
- Exa API searches for relevant recent articles
- Gemini API summarizes the found content
- System generates related questions
- All sources are provided for reference
This project is under active development. Planned features include:
- Web interface/GUI for easier interaction
- Response caching to reduce API calls
- Customizable search time ranges
- Advanced filtering options
- Enhanced summarization features
- Rate limiting for API calls
- Error handling improvements