A Streamlit application that uses RAG (Retrieval-Augmented Generation) to answer questions about the Harry Potter universe.
- Ask questions about Harry Potter
- Retrieves relevant passages from the books
- Uses Groq's LLM to generate accurate answers based on the retrieved content
- Clone this repository
- Install dependencies:
pip install -r requirements.txt - Create a
.envfile with your Groq API key:GROQ_API_KEY=your-api-key-here - Run the database formation script to create the vector database:
python database_formation.py - Run the Streamlit app:
streamlit run app.py
- Fork this repository to your GitHub account
- Sign up for Streamlit Cloud
- Create a new app and connect it to your GitHub repository
- In the app settings, add your Groq API key as a secret:
- Go to "Advanced settings" > "Secrets"
- Add a new secret with the key
GROQ_API_KEYand your API key as the value
- Deploy the app
app.py: The main Streamlit applicationdatabase_formation.py: Script to create the vector database from text filesdocuments/: Directory containing Harry Potter text filesdb/: Directory where the vector database is storedrequirements.txt: List of Python dependencies
- The app requires SQLite 3.35.0 or higher, which is available on Streamlit Cloud
- Make sure to upload your Harry Potter text files to the
documents/directory before runningdatabase_formation.py