An interactive Python coding tutor powered by local RAG (Retrieval-Augmented Generation).
Upload your own tutorials (PDF, TXT, or Markdown), and ask coding questions.
The app retrieves relevant snippets, feeds them to a language model, and returns clear, runnable Python code with inline comments.
- 📂 Reads and indexes local
.pdf,.txt, and.mdfiles. - 🔎 Fast and efficient semantic search with FAISS.
- 🧠 Uses HuggingFace embeddings (
all-mpnet-base-v2) for vectorization. - 🤖 LLM-powered tutor (supports LLaMA-2, Ollama, or OpenAI/Gemini).
- 🐍 Always returns complete runnable Python code with comments.
- 📚 Expandable source panel to see where answers come from.
- 🎨 Clean Streamlit UI with background customization.
git clone https://github.com/yourusername/ai-python-tutor.git
cd ai-python-tutor
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
streamlit run app.pyDataset folder → set in the sidebar.
Temperature → controls creativity (0.0 = precise, 1.0 = more creative).
Build/Rebuild Knowledge Base → (re)creates FAISS vector store.