Skip to content

Repository files navigation

StreamHelp AI

StreamHelp AI is an educational Retrieval-Augmented Generation (RAG) chatbot that answers Netflix FAQ / customer-support questions using only a curated, source-cited knowledge base — it never relies on the LLM's general knowledge and never touches a real account.

This project was built as TP2 (academic assignment) by Mahamane Sani Adamou Mahamane.

What it does

  • Answers Netflix support questions (sign-in, passwords, profiles, billing, downloads, parental controls, devices, etc.) grounded strictly in a local FAQ dataset.
  • Retrieves the most relevant FAQ entries with a FAISS vector index before generating an answer, and returns the sources used.
  • Refuses to answer when the knowledge base doesn't have enough relevant information, instead pointing the user to the official Netflix Help Center.
  • Refuses unsafe/out-of-scope account actions (e.g. "log in for me", "change my payment card for me") rather than pretending to perform them.
  • Runs entirely in the terminal as a simple Q&A loop.

How it works

  1. Data validation & ingestion (prepare_data.py) — loads data/faq_data.csv (50+ Netflix FAQ entries scraped/curated from the official Netflix Help Center, covering categories like Getting Started, Account Management, Password and Sign-In, Billing and Payments, Profiles, Parental Controls, Downloads and Offline Viewing, Devices and Streaming, Membership and Cancellation, and Privacy and Security), validates required columns and HTTPS source URLs, deduplicates questions, and builds a local FAISS vector index using the sentence-transformers/all-MiniLM-L6-v2 embedding model.
  2. Retrieval + generation (chatbot.py) — for each user question, the top-4 nearest FAQ chunks are retrieved from the FAISS index. If the best match is too far (low relevance), the bot admits it doesn't know instead of guessing. Otherwise, the retrieved context is passed to a Groq-hosted LLM (llama-3.3-70b-versatile by default) through LangChain, constrained by a system prompt that forbids using outside knowledge, inventing prices/policies, or requesting sensitive information.
  3. Safety guardrails — a keyword-based pre-filter blocks requests that ask the assistant to perform real account actions (login, changing payment methods, changing passwords on the user's behalf) and returns a fixed refusal message instead of calling the LLM.

Tech stack

  • Python 3.11
  • LangChain (langchain, langchain-core, langchain-community, langchain-huggingface) for orchestration
  • Groq API (langchain-groq) for LLM inference (llama-3.3-70b-versatile)
  • FAISS (faiss-cpu) for vector similarity search
  • Sentence-Transformers (all-MiniLM-L6-v2) for local embeddings
  • pandas for dataset loading/validation
  • python-dotenv for API key configuration

Project structure

TP2_StreamHelp_AI/
├── chatbot.py              # RAG chatbot: retrieval, LLM prompt, safety filters, CLI loop
├── prepare_data.py         # Validates FAQ dataset and builds the FAISS vector index
├── data/
│   └── faq_data.csv        # Curated Netflix FAQ knowledge base (question, answer, source, category)
├── test_questions.csv      # Manual test set: direct, paraphrased, category, out-of-scope, unsafe-action, unknown
├── results/
│   └── final_test_transcript.txt  # Captured transcript of a full test run
├── screenshots/            # Screenshots of test scenarios (password reset, cancellation, refusals, etc.)
├── vector_store/           # Generated FAISS index (index.faiss, index.pkl) — regenerable, not required in submission
├── requirements.txt        # Python dependencies
├── .env.example            # Template for the required GROQ_API_KEY
└── Mahamane_Sani_Adamou_Mahamane_TP2_StreamHelp_AI_Report.pdf/docx  # Assignment report

Setup and running instructions

Requirements

  • Windows 11
  • Python 3.11
  • A Groq API key

1. Create and activate a virtual environment

py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1

2. Install dependencies

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

3. Configure your API key

Copy .env.example to .env and replace the placeholder with your real Groq API key:

GROQ_API_KEY=your_api_key_here
GROQ_MODEL=llama-3.3-70b-versatile

Never commit or share your .env file — it is excluded via .gitignore.

4. Build the local vector index

python prepare_data.py

On the first run, the local embedding model is downloaded, which may take a few minutes.

5. Start the chatbot

python chatbot.py

Ask a Netflix support question, or type exit to close.

Example

You: How can I reset my Netflix password?

StreamHelp AI: To reset your Netflix password, use the Netflix password recovery
page and request a reset by an available recovery method, such as email or text
message.

Sources:
- How to keep your account secure: https://help.netflix.com/en/node/13243
- How to update Netflix account information: https://help.netflix.com/en/node/244

Testing

test_questions.csv contains a manual test suite covering:

  • direct — straightforward FAQ questions
  • paraphrase — reworded versions of FAQ questions
  • category — broader category questions
  • out_of_scope — questions unrelated to Netflix (should be refused)
  • unsafe_action — requests to perform real account actions (should be refused)
  • unknown — questions the knowledge base cannot answer confidently

A full run transcript is saved in results/final_test_transcript.txt, and corresponding screenshots are in screenshots/.

Disclaimer

This is an educational project and is not affiliated with, endorsed by, or connected to Netflix. It cannot access, modify, or act on any real Netflix account. All answers are limited to the locally curated FAQ dataset.

About

RAG chatbot (FAISS + Groq + LangChain) answering Netflix support questions from a sourced FAQ knowledge base - academic project (TP2).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages