How sarathy-10/ai_industial_chatbot works
This is a document-grounded industrial chatbot with two principal stages: offline PDF indexing and online question answering. Users ask through the Streamlit interface (or the documented CLI); the RAG layer retrieves relevant chunks, generates a grounded answer, and returns source metadata for display. The README documents these capabilities; the sampled source shows the indexing implementation and portions of the UI and RAG flow. Some internal details are unsampled, so the graph avoids asserting their call relationships.
Main entry points: rag.py RAG Coordinator · build_index.py Embedding & Index Build · app.py Streamlit Chat UI · index.faiss FAISS Index
Components 17
Knowledge Indexing
- Indexing Orchestrator
build_index.py - PDF Extraction
build_index.py - Cleaning & Chunking
build_index.py - Embedding & Index Build
build_index.py - Sentence Transformer
Question Answering
- RAG Coordinator
rag.py - Question Embedding
rag.py - Top-K Retrieval
rag.py - Grounded Prompt
rag.py - Qwen Language Model
- Answer & Sources
rag.py
Chat Interfaces
- Streamlit Chat UI
app.py - CLI Chat
rag.py
Search Artifacts
- FAISS Index
index.faiss - Chunk Metadata
metadata.json
Other components
- Industrial PDFs
- Questioner
Connections 20
- Industrial PDFs → PDF Extraction: provides PDFs
README.md - Indexing Orchestrator → PDF Extraction: loads pages
build_index.py - PDF Extraction → Cleaning & Chunking: passes page text
build_index.py - Indexing Orchestrator → Embedding & Index Build: builds index
build_index.py - Embedding & Index Build → Sentence Transformer: encodes chunks
build_index.py - Embedding & Index Build → FAISS Index: writes vectors
build_index.py - Embedding & Index Build → Chunk Metadata: writes records
build_index.py - Questioner → Streamlit Chat UI: asks question
README.md - Streamlit Chat UI → RAG Coordinator: calls ask
app.py - Questioner → CLI Chat: enters question
README.md - CLI Chat → RAG Coordinator: runs chatbot
README.md - RAG Coordinator → Question Embedding: retrieves question
rag.py - Question Embedding → Sentence Transformer: encodes question
rag.py - RAG Coordinator → Top-K Retrieval: retrieves chunks
rag.py - Top-K Retrieval → FAISS Index: searches index
rag.py - Top-K Retrieval → Chunk Metadata: reads records
rag.py - RAG Coordinator → Grounded Prompt: builds context
rag.py - Grounded Prompt → Qwen Language Model: generates answer
rag.py - RAG Coordinator → Answer & Sources: returns answer and sources
rag.py - Answer & Sources → Streamlit Chat UI: displays answer and sources
README.md