This project is a Perplexity-like AI search web app built with Next.js, TypeScript, OpenAI (ChatGPT), and SerpAPI. It allows users to ask questions, view AI-generated answers with citations, see related web sources, and browse relevant images—all in a modern, Perplexity-inspired interface.
- Ask Anything: Enter a question and get a detailed, multi-paragraph AI answer with citations.
- Web Sources: Top web results are shown as cards with favicons, titles, and descriptions.
- Images Tab: Browse up to 12 relevant images for your query (via SerpAPI Google Images).
- Sources Tab: See up to 10 web sources with links and snippets.
- Sticky Search Bar: Always accessible at the bottom for new queries.
- Modern UI: Responsive, Perplexity-style design with sticky headers and tabs.
- Next.js (React, TypeScript)
- OpenAI API
- SerpAPI
- Clone the repo:
git clone https://github.com/yourusername/yourrepo.git cd yourrepo - Install dependencies:
yarn install # or npm install - Add API keys:
- Create a
.env.localfile in the root:OPENAI_API_KEY=your_openai_key SERPAPI_API_KEY=your_serpapi_key
- Create a
- Run the app:
yarn dev # or npm run dev - Open in browser:
- Visit http://localhost:3000
- Type a question on the landing page and press Enter.
- You'll be redirected to a results page with tabs for Answer, Images, and Sources.
- Use the sticky search bar at the bottom to ask a new question from anywhere.
- You can adjust the number of images/sources, UI styles, or swap in other LLM/image/search APIs as needed.
MIT