Skip to main content

AI-powered multi-engine search system with intelligent result synthesis

Project description

Nexus AI Search Engine ๐Ÿš€

A powerful AI-powered multi-engine search system that orchestrates parallel searches across 5 different search engines with intelligent result synthesis using AI.

Python FastAPI License Status

โœจ Features

  • ๐Ÿ” Multi-Engine Search - Searches across 5 different engines simultaneously:

    • ๐Ÿฆ† DuckDuckGo
    • ๐Ÿ”Ž Google
    • ๐ŸŒ SearXNG
    • ๐Ÿ“š Wikipedia
    • ๐Ÿท๏ธ Wikidata
  • ๐Ÿค– AI-Powered Query Breakdown - Analyzes user queries and generates focused sub-queries

  • ๐Ÿ’ก Intelligent Result Synthesis - Combines and ranks results across all engines

  • โšก Real-time WebSocket Support - Live streaming of results

  • ๐ŸŽจ Modern UI - Beautiful, futuristic dark theme interface

  • ๐Ÿ”“ No API Keys Required - All search engines work for free

  • ๐Ÿš€ Fast & Async - Built with FastAPI for high performance

๐Ÿ“‹ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Frontend (HTML/CSS/JS)             โ”‚
โ”‚     Beautiful UI with Real-time Updates     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                 โ”‚ WebSocket
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚        FastAPI Backend Server               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  Query Processor (Intent Detection)  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ Search Orchestrator (Parallel)       โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€ DuckDuckGo Engine                โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€ Google Engine                    โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€ SearXNG Engine                   โ”‚   โ”‚
โ”‚  โ”‚  โ”œโ”€ Wikipedia Engine                 โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€ Wikidata Engine                  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚ Result Synthesizer (AI Ranking)      โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8+
  • pip or conda
  • Modern web browser

Installation

Option 1: Automated Setup (Recommended)

# Windows
python start_app.py

# Linux/Mac
python3 start_app.py

This will automatically start both backend and frontend servers.

Option 2: Manual Setup

Backend Setup:

# Navigate to backend directory
cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
.\venv\Scripts\Activate
# On Linux/Mac:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Start the backend
python main.py

Backend runs on: http://localhost:8000

Frontend Setup (in a new terminal):

# Navigate to frontend directory
cd frontend

# Start HTTP server
python -m http.server 3000

Frontend runs on: http://localhost:3000

3. Open in Browser

Navigate to: http://localhost:3000


โš™๏ธ Configuration

Environment Variables

Copy .env.example to .env and configure as needed:

# Backend Configuration
SEARXNG_INSTANCE=https://searx.work
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3

# Server Settings
BACKEND_PORT=8000
FRONTEND_URL=http://localhost:3000

# Search Settings
SEARCH_TIMEOUT=15
MAX_RESULTS_PER_ENGINE=10

Search Engines - All FREE!

All 5 search engines work without any API keys or authentication:

  1. SearXNG - Metasearch (246+ engines)
  2. DuckDuckGo - Privacy-focused
  3. Qwant - European privacy search
  4. Wikipedia - Knowledge base
  5. Wikidata - Structured data

No configuration needed! All engines are free forever with no rate limits.

Optional: Ollama LLM Integration

For enhanced AI query breakdown and synthesis:

  1. Install Ollama: https://ollama.ai
  2. Pull a model: ollama pull llama3.2
  3. Make sure Ollama is running (it will auto-start)

The system will automatically detect and use Ollama if available.


๐Ÿ“– Usage Guide

Search Examples

Try these queries to see the AI in action:

  • Simple factual: "What is quantum computing?"
  • Complex analysis: "Latest breakthroughs in fusion energy and their implications"
  • Technical: "How does neural network backpropagation work?"
  • Current events: "Climate change solutions 2026"

Key Features

โœ… 5 FREE Search Engines - SearXNG, DuckDuckGo, Qwant, Wikipedia, Wikidata
โœ… AI Query Breakdown - Automatically generates focused sub-queries
โœ… Parallel Search - All engines search simultaneously
โœ… Intelligent Synthesis - Deduplicates and ranks results by relevance
โœ… Real-time Updates - Live progress for each engine
โœ… Beautiful UI - Modern, responsive dark theme interface

Keyboard Shortcuts

Shortcut Action
Ctrl/Cmd + K Focus search input
Enter Search
Escape Clear search and reset UI

๐Ÿ—๏ธ Project Structure

Ai_search/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py                      # FastAPI application
โ”‚   โ”œโ”€โ”€ config.py                    # Configuration management
โ”‚   โ”œโ”€โ”€ query_processor.py           # AI query breakdown
โ”‚   โ”œโ”€โ”€ search_orchestrator.py       # Parallel search coordination
โ”‚   โ”œโ”€โ”€ result_synthesizer.py        # AI result ranking
โ”‚   โ”œโ”€โ”€ engines/
โ”‚   โ”‚   โ”œโ”€โ”€ brave.py
โ”‚   โ”‚   โ”œโ”€โ”€ duckduckgo.py
โ”‚   โ”‚   โ”œโ”€โ”€ google.py
โ”‚   โ”‚   โ”œโ”€โ”€ qwant.py
โ”‚   โ”‚   โ”œโ”€โ”€ searxng.py
โ”‚   โ”‚   โ”œโ”€โ”€ wikipedia.py
โ”‚   โ”‚   โ””โ”€โ”€ wikidata.py
โ”‚   โ””โ”€โ”€ requirements.txt
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ index.html                   # Main HTML
โ”‚   โ”œโ”€โ”€ styles.css                   # Beautiful UI styling
โ”‚   โ”œโ”€โ”€ script.js                    # Frontend logic
โ”‚   โ””โ”€โ”€ hologram.js                  # Visualization effects
โ”œโ”€โ”€ start_app.py                     # One-command startup
โ”œโ”€โ”€ README.md                        # This file
โ””โ”€โ”€ .env.example                     # Configuration template

๐Ÿ”ง Development

Backend Structure

  • main.py - FastAPI server with WebSocket support
  • query_processor.py - Analyzes queries and generates sub-queries
  • search_orchestrator.py - Manages parallel searches across all engines
  • result_synthesizer.py - Ranks and deduplicates results
  • config.py - Centralized configuration

Frontend Structure

  • index.html - Semantic HTML structure
  • styles.css - CSS variables and responsive design
  • script.js - Main frontend logic
  • hologram.js - Real-time visualization

API Endpoints

POST /search           - Execute a search
GET  /health          - Health check
WS   /ws/search       - WebSocket for live results

๐Ÿš€ Performance

  • Concurrent Searches: All 5 engines search in parallel
  • Average Response Time: 3-8 seconds (depending on query complexity)
  • Result Deduplication: Automatic removal of duplicate results
  • Smart Ranking: Results ranked by relevance, authority, and consensus

๐Ÿ“ฆ Dependencies

Backend

  • FastAPI - Modern web framework
  • Uvicorn - ASGI server
  • HTTPX - HTTP client
  • Aiohttp - Async HTTP requests
  • BeautifulSoup4 - HTML parsing
  • SPARQLWrapper - Wikidata queries
  • DuckDuckGo Search - DuckDuckGo API

Frontend

  • Vanilla HTML/CSS/JavaScript (no build tools needed!)
  • CSS Grid & Flexbox for responsive design
  • WebSocket API for real-time updates

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

To contribute:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is open-source and available under the MIT License - see the LICENSE file for details.


๐Ÿ› Troubleshooting

Backend won't start

# Check if port 8000 is in use
netstat -tulpn | grep 8000

# Kill process on port 8000 and try again

Frontend can't connect to backend

  • Ensure backend is running on http://localhost:8000
  • Check browser console (F12) for CORS errors
  • Verify both services are running

Slow search results

  • Check internet connection
  • SearXNG instance might be overloaded, try another instance
  • Increase SEARCH_TIMEOUT in .env

๐Ÿ“ง Support

For issues, questions, or suggestions, please open an issue on GitHub.


๐ŸŒŸ Star History

If you find this project useful, please consider giving it a star! โญ


Built with โค๏ธ by Davood


Troubleshooting

Backend won't start

Error: Module not found

# Make sure virtual environment is activated
.\venv\Scripts\Activate

# Reinstall dependencies
pip install -r requirements.txt

No results from SearXNG or Qwant

Issue: Public SearXNG instances may be slow or rate-limited

Solution: Try a different SearXNG instance in .env:

SEARXNG_INSTANCE=https://searx.fmac.xyz
# or
SEARXNG_INSTANCE=https://searx.tiekoetter.com

Qwant Issue: If Qwant API changes, other engines still provide results

WebSocket connection failed

Issue: Frontend can't connect to backend

Check:

  1. Backend is running on port 8000
  2. No firewall blocking localhost connections
  3. Browser console for specific errors (F12)

Results are slow

Normal: First search takes 5-8 seconds (5 engines in parallel) If very slow: Some engines may be timing out, check backend console logs


API Documentation

Backend API docs: http://localhost:8000/docs (Swagger UI)

Endpoints

  • GET / - API info
  • GET /health - Health check
  • POST /search - Execute search (REST)
  • WS /ws/process - Real-time search updates (WebSocket)

System Requirements

  • Python: 3.8+
  • Browser: Modern browser with WebSocket support
  • RAM: 500MB minimum
  • Internet: Required for search engines

Next Steps

Enhancements You Can Add

  1. User Authentication: Track search history
  2. Search History: Save and revisit past searches
  3. Export Results: Download as PDF or JSON
  4. Filter by Source: Checkbox to include/exclude engines
  5. Advanced Settings: Timeout, max results per engine
  6. Dark/Light Mode: Theme switcher
  7. Voice Search: Web Speech API integration

Credits

Search Engines Used (All 100% Free):

  • SearXNG (Privacy-focused metasearch - 246+ engines)
  • DuckDuckGo (Privacy-first search)
  • Qwant (European privacy search)
  • Wikipedia (Knowledge base)
  • Wikidata (Structured data)

Built with: FastAPI, Vanilla JavaScript, Canvas API, WebSockets

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_ai_search-1.0.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_ai_search-1.0.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file nexus_ai_search-1.0.0.tar.gz.

File metadata

  • Download URL: nexus_ai_search-1.0.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for nexus_ai_search-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8c4f4cc35c87f907b9d4d0807814a8f56f1e196610c740854285402c04458769
MD5 fc8c9cfd7f4dad7e065121214aee9540
BLAKE2b-256 d06170df281b70c20637452482ce36ae7814f7d845a8a45752bd95ad1d54ff78

See more details on using hashes here.

File details

Details for the file nexus_ai_search-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nexus_ai_search-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9099d851a3d615ae621415705e507282860ff01225a1583c2e6f36d78257174b
MD5 d4773569f25f69007399803c1b42a834
BLAKE2b-256 626044bdb7f5f08f79ab15243fde8ed87fcbbe211e614b7934e6343eb92a0272

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page