- π Advanced GitHub Search - Find repositories, code, issues, and users with GitHub's powerful search syntax
- π§ AI-Powered Semantic Enhancement - Leverage Exa's semantic AI to discover conceptually relevant results
- π― Customizable Filters - Refine results with filters for language, stars, forks, dates, and more
- π» Modern UI - Beautiful and responsive interface built with Bootstrap 5
- π RESTful API - Seamlessly integrate search capabilities into your applications
- π URL Similarity Search - Find websites similar to any GitHub project
- π Content Similarity Search - Discover conceptually related content across the web
- π Rate Limiting - Built-in protection against API abuse
- π Comprehensive Logging - Detailed logs for monitoring and debugging
- Python 3.8 or higher
- GitHub API token (recommended to avoid rate limits)
- Exa API key (required for semantic search capabilities)
- Clone the repository
git clone https://github.com/yourusername/ExaHub.git
cd ExaHub- Create and activate a virtual environment
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Configure environment variables
Create a .env file in the project root:
GITHUB_TOKEN=your_github_token
EXA_API_KEY=your_exa_api_key
SECRET_KEY=a_secure_random_string
FLASK_ENV=development
- Start the application
python run.py- Open your browser
Navigate to http://localhost:5000 to start searching!
ExaHub combines the power of GitHub's traditional search with Exa AI's semantic understanding:
- Your search query is processed through the GitHub API to find exact matches
- Exa AI enhances these results by identifying semantically related content
- Results are ranked by relevance, with highlighted matches
- Additional metadata enriches each result for better context
keyword # Search for a keyword
"exact phrase" # Search for the exact phrase
repo:owner/name # Filter by repository
user:username # Filter by user
org:organization # Filter by organization
language:python # Filter by language
stars:>1000 # Repositories with more than 1000 stars
created:>2022-01-01 # Created after January 1, 2022
pushed:>2023-01-01 # Last updated after January 1, 2023
topic:machine-learning # Filter by topic
is:public # Only public repositories
fork:true # Include forks
ExaHub integrates Exa AI to enhance search results by:
- Finding conceptually similar results beyond exact keyword matches
- Ranking results based on semantic relevance to your query
- Highlighting the most relevant sections of the code or text
- Discovering content that traditional keyword search might miss
import requests
import json
# Example search parameters
search_data = {
"query": "machine learning",
"type": "repositories",
"language": "python",
"stars": [100, null], # Repos with at least 100 stars
"topics": ["ai", "deep-learning"],
"enhance_with_exa": true,
"page": 1,
"per_page": 10
}
# Send the request
response = requests.post(
"http://localhost:5000/search/api",
json=search_data,
headers={"Content-Type": "application/json"}
)
# Process the results
results = response.json()# Find websites similar to a GitHub repository
url_data = {
"url": "https://github.com/tensorflow/tensorflow",
"num_results": 5
}
response = requests.post(
"http://localhost:5000/api/similar-urls",
data=url_data
)# Find content similar to a concept
similarity_data = {
"prompt": "Transformer architecture for natural language processing",
"num_results": 10,
"search_type": "neural"
}
response = requests.post(
"http://localhost:5000/api/similarity-search",
data=similarity_data
)| Variable | Description | Default |
|---|---|---|
GITHUB_TOKEN |
GitHub API token | None |
EXA_API_KEY |
Exa API key | None |
SECRET_KEY |
Flask secret key | 'dev' |
FLASK_ENV |
Environment (development/production) | 'development' |
HOST |
Server host | '0.0.0.0' |
PORT |
Server port | 5000 |
FLASK_CONFIG |
Configuration profile to use | 'default' |
ExaHub/
βββ app/ # Application package
β βββ __init__.py # Flask app initialization
β βββ config.py # Configuration settings
β βββ routes/ # Route definitions
β β βββ main.py # Main/index routes
β β βββ search.py # Search routes
β β βββ api.py # API routes
β βββ models/ # Data models
β β βββ search_params.py # Search parameters model
β β βββ search_result.py # Search results model
β βββ services/ # Service layer
β β βββ search_service.py # GitHub search service
β β βββ similarity_service.py # Exa AI service
β βββ static/ # Static assets
β βββ templates/ # HTML templates
β βββ base.html # Base template
β βββ index.html # Home page
β βββ results.html # Search results
β βββ api_playground.html # API testing page
βββ run.py # Application entry point
βββ requirements.txt # Python dependencies
βββ .env # Environment variables
βββ README.md # Project documentation
# Run all tests
pytest
# Run with coverage report
coverage run -m pytest
coverage reportExaHub includes built-in rate limiting to prevent API abuse:
- Global: 200 requests per day, 50 per hour
- Search API: 30 requests per minute
- Similarity search: 20 requests per minute
- Web interface: 60 searches per hour
The application includes comprehensive logging:
- Development: Console logging at DEBUG level
- Production: Rotating file logs (10MB max size, 10 backups)
- Log location:
instance/logs/exahub.log
- Go to GitHub Developer Settings
- Generate a new token with
repoandread:userscopes - Copy the token to your
.envfile
- Visit Exa.ai to sign up for an account
- Navigate to your profile settings to create an API key
- Add the key to your
.envfile
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some 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.
- GitHub API for repository search capabilities
- Exa AI for semantic search technology
Made with β€οΈ by Dustin Smith