A modern, responsive AI chat interface with integrated web search functionality. Perplexity 2.0 provides a clean UI similar to Perplexity.ai, combining conversational AI with real-time search capabilities.
- Real-time AI Responses – Stream AI responses as they're generated
- Integrated Web Search – AI can search the web for up-to-date information
- Conversation Memory – Maintains context throughout your conversation
- Search Process Transparency – Visual indicators show searching, reading, and writing stages
- Responsive Design – Clean, modern UI that works across devices
Perplexity 2.0 follows a client-server architecture:
- Modern React application built with Next.js
- Real-time streaming updates using Server-Sent Events (SSE)
- Components for message display, search status, and input handling
- Python backend using FastAPI for API endpoints
- LangGraph implementation for conversation flow with LLM and tools
- Integration with Tavily Search API for web searching capabilities
- Groq LLM (LLaMA 3) for fast and cost-free AI inference
- Server-Sent Events for real-time streaming of AI responses
- Node.js 18+
- Python 3.10+
- Groq API key
- Tavily API key
git clone https://github.com/aliaa039/perplexity.git
cd perplexitycd server
python -m venv .venv
source .venv/Scripts/activate # Windows (Git Bash)
pip install -r requirements.txtCreate a .env file inside the server directory:
GROQ_API_KEY=your_groq_api_key_here
TAVILY_API_KEY=your_tavily_api_key_herecd ../client
npm installcd server
uvicorn app:app --reloadcd client
npm run devhttp://localhost:3000
-
User sends a message through the chat interface
-
Server processes the message using Groq LLaMA-3
-
AI decides whether to use web search or respond directly
-
If search is needed:
- Query is sent to Tavily Search API
- Results are processed and injected into the prompt
- AI formulates a grounded response
-
Response is streamed back to the client in real-time
-
Search stages are displayed to the user (searching, reading, writing)

Contributions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
- Inspired by the UI and functionality of Perplexity.ai
- Built with Next.js, React, FastAPI, and LangGraph
- Powered by Groq (LLaMA 3) and Tavily Search API