How lynkvu2901/rag-bank-chatbot works
This is a Vietnamese Vietcombank FAQ RAG chatbot. A user submits a question in the Streamlit interface; generation applies privacy and investment guardrails, retrieves and reranks FAQ evidence, rejects low-similarity matches, then asks Claude to draft an answer with cited sources. The repository also includes FAQ scraping and chunk/index preparation, plus retrieval and generation evaluation. The README documents these capabilities; some underlying modules and generated processed files are absent from the supplied tree, so their wiring is shown only where documentation supports it.
Main entry points: generation.py Answer generation · hybrid_search.py Hybrid retrieval · evaluate.py Pipeline evaluation · app.py Streamlit chat
Components 16
Chat experience
- Streamlit chat
app.py
Answer pipeline
- Input guardrails
src/generation.py - Hybrid retrieval
src/hybrid_search.py - Vector retrieval
src/retrieval.py - Cross-encoder rerank
src/reranking.py - Similarity filter
src/generation.py - Answer generation
src/generation.py
FAQ knowledge
- FAQ scraper
scrape_vcb_faq.py - Raw FAQ data
data/raw/vcb_faq.json - FAQ chunking
src/chunking.py - Embedding encoder
src/embedding.py - FAISS index
src/vector_store.py
Evaluation
- Pipeline evaluation
src/evaluate.py
Other components
- Questioner
- Claude API
- VCB FAQ site
Connections 19
- Questioner → Streamlit chat: asks
- Streamlit chat → Answer generation: calls answer
- Answer generation → Input guardrails: checks input
- Answer generation → Hybrid retrieval: retrieves candidates
- Hybrid retrieval → Vector retrieval: uses index
- Vector retrieval → FAISS index: loads index
- Hybrid retrieval → Cross-encoder rerank: reranks candidates
- Answer generation → Similarity filter: checks score
- Answer generation → Claude API: requests completion
- Claude API → Answer generation: returns answer
- Answer generation → Streamlit chat: returns answer and sources
- VCB FAQ site → FAQ scraper: provides FAQ
- FAQ scraper → Raw FAQ data: writes FAQ data
- Raw FAQ data → FAQ chunking: supplies FAQs
- FAQ chunking → Embedding encoder: supplies chunks
- Embedding encoder → FAISS index: builds vectors
- Pipeline evaluation → Hybrid retrieval: measures retrieval
- Pipeline evaluation → Answer generation: evaluates answers
- Pipeline evaluation → Claude API: uses judge