This project is a conversational assistant that uses the Quran for answers, built using the Haystack library, FAISS document storage, and Uvicorn for FastAPI service. The assistant leverages embeddings to provide relevant answers from indexed content in response to user queries.
- Document Retrieval: Efficient retrieval of Quranic tafseer (I use Sarwar, as it's the most accurate according to my studies) through the FAISS document store.
- Questions and answers dataset: This dataset contains 1224 questions with answers from Quran, so If your question is in this dataset, answer will be more accurate.
- Embedding-Based Search: Uses embeddings to ensure contextually accurate responses to queries.
- Multiprocessing and FastAPI: Utilizes Uvicorn’s multiprocessing and asynchronous capabilities to handle concurrent requests.
To set up the project, follow these steps:
-
Clone this repository:
git clone https://github.com/your_username/ATLLM_chat_assistant.git
-
Install dependencies:
pip install -r requirements.txt
-
Make sure you have TensorFlow installed for embedding processing. In the future, I plan to upload a
.pkl
file to the cloud, but this is still under consideration:pip install tensorflow
api.py
- Main FastAPI application script.requirements.txt
- Contains the list of dependencies.data/
- Folder to store documents and FAISS indices.config/
- Configuration files for database and FAISS indexing.test.py
- For console-based testing.
- Run the Application:
Start the FastAPI server using Uvicorn:
uvicorn api:app --reload
- Run Streamlit:
streamlit run streamlit_app.py
- Access the API:
The server should be running at
http://127.0.0.1:8000
.
- Add Hadiths, not just Quranic content.
- Improve accuracy by refining responses, possibly through fine-tuning.
- Add visualizations or an interactive UI to enhance usability for users.
If you have any questions you can contact me via telegram