- Frontend: Streamlit (Python)
- Styling: Tailwind CSS injected via
st.markdown(unsafe_allow_html=True) - LLM: Google Gemini 1.5 Flash (via
google-generativeai)
-
Agent Router Logic: - Function:
classify_intent(query)- Categories: [VERSE_LOOKUP, SCHOLARLY_RESEARCH, PDF_ANALYSIS]
-
Web Search Tool: - API: Tavily (use
tavily-python)- Purpose: Fetching historical context and modern scholarly fatwas.
-
Audio Engine:
- API: AlQuran.cloud (Endpoint:
https://api.alquran.cloud/v1/juz/{juz}/ar.alafasy) - Translation Sync: Fetch
ur.jalandhryfor Urdu anden.asadfor English.
- API: AlQuran.cloud (Endpoint:
-
RAG (Document Analysis):
- Libraries:
PyPDF2for parsing,FAISSfor vector storage. - Flow: Extract PDF text -> Create chunks -> Embed using Gemini -> Query when intent is PDF_ANALYSIS.
- Libraries:
-
State Management:
- Use
st.session_stateto track current Juz, playback time, and chat history.
- Use