Milestone 4: Streamlit Deployment#

1. Deliverable Description#

In this milestone, your team will take the Retrieval-Augmented Generation (RAG) pipeline built in Milestone 3 and deploy it on Streamlit Community Cloud. This milestone demonstrates your ability to operationalize your AI application, manage environment variables securely, and ensure reproducibility and accessibility through a web deployment.

Deliverables:

  1. Deployed Streamlit App – A working web app hosted on Streamlit Community Cloud (free tier). See example here

  2. GitHub Repository – Contains all code, environment files, and documentation. See example here

  3. README.md – A well-structured document describing your app, setup, secrets configuration, and deployment process (see example: Quan’s RAG Demo Repo).

  4. Reproducibility Checklist – Completed and included as CHECKLIST.md in your repo.

Due date:

  • All deliverables due Nov 20, 2025 (or as specified by your instructor).

2. Deployment Requirements#

Your app must:

  • Be deployed on Streamlit Community Cloud following the official deployment instructions.

  • Be hosted from a public GitHub repository.

  • Have a working Streamlit entrypoint (typically app.py).

  • Successfully run end-to-end using your RAG pipeline and MongoDB Atlas database.

  • Use Streamlit Secrets to securely store API keys and connection URIs (no hard-coded credentials).

  • Contain a valid requirements.txt or environment.yml file listing all dependencies.

Your Streamlit app must:

  • Include a clean interface for user input queries.

  • Retrieve and generate responses through your RAG pipeline.

  • Display the generated output and the retrieved context (documents, metadata, or similarity scores).

  • Include visible section titles and expanders for clarity (e.g., “Retrieved Context”, “Final Answer”, “Trace Log”).

3. Deployment Process Overview#

Follow these steps for successful deployment:

  1. Prepare your GitHub repository

    • Include app.py, all necessary source files (e.g., src/, prompts/), and your environment file (requirements.txt or environment.yml).

    • Ensure your app runs locally with streamlit run app.py.

  2. Push your code to GitHub

    • The repository must be public or shared with your instructor.

  3. Deploy on Streamlit Community Cloud

    • Go to Streamlit Community Cloud.

    • Click Create App → choose your repository, branch (main), and entrypoint file (app.py).

    • Under Advanced Settings → Secrets, paste the content of your secrets.toml file (without actual keys in your repo).

    • Click Deploy and wait for the build to complete.

  4. Verify your deployment

    • Visit your app URL (e.g., https://yourteam-ragapp.streamlit.app).

    • Ensure it runs end-to-end without errors.

    • Include this link in your README.md under “Live App”.

4. README.md Structure#

Your README.md file serves as both documentation and a reproduction guide. It should follow the example format used here: quan3010/rag_test

5. Reproducibility Checklist#

Copy the following checklist into your CHECKLIST.md file and mark items as completed.

1. Repository & Structure#

  • [ ] Public repository accessible to instructors.

  • [ ] Organized folder structure (src/, prompts/, data/, app.py).

  • [ ] Includes environment file (requirements.txt or environment.yml).

  • [ ] README.md includes overview, setup, and Streamlit app link.

2. Environment & Dependencies#

  • [ ] Dependencies are fully listed and version-pinned.

  • [ ] Installation tested on a clean environment.

  • [ ] Streamlit app runs locally via streamlit run app.py.

  • [ ] No redundant or unused libraries included.

3. Secrets Management#

  • [ ] All secrets added via Streamlit → Advanced Settings → Secrets.

  • [ ] App successfully reads credentials through st.secrets[...].

4. Functionality#

  • [ ] Full RAG pipeline runs (retrieval → generation → display).

  • [ ] MongoDB Atlas connection confirmed.

  • [ ] UI allows input and displays both context and answer.

  • [ ] Deployed app accessible and fully functional.

5. Documentation#

  • [ ] README.md includes deployment process and reproducibility instructions.

  • [ ] CHECKLIST.md completed and submitted.

  • [ ] Optional: Screenshots or demo GIF added to README.md.

6. Final Validation#

  • [ ] Instructor can clone repo and deploy app without additional setup.

  • [ ] Streamlit Cloud app runs without error.

  • [ ] All API keys and retrievals work correctly.

6. Submission Instructions#

  1. Submit through Moodle:

    • GitHub repository link

    • Streamlit Community Cloud URL

    • Completed CHECKLIST.md

  2. Ensure your app is live and accessible at the time of submission.