Skip to content

๐Ÿ” AI-powered custom search engine built with Flask and the Exa Search API.

Notifications You must be signed in to change notification settings

mahirp22/AI-Custom-Search-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AI-Powered Custom Search Engine (Exa API)

A lightweight, AI-powered search engine built using Flask, JavaScript, and the Exa Search API.
This project allows users to enter natural-language search queries and receive relevant, high-quality results powered by Exaโ€™s AI-driven search capabilities.

The goal of this project was to understand how modern search systems work, practice full-stack development, and integrate an AI-based search API into a clean, responsive web interface.

๐Ÿ“ฆ Technologies

Backend

  • Python
  • Flask
  • Exa Search API

Frontend

  • HTML
  • CSS (custom styling, responsive layout)
  • JavaScript (async fetch, DOM manipulation)

๐Ÿ’ก Features

Hereโ€™s what you can do with the AI Search Engine:

๐Ÿ” AI-Powered Search

  • Enter natural-language search queries
  • Queries are sent to the backend and processed using the Exa API
  • Returns relevant, high-quality search results

โšก Real-Time Results

  • Asynchronous requests using fetch()
  • Results are rendered dynamically without page reloads
  • Displays titles and external links for each result

๐Ÿง  Backend API Layer

  • Flask server handles:
    • Input validation
    • API requests to Exa
    • Response normalization for frontend use
  • Clean separation between backend logic and frontend UI

๐Ÿ“ฑ Clean & Responsive UI

  • Minimal, modern search interface
  • Responsive layout that works on desktop and mobile
  • Visual feedback for searching, empty results, and errors

๐Ÿ”„ How It Works

  1. The user enters a search query in the frontend.
  2. The query is sent as JSON to the Flask backend.
  3. Flask calls the Exa Search API using keyword-based search.
  4. Exa returns relevant results.
  5. The backend formats the response and sends it back to the frontend.
  6. Results are rendered dynamically in the browser.

๐Ÿšฆ Running the Project Locally

To run this project on your local machine:

  1. Clone or download this repository.
  2. Install the required Python dependencies:
    pip install flask exa-py
  3. Open app.py and ensure your Exa API key is set.
  4. Start the Flask development server:
    python app.py
  5. Open your browser and navigate to:
    http://127.0.0.1:5000
    

๐Ÿ“š What I Learned

This project helped strengthen both my backend and AI-integration skills.

๐Ÿง  AI & Search Systems

  • Learned how AI-powered search engines retrieve and rank results
  • Worked with natural-language queries instead of simple keyword matching
  • Understood how modern search APIs differ from traditional search engines

๐Ÿ”„ Backend Development

  • Built a Flask API to handle client requests
  • Processed and normalized third-party API responses
  • Implemented input validation and error handling

๐ŸŒ Frontendโ€“Backend Integration

  • Connected a JavaScript frontend to a Python backend
  • Used asynchronous fetch requests and dynamic DOM rendering
  • Maintained clean separation of concerns between layers

๐Ÿฟ Demo

๐ŸŽฅ Search Engine Walkthrough

This demo shows:

  • Entering a natural-language query
  • AI-powered search results returned from Exa
  • Dynamic rendering of results in the UI