How gokulkrisnaa-n/resume-content-retriever-chatbot works
This is a Flask-based knowledge-retrieval chatbot whose main workflow answers questions about a supplied knowledge document. At startup, it loads and chunks the document, builds a FAISS index, and configures Gemini generation. Each chat request passes through rate limiting, input checks, and semantic relevance gating before generation; output is scrubbed before returning to the user. The README also describes threshold calibration and logging of blocked requests. The runtime flow is supported by the sampled source; Azure hosting is documented, but deployment wiring is not shown.
Main entry points: app.py Chat route · config.py Defense settings · calibrate.py Threshold calibration · guard.py Relevance gate
Components 18
Knowledge indexing
- Knowledge document
knowledge.txt - Index builder
app.py - Chunking
app.py - Gemini embeddings
- FAISS index
app.py
Request defenses
- Rate limiting
app.py - Input guard
guard.py - Relevance gate
guard.py - Defense settings
config.py - Output scrub
guard.py
Answering
- Chat interface
app.py - Chat route
app.py - Prompt and chain
app.py - Gemini generation
- Chat response
app.py
Tuning and monitoring
- Threshold calibration
calibrate.py - Block logging
guard.py
Other components
- Chat user
Connections 22
- Chat user → Chat interface: asks question
app.py - Chat interface → Chat route: posts question
app.py - Knowledge document → Index builder: loads text
app.py - Index builder → Chunking: splits documents
app.py - Chunking → Gemini embeddings: embeds chunks
app.py - Index builder → FAISS index: builds index
app.py - Chat route → Rate limiting: checks limit
app.py - Chat route → Input guard: scans input
app.py - Input guard → Defense settings: reads patterns
guard.py - Chat route → Relevance gate: checks relevance
app.py - Relevance gate → FAISS index: searches chunks
guard.py - Relevance gate → Defense settings: reads threshold
guard.py - Chat route → Prompt and chain: invokes with context
app.py - Prompt and chain → Gemini generation: generates answer
app.py - Chat route → Output scrub: scrubs answer
app.py - Output scrub → Defense settings: reads refusal text
guard.py - Chat route → Chat response: returns answer
app.py - Chat route → Block logging: logs blocked request
app.py - Block logging → Defense settings: uses refusal settings
guard.py - Threshold calibration → Knowledge document: loads content
calibrate.py - Threshold calibration → FAISS index: measures distances
calibrate.py - Threshold calibration → Defense settings: tunes threshold