AWS Builder Center
Building a Campus Study Assistant with Amazon Bedrock (Part 3: Interactive Web UI with Streamlit & File Uploads)

Building a Campus Study Assistant with Amazon Bedrock (Part 3: Interactive Web UI with Streamlit & File Uploads)

Build a Streamlit web app for Amazon Bedrock. Drag and drop PDF and Word coursework in your browser to generate AI-powered complete study guides.

Series: Building a Campus Study Assistant with Amazon Bedrock (3 articles)

  1. 3
    Building a Campus Study Assistant with Amazon Bedrock (Part 3: Interactive Web UI with Streamlit & File Uploads) This article
In Part 1, we set up our AWS environment and verified our connection to Amazon Bedrock. In Part 2, we built a Python script to extract raw text from both  .pdf  and  .docx  coursework files locally.
In Part 3, we will turn that terminal script into an interactive web application. Instead of opening VS Code and manually editing file paths, you will be able to upload files directly in your browser and view structured study guides instantly.

Step 1: Install Streamlit

Streamlit is a Python framework that lets you build clean web interfaces for data and AI applications without writing HTML, CSS, or JavaScript.
Run this command in your terminal:
pip install streamlit

Step 2: Create the Application File

Inside your project directory, create a new file named  app.py :
touch app.py

Step 3: Understand the Streamlit Flow & Code

The Streamlit interface handles document upload, text parsing, and API calls through a simple event-driven pipeline:



Upload File ( st.file_uploader ) └── Drop .pdf or .docx coursework files into the browser.

Trigger Pipeline ( st.button ("Generate Study Guide")) └── User clicks the button to initiate local parsing.

Show Progress Indicator ( st.spinner ) └── Runs  extract_text_from_file()  locally, then passes text to analyze_with_bedrock() .

Render Output ( st.markdown ) └── Renders the AI-generated study guide cleanly on screen.

The full backend code, prompt integration, and Streamlit component logic are available in the open-source [GitHub Repository] linked at the bottom of this series.

Step 4: Run the Application

Launch the local web server by running:
streamlit run app.py
Streamlit will automatically open a tab in your default browser at  localhost:8501 . 
Streamlit landing page

Upload your lecture notes, click Generate Study Guide, and watch the application process your document in real time.
Rendered Study Guide on the Streamlit interface


💡 Challenge & Solution: From Single-File to Multi file acceptance

·         The Challenge: Streamlit’s default uploader only allowed one document at a time. Processing multiple files individually generated fragmented summaries and triggered separate AWS calls, driving up latency and API costs.
·         The Solution: We set “accept_multiple_files=True” in Streamlit and modified our backend to combine all document text locally before calling Amazon Bedrock.
·         The Result: Claude Haiku receives the full coursework context in a single API call, generating one cohesive Master Study Guide while keeping latency and AWS costs minimal.

What We Built

With this web application running on your machine, you can drag and drop entire semesters of lecture slides, syllabi, or reading notes to get concise summaries, key definitions, and exam prep questions within seconds—all powered by Amazon Bedrock and Claude Haiku.
🔗 Relevant Resources & Further Reading

Series: Building a Campus Study Assistant with Amazon Bedrock (3 articles)

  1. 3
    Building a Campus Study Assistant with Amazon Bedrock (Part 3: Interactive Web UI with Streamlit & File Uploads) This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article