├── .gitignore ├── favicon.ico ├── pdfs ├── QarmashiFood.pdf └── TaxCard-TaxYear2025.pdf ├── requirements.txt ├── README.md └── app.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Virtual environment 2 | .venv/ 3 | .env 4 | .vscode -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RidaNaz/RAGify-Query-Model/HEAD/favicon.ico -------------------------------------------------------------------------------- /pdfs/QarmashiFood.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RidaNaz/RAGify-Query-Model/HEAD/pdfs/QarmashiFood.pdf -------------------------------------------------------------------------------- /pdfs/TaxCard-TaxYear2025.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RidaNaz/RAGify-Query-Model/HEAD/pdfs/TaxCard-TaxYear2025.pdf -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | streamlit 2 | langchain 3 | langchain_community 4 | langchain_google_genai 5 | langchain-groq 6 | groq 7 | pypdf 8 | faiss-cpu 9 | python-dotenv 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  [](https://git.io/typing-svg) 2 | 3 | # RAGify Query Model 4 | 5 | ## 1. Run these Commands: 6 | 7 | - Create a `uv` virtual environment and activate it: 8 | ```bash 9 | uv venv 10 | .\.venv\Scripts\activate 11 | ``` 12 | 13 | - install the dependencies in the `uv venv` 14 | ```bash 15 | uv pip install -r requirements.txt 16 | ``` 17 | 18 | - Run the Streamlit App 19 | ```bash 20 | streamlit run app.py 21 | # or 22 | uv run streamlit run app.py 23 | ``` 24 | 25 | ## Get Groq API Key 26 | 27 | - `https://console.groq.com/` 28 | 29 | 30 | ## 🔗 Links 31 | [](https://ridanaz.vercel.app/) 32 | [](https://linkedin.com/in/ridanaz67) 33 | [](mailto:rnaz3414@gmail.com) 34 | [](https://medium.com/@rnaz3414) -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import os 2 | import streamlit as st 3 | from langchain_groq import ChatGroq 4 | from langchain.text_splitter import RecursiveCharacterTextSplitter 5 | from langchain.chains.combine_documents import create_stuff_documents_chain 6 | from langchain_core.prompts import ChatPromptTemplate 7 | from langchain.chains import create_retrieval_chain 8 | from langchain_community.vectorstores import FAISS 9 | from langchain_community.document_loaders import PyPDFDirectoryLoader 10 | from langchain_google_genai import GoogleGenerativeAIEmbeddings 11 | from dotenv import load_dotenv 12 | 13 | # Load environment variables 14 | load_dotenv() 15 | 16 | # Load the GROQ and Google API keys 17 | groq_api_key = os.getenv('GROQ_API_KEY') 18 | os.environ["GOOGLE_API_KEY"] = os.getenv("GOOGLE_API_KEY") 19 | 20 | # Set page configuration 21 | st.set_page_config( 22 | page_title="RAG Query Model", 23 | page_icon="favicon.ico", 24 | layout="centered", 25 | ) 26 | 27 | # Custom CSS for styling 28 | st.markdown( 29 | """ 30 | 65 | """, 66 | unsafe_allow_html=True, 67 | ) 68 | 69 | # Display the title 70 | st.markdown("