A functional mini Perplexity system that can accept user queries, perform web searches, generate concise answers using a language model (I used Hugging Face Transformers), and provide source citations.
Required softwares - Python, Flask, HTML, CSS and JavaScript
- Clone the repository.
- Install dependencies listed in requirements.txt.
- Configure API key and Search engine ID for Google Custom Search API and choose the language model to process search results and generate coherent, concise answers.
- Create index.html, style.css and script.js.
- Open index.html in a browser or serve it through a local server.
- Start the Flask server using python app.py.
- Open index.html to access the frontend.
Local Deployment :
- Run the backend on http://127.0.0.1:5000/
- Access the frontend via your browser
Input a query - Users can type a question into the input box and click "Go" to fetch an answer.

To run the app locally on http://127.0.0.1:5000, run "python -m flask --app app run" on the terminal. It will show something like this



- Backend Framework - Chose Flask for simplicity and lightweight performance.
- Frontend Structure - Used HTML/CSS/JS for a simple, accessible interface.
- Language Model - Hugging Face as it offers a variety of pre-trained transformer models that are freely accessible and open-source.
- Search API - Google Custom Search API as it uses Google’s search engine, which is often more familiar for users.
- OpenAI Access Limitations
- Hugging Face models provided a workable alternative, they sometimes lacked the accuracy or specificity needed for diverse and complex questions.
- Implementing a seamless follow-up question system proved challenging without integrating openAI.
- Response time for generating answers was slower than desired due to the load required by transformer models, particularly for tasks like summarization or large-scale text processing.
- Enhanced NLP: Integrate a model like GPT for more natural responses.
- Implementing a follow-up question system.
- Optimizing response time