How satish-shrestha-4u/generative-ai-ml-rag-scikitlearn-mentor works
ML Mentor is a Streamlit RAG chatbot for learning machine learning and scikit-learn. Users submit questions through the chat UI; the chat engine retrieves and reranks knowledge-base passages, then uses a Groq model to produce an answer and retrieved-source information for display. The engine builds or loads a persistent vector index from the local Markdown knowledge base and uses Hugging Face embeddings. The README documents explanations, examples, quizzes, and exam-style practice. Internal indexing stages are shown from the engine excerpt; storage is created at runtime. Connections to external model services follow the implementation’s configured providers.
Main entry points: engine.py RAG chat engine · streamlit_app.py Streamlit chat UI · model_loader.py Model initialization · config.py Runtime configuration
Components 15
Chat interface
- Streamlit chat UI
streamlit_app.py
Knowledge and retrieval
- ML knowledge base
data/ml_mentor_knowledge_base - Document ingestion
src/engine.py - Chunking and indexing
src/engine.py - Persistent vector index
src/engine.py - Passage retrieval
src/engine.py - Passage reranking
src/engine.py
Conversation runtime
- RAG chat engine
src/engine.py - Chat memory
src/engine.py
Model integrations
- Runtime configuration
src/config.py - Model initialization
src/model_loader.py - Groq LLM
- Hugging Face embeddings
- Cross-encoder reranker
Other components
- Learner
Connections 19
- Learner → Streamlit chat UI: asks question
streamlit_app.py - Streamlit chat UI → Model initialization: initializes models
streamlit_app.py - Streamlit chat UI → RAG chat engine: submits question
streamlit_app.py - Streamlit chat UI → Streamlit chat UI: displays answer and sources
streamlit_app.py - Model initialization → Runtime configuration: reads settings
src/model_loader.py - Model initialization → Groq LLM: initializes
src/model_loader.py - Model initialization → Hugging Face embeddings: initializes
src/model_loader.py - RAG chat engine → Runtime configuration: reads settings
src/engine.py - RAG chat engine → Persistent vector index: loads or builds
src/engine.py - Document ingestion → ML knowledge base: reads documents
src/engine.py - Document ingestion → Chunking and indexing: passes documents
src/engine.py - Chunking and indexing → Hugging Face embeddings: embeds chunks
src/engine.py - Chunking and indexing → Persistent vector index: persists index
src/engine.py - Persistent vector index → Passage retrieval: provides retriever
src/engine.py - RAG chat engine → Passage retrieval: retrieves passages
src/engine.py - RAG chat engine → Passage reranking: reranks passages
src/engine.py - Passage reranking → Cross-encoder reranker: uses model
src/engine.py - RAG chat engine → Chat memory: uses memory
src/engine.py - RAG chat engine → Groq LLM: generates response
src/engine.py