An intelligent search engine that combines real-time web search with AI-powered answer generation using OpenRouter API.
π Live Demo | Built on the excellent work of Wilson-ZheLin/SearchGPT
- π Real-time Web Search via Serper (Google API)
- π€ AI-Powered Answers using OpenRouter (multiple free models available)
- π Beautiful Streamlit Interface with Lottie animations
- π Semantic Search with ChromaDB vector database
- π― Smart Document Retrieval using text-embedding-3-small or Gitee BGE-M3
- π Source Citations with clickable references
- π Multi-language Support (auto-detects Chinese/English)
- β‘ Multi-threaded Web Scraping for fast content extraction
- πΎ Export Results as TXT or JSON
- π¨ No LangChain Required - lightweight and fast
- π Complete Pipeline Tracing - see every step with timing, API calls, and similarity scores
- π Full Prompt Visibility - inspect exactly what's sent to the LLM
- β±οΈ Performance Metrics - track time spent on each pipeline step
- Python 3.11+ recommended
- OpenRouter API Key (free tier available)
- Serper API Key (2,500 free queries)
- Clone the repository
git clone <your-repo-url>
cd Relevance Search- Install dependencies
pip install -r requirements.txt- Configure API Keys
You can either:
- Enter them in the Streamlit UI when running the app, OR
- Save them in
src/config/config.yaml:
model_name: x-ai/grok-4.1-fast:free
openrouter_api_key: "your-openrouter-key-here"
serper_api_key: "your-serper-key-here"Streamlit Web Interface (Recommended):
streamlit run app.pyCommand Line:
python src/main.pyAll models are completely free via OpenRouter:
- amazon/nova-2-lite-v1:free - Amazon's Nova 2 Lite model (default)
- nvidia/nemotron-nano-9b-v2:free - NVIDIA's efficient 9B model
- qwen/qwen3-4b:free - Alibaba's Qwen3 4B compact model
- alibaba/tongyi-deepresearch-30b-a3b:free - Alibaba's research-focused 30B model
Relevance Search/
βββ app.py # Streamlit web interface
βββ src/
β βββ main.py # CLI entry point
β βββ fetch_web_content.py # Web scraping with multi-threading
β βββ serper_service.py # Serper API integration
β βββ retrieval.py # Vector database & embeddings
β βββ llm_answer.py # AI answer generation
β βββ llm_service.py # OpenRouter API service
β βββ text_utils.py # Text processing utilities
β βββ config/
β βββ config.yaml # Configuration file
βββ requirements.txt # Python dependencies
βββ README.md # This file
The src/config/config.yaml file supports:
- model_name: AI model to use
- openrouter_api_key: Your OpenRouter API key
- serper_api_key: Your Serper API key
- template: Custom prompt template for AI responses

- Launch the app:
streamlit run app.py - Enter your API keys in the sidebar (or use saved keys)
- Select your preferred AI model
- Choose an AI profile (Researcher, Technical Expert, etc.)
- Enter your search query
- Click "π Search"
Edit the query in src/main.py and run:
python src/main.py- OpenRouter API - Access to multiple AI models
- Serper API - Fast Google search results
- ChromaDB - Vector database for semantic search
- Streamlit - Modern web interface
- BeautifulSoup4 - Web scraping
- text-embedding-3-small - Efficient text embeddings
- Search: Query sent to Serper API for real-time web results
- Scrape: Multi-threaded extraction of content from top results
- Embed: Text chunked and converted to vector embeddings (OpenRouter or Gitee AI)
- Retrieve: Semantic search finds most relevant content with similarity scores
- Generate: AI model creates comprehensive answer with citations
Relevance Search provides complete visibility into every step of the RAG pipeline:
- Step 1 - Search: See all URLs, titles, and snippets returned by Serper
- Step 2 - Scraping: Track success/failure for each page with content previews
- Step 3 - Embeddings: View API calls made, timing, and chunks processed
- Step 4 - Retrieval: Inspect similarity scores for each retrieved chunk (color-coded by relevance)
- Step 5 - Generation: See the exact prompt sent to the LLM and all context chunks
All steps include timing information to help identify bottlenecks and optimize performance.
Comprehensive logging is built-in. Check your terminal for detailed logs:
- Serper API requests and responses
- Web scraping progress (per thread)
- Embedding generation status
- AI model responses
- Error diagnostics
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is licensed under the MIT License.
This project is built on the foundation of Wilson-ZheLin/SearchGPT. Significant enhancements include:
- Migration from OpenAI to OpenRouter API
- Removal of LangChain dependencies
- Addition of Streamlit web interface
- Modern ChromaDB integration
- Comprehensive logging system
- Updated embedding models
If you find this project useful, please give it a star! β



