An AI-augmented search application that expands your search query and explores multiple perspectives of your original question.
- Query Expansion: Uses an OpenAI-compatible LLM to generate 5 diverse, related search queries
- Parallel Search: Performs multiple web searches using the DuckDuckGo search engine
- Result Deduplication: Removes duplicate results based on URLs
- AI Re-ranking: Re-ranks the combined search results based on relevance to your original query
- Clean UI: Simple, responsive user interface
- You enter a search query in the web interface
- The backend generates 5 diverse, related search queries using an LLM
- The application performs 5 parallel web searches using DuckDuckGo
- Results are deduplicated and then re-ranked by the LLM based on relevance to your original query
- The final, re-ranked results are displayed in the web interface
- Python 3.9 or higher
- An OpenAI API key (or compatible API key for a local LLM)
- Clone this repository or download the source code:
git clone https://github.com/yourusername/multi-query-search.git
cd multi-query-search- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
-
Windows:
venv\Scripts\activate
-
macOS/Linux:
source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt- Create a
.envfile based on the.env.examplefile:
cp .env.example .env- Edit the
.envfile and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
- Start the Flask server:
python app.py- Open your web browser and navigate to:
http://localhost:5000
To use a local LLM instead of OpenAI's API:
- Set up your local LLM with an OpenAI-compatible API (e.g., LM Studio, LocalAI, Ollama, etc.)
- In your
.envfile, add the base URL of your local LLM API:
OPENAI_API_BASE=http://localhost:8000/v1
OPENAI_MODEL=your_local_model_name
- Search Results: You can adjust the number of results per query in the
search_duckduckgofunction inapp.py - Model Selection: Change the LLM model by setting the
OPENAI_MODELenvironment variable - UI Styling: Modify the CSS in
templates/index.htmlto change the appearance
This project is licensed under the MIT License - see the LICENSE file for details.
- Uses the DuckDuckGo Search Python library
- Powered by OpenAI API or compatible LLM providers