Project setup and architecture review
Five minutes of planning saves five hours of refactoring. We sketch first, code second.
Before building a kitchen, you draw it. Before building a RAG app, you sketch the pipeline.
The architecture (drawn in Module 7.5):
PDFs -> text -> chunks -> embeddings -> ChromaDB
|
user question -> embed -> top-K -> prompt with chunks -> LLM -> answer + citations
Decisions to lock in upfront:
- Embedding model:
text-embedding-3-small(cheap, capable) - LLM:
gpt-4o-mini(cheap, capable) - Vector DB: ChromaDB (local, persistent)
- UI: Streamlit
- Citations: include source filename and page number
Project structure:
pdf-chatbot/
app.py # Streamlit UI
rag.py # ingest + retrieve helpers
prompts.py # system prompt + answer template
data/ # uploaded PDFs (gitignored)
chroma_db/ # vector store (gitignored)
requirements.txt
.env # API keys (gitignored)
.gitignore
README.md
Quick recall
3 prompts · think before you flip
Prompt 1 of 3
Why split UI from RAG logic?
Quiz time
1 question · tap an answer to check it
1. The vector DB folder should be
Finished lesson 9.1?
Mark complete to update your module progress and unlock the streak.
Loading