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:
Step 2: Create the Application File
Inside your project directory, create a new file named 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 will automatically open a tab in your default browser at localhost:8501 .
Upload your lecture notes, click Generate Study Guide, and watch the application process your document in real time.
💡 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
Loading article