Custom Data Chatbot is a Streamlit-based RAG application for chatting with uploaded PDF course materials. It supports:
- PDF upload and indexing
- semantic chunking and FAISS retrieval
- document-grounded answers
- general-knowledge fallback when retrieval is weak
- short-term chat memory
- separate
Chat,Workspace, andSettingspages
The repository is structured to run locally and deploy on Streamlit Community Cloud.
##Streamlit App Link ------- https://furgan0101-chatbot-appstreamlit-app-wj0wva.streamlit.app/
custom-data-chatbot/
├── app/
│ ├── pages/
│ │ ├── 1_Workspace.py
│ │ └── 2_Settings.py
│ ├── streamlit_app.py
│ └── ui_shared.py
├── data/
│ └── docs/
├── src/
│ ├── chatbot.py
│ ├── chunking.py
│ ├── embed.py
│ ├── ingest.py
│ ├── rerank.py
│ ├── retrieve.py
│ ├── settings.py
│ └── utils.py
├── tests/
├── .streamlit/
│ └── secrets.toml
├── requirements.txt
├── .gitignore
└── README.md
- Create and activate a Python 3.11+ virtual environment.
- Install dependencies:
pip install -r requirements.txt- Add your OpenAI API key to
.streamlit/secrets.toml:
OPENAI_API_KEY = "your_api_key_here"- Start the app:
streamlit run app/streamlit_app.pyNon-secret runtime defaults can be adjusted in .env.example and copied into your shell environment if needed. The OpenAI API key should not be stored in .env; the app reads it from st.secrets["OPENAI_API_KEY"].
The Settings page lets you change provider, model, and RAG behavior during the current session.
- Push this repository to GitHub.
- In Streamlit Community Cloud, create a new app pointing to:
- repository: this repo
- main file path:
app/streamlit_app.py
- In the Streamlit Cloud app settings, add:
OPENAI_API_KEY = "your_api_key_here"- Deploy.
- The recommended cloud provider mode is
OpenAI. Ollamarequires a local Ollama service and is not available on Streamlit Community Cloud.- Uploaded PDFs are stored inside the app workspace at runtime. Re-deploys or container resets may clear runtime-generated files unless they are re-uploaded.
sentence-transformersdownloads model weights on first use, so the first indexing run may be slower.
python -m unittest tests.test_hybrid_chatbotThe app reads the OpenAI key through Streamlit secrets:
st.secrets["OPENAI_API_KEY"]

