Open-source app inspired by the amazing web search product, Perplexity.
![Screenshot 2024-05-08 at 1 23 35 PM](https://private-user-images.githubusercontent.com/1054593/329038730-28ac5a06-abc6-4a8d-ab60-36f3e1f1e596.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2Njc0NTYsIm5iZiI6MTcyNDY2NzE1NiwicGF0aCI6Ii8xMDU0NTkzLzMyOTAzODczMC0yOGFjNWEwNi1hYmM2LTRhOGQtYWI2MC0zNmYzZTFmMWU1OTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjZUMTAxMjM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTI3NDA1ODljNGI4Mjc0OWU5N2FiZmM1YzAxYjJjNmQzZDUzOGNlZjQwM2E5YjNiYzQ3NDAxYmZiY2I2NDgyYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.GDHjVqrbk__9PIG7fXJ6Y8DPZ5MfKF0FJ58k4K7BDIc)
![Screenshot 2024-05-08 at 1 24 33 PM](https://private-user-images.githubusercontent.com/1054593/329038747-a932819e-6e24-45c6-9138-234e1870a558.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2Njc0NTYsIm5iZiI6MTcyNDY2NzE1NiwicGF0aCI6Ii8xMDU0NTkzLzMyOTAzODc0Ny1hOTMyODE5ZS02ZTI0LTQ1YzYtOTEzOC0yMzRlMTg3MGE1NTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjZUMTAxMjM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDNhMDA5Zjc3Yzg0M2FjMGFmZmIyMTZhYTRiOTcwOWI0ZDMzYjdiZDE3OWVjZDgwZDE1OWQxMmIwMTJiMjZkZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Y9gPDIc_cCzyCzf_belZyE86KMTFSjVv7PRa4CMNNgI)
Given a user query, the app conducts a web search,
downloads the top N resulting web pages, then analyzes those pages
with an LLM.
The LLM can be any smaller, consumer-grade with at least 5k context window (assuming each web page ~1k tokens)
-
cd backend copy config.json.sample config.json
- In
config.json
, fill inGOOGLE_SEARCH_API_KEY
andGOOGLE_SEARCH_ENGINE_ID
credentials from Google Custom Search API. - Fill in
GROQ_API_KEY
credentials from Groq. - Setup virtual environment, packages, and deploy the server
In the future, only need to do:
virtualenv venv . venv/bin/activate pip install -r requirements.txt python app.py
. venv/bin/activate python app.py
- Update
API_URL
inconstants.js
to point to your server -
npm install
- In dev, to start the server:
In production, to start the server:
npm run start
npm i -g npm@latest rm -rf node_modules rm -rf package-lock.json npm cache clean --force npm i --no-optional --omit=optional npm run build npm install -g serve server -s build