A simple and elegant Retrieval-Augmented Generation (RAG) web app built with Flask, FAISS, and Google Gemini.
It allows you to chat with a local knowledge base of Python documentation, cheatsheets, and curated open-source libraries — all retrieved using semantic search.
- Semantic Search using FAISS + sentence-transformers embeddings
- Context-aware Answers powered by Google Gemini (free-tier compatible)
- Python Knowledge Base built from Markdown docs and public datasets
- Lightweight Flask App with clean HTML + CSS frontend
- Local RAG System — no external vector DB needed
This RAG system is built using data from:
- Python Cheatsheet — general Python syntax, functions, modules, and usage examples.
- Hugging Face:
dylanhogg/awesome-python
Dataset — curated collection of Python projects and libraries with descriptions and metadata.
Both sources are used locally to create FAISS embeddings for semantic retrieval.
git clone <your-repo-url>
cd python-rag-chat
Highly recomended to use venv:
python -m venv .venv
source .venv/bin/activate # Linux / macOS
.venv\Scripts\activate # Windows
pip install -r requirements.txt
GOOGLE_API_KEY=your_free_tier_gemini_key_here
The free-tier Gemini API works perfectly for this project.
Run this once to generate embeddings from your Markdown and JSON data:
python build_rag_index.py
This will create a FAISS index inside embeddings/faiss_index/. Note : its included in the repository so its optional.
python app.py