Chat App

The command line works, but we want something closer to how a person would actually talk to the assistant. So we wrap it in a small web interface. We use Streamlit, a Python framework for building front ends with almost no code.

This isn't the final product, and it isn't meant to be pretty. I kept it deliberately simple so there's nothing to explain. If you want a nicer interface, hand it to a coding assistant like Claude Code or Codex. Ask it to improve the layout. For now, plain is fine.

Add Streamlit to your project:

uv add streamlit

Create app.py:

import streamlit as st
from assistant import create_assistant

assistant = create_assistant()

st.title("Course Assistant")

user_input = st.text_input("Enter your question:")

if st.button("Ask"):
    with st.spinner("Processing..."):
        answer = assistant.rag(user_input)
        st.success("Completed!")
        st.write(answer)

Run the app:

uv run streamlit run app.py

That's another long command, so it goes into the Makefile too:

chat:
	uv run streamlit run app.py

Now we can run:

make chat

If you're in GitHub Codespaces, it detects the port and forwards it for you. Open the link and you get a web interface. Ask a question like "How do I join the course?" and the answer comes back.

The RAG works, but right now we track nothing about it: no response time, no token usage, no cost. That's exactly the visibility monitoring is supposed to give us, so that's what we add next.

← Previous: Assistant · Next: Capturing Metrics →

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.