How jagratadeb/docchat works
DocChat is a Streamlit document-question-answering app. Users enter through Home, upload up to five PDF, TXT, or Markdown files in Chat, prepare them for local per-file search, ask a question, and see a grounded answer with available file/page references. The main runtime is concentrated in app_pages/chat.py and rag_pipeline.py; the graph separates its ingestion, indexing, retrieval, and generation stages. Architecture and Privacy & Security are user-facing informational pages. Pipeline details are based on the sampled source and README; unsampled styling and page internals are represented only at the supported module level.
Main entry points: chat.py Chat workspace · app.py Streamlit navigation · rag_pipeline.py Answer generation · styles.py Shared styling
Components 17
Navigation and pages
- Streamlit navigation
app.py - Home page
app_pages/home.py - Architecture page
app_pages/architecture.py - Privacy & Security
app_pages/security.py
Chat workflow
- Chat workspace
app_pages/chat.py - File ingestion
rag_pipeline.py - Visit session state
app_pages/chat.py - Answer references
app_pages/chat.py
Local retrieval
- Text chunking
rag_pipeline.py - Local embeddings
rag_pipeline.py - Per-file FAISS indexes
rag_pipeline.py - Per-file search
rag_pipeline.py
Answer generation
- Groq model setup
rag_pipeline.py - Groq chat model
- Answer generation
rag_pipeline.py
Presentation and guidance
- Shared styling
styles.py
Other components
- User
Connections 24
- User → Streamlit navigation: opens app
app.py - Streamlit navigation → Home page: routes to
app.py - Streamlit navigation → Chat workspace: routes to
app.py - Streamlit navigation → Architecture page: routes to
app.py - Streamlit navigation → Privacy & Security: routes to
app.py - Home page → Chat workspace: switches page
app_pages/home.py - User → Chat workspace: uploads and asks
app_pages/chat.py - Chat workspace → File ingestion: loads files
app_pages/chat.py - File ingestion → Text chunking: provides documents
rag_pipeline.py - Text chunking → Local embeddings: requests vectors
rag_pipeline.py - Text chunking → Per-file FAISS indexes: builds indexes
rag_pipeline.py - Chat workspace → Groq model setup: builds model
app_pages/chat.py - Chat workspace → Answer generation: submits question
app_pages/chat.py - Answer generation → Per-file search: retrieves context
rag_pipeline.py - Per-file search → Per-file FAISS indexes: searches each index
rag_pipeline.py - Answer generation → Groq chat model: invokes model
rag_pipeline.py - Groq model setup → Groq chat model: configures client
rag_pipeline.py - Answer generation → Chat workspace: returns answer and sources
app_pages/chat.py - Chat workspace → Visit session state: stores chat history
app_pages/chat.py - Chat workspace → Answer references: shows source parts
app_pages/chat.py - Chat workspace → Shared styling: applies styling
app_pages/chat.py - Home page → Shared styling: applies styling
app_pages/home.py - Architecture page → Shared styling: applies styling
app_pages/architecture.py - Privacy & Security → Shared styling: applies styling
app_pages/security.py