PROJECT_FILE // 2026
Sameer.AI
A hybrid-RAG portfolio chatbot with a real security layer
OVERVIEW
A conversational interface over my own résumé. Rather than sending every question to an LLM, it tries the cheapest path that can answer correctly: an exact-match FAQ cache first, then semantic retrieval over a FAISS index, and only then a generation call. Every request passes through a guard layer before it reaches the model, and every answer passes through one on the way out.
REQUEST FLOW
- Question in
- Validation — length, encoding, shape
- Prompt guard — injection detection
- Code guard — malicious request detection
- PostgreSQL FAQ cache — exact and trigram match
- FAISS retrieval — Titan embeddings, top-k chunks
- Amazon Bedrock — grounded generation over retrieved context only
- Output guard — sanitisation
- Markdown answer + cited sources out
WHAT MAKES IT INTERESTING
Two-tier retrieval keeps cost near zero
Common questions resolve straight from the PostgreSQL FAQ cache without ever touching an LLM. Only novel questions pay for embedding and generation. The system degrades gracefully: if the database is unreachable, requests fall through to the RAG path instead of failing.
Grounded strictly in the corpus
The system prompt forbids outside knowledge and requires an exact refusal string when retrieved context is insufficient. This is the difference between a chatbot that represents me accurately and one that invents a job I never had.
Adversarial input is handled, not assumed away
A dedicated security package screens for prompt injection, malicious code requests and unsafe output, with a per-request budget guard on top. Most portfolio RAG demos skip this entirely.
Markdown knowledge base as the source of truth
The corpus is plain markdown, chunked by heading. Updating my résumé means editing a markdown file and rebuilding the index — no re-training, no manual data entry.