How palliplease/rag-document-assistant works
This is a local RAG assistant for answering questions about a college handbook. The documented workflow loads a PDF, splits it into chunks, and indexes them in Chroma; the Streamlit app then sends a question through a retrieval-and-generation chain and displays the answer. The chain retrieves relevant chunks, formats them as context, prompts a local Ollama model, and parses its response. The PDF itself is not present in the tree, so its source is represented by the ingestion code. The README also mentions a RAG chain and local operation; details below follow the sampled source.
Main entry points: chat.py QA chain setup · app.py Streamlit app · ingest.py Vector indexing · vectordb Chroma store
Components 16
Ingestion
- Ingest runner
ingest.py - PDF loading
ingest.py - Text splitting
ingest.py - Vector indexing
ingest.py - Ollama embeddings
ingest.py
Question answering
- Chroma store
vectordb - QA chain setup
chat.py - Similarity retriever
chat.py - Context formatter
chat.py - Prompt template
chat.py - Ollama LLM
chat.py - String parser
chat.py
User interface
- Streamlit app
app.py
Other components
- Student
- Handbook PDF
- Ollama runtime
Connections 21
- Ingest runner → PDF loading: calls
- PDF loading → Handbook PDF: loads
- Ingest runner → Text splitting: calls
- PDF loading → Text splitting: passes pages
- Ingest runner → Vector indexing: calls
- Text splitting → Vector indexing: passes chunks
- Vector indexing → Ollama embeddings: requests vectors
- Ollama embeddings → Ollama runtime: embeds with
- Vector indexing → Chroma store: writes vectors
- Student → Streamlit app: asks
- Streamlit app → QA chain setup: builds chain
- Streamlit app → Similarity retriever: receives reference
- Streamlit app → QA chain setup: invokes chain
- QA chain setup → Similarity retriever: dispatches query
- Similarity retriever → Chroma store: reads matches
- QA chain setup → Context formatter: formats retrieved docs
- QA chain setup → Prompt template: fills template
- QA chain setup → Ollama LLM: sends prompt
- Ollama LLM → Ollama runtime: runs model
- QA chain setup → String parser: parses output
- String parser → Streamlit app: returns answer