How joswikkha/ml-docs-rag works
This is a Streamlit RAG product for asking questions about HuggingFace model cards and scikit-learn documentation, then comparing dense, hybrid, and reranked retrieval. Its main path is document ingestion and chunking, local vector indexing, question retrieval and Groq answer generation with sources. A separate benchmark path runs RAGAS scoring and performance measurements, writes results, and presents them in a dashboard. The README documents capabilities beyond the sampled excerpts; edges are limited to relationships directly shown there or in source references.
Main entry points: run_benchmark.py Benchmark runner · rag_chain.py RAG answer chain · retrievers.py Retrieval strategies · processed Processed chunks
Components 16
Corpus preparation
- Fetch and chunk
src/ingest.py - Processed chunks
data/processed - Local embeddings
src/vectorstore.py - Chroma index
data/chroma_db
Question answering
- Retrieval strategies
src/retrievers.py - RAG answer chain
src/rag_chain.py
Benchmarking
- Benchmark runner
src/run_benchmark.py - RAGAS evaluation
src/evaluate.py - Evaluation questions
data/eval/eval_dataset.json - Benchmark results
results/benchmark_results.csv
Streamlit interface
- QA chat page
pages/QA_Chat.py - Results dashboard
pages/Benchmark_Dashboard.py
Other components
- Documentation user
- HuggingFace Hub
- scikit-learn docs
- Groq generator
Connections 17
- HuggingFace Hub → Fetch and chunk: fetches cards
src/ingest.py - scikit-learn docs → Fetch and chunk: scrapes docs
src/ingest.py - Fetch and chunk → Processed chunks: saves chunks
src/ingest.py - Processed chunks → Local embeddings: loads chunks
src/vectorstore.py - Local embeddings → Chroma index: builds index
src/vectorstore.py - Retrieval strategies → Chroma index: dense search
src/retrievers.py - Processed chunks → Retrieval strategies: loads BM25 text
src/retrievers.py - Documentation user → QA chat page: asks question
pages/QA_Chat.py - QA chat page → RAG answer chain: invokes chain
pages/QA_Chat.py - RAG answer chain → Retrieval strategies: retrieves context
src/rag_chain.py - RAG answer chain → Groq generator: generates answer
src/rag_chain.py - Benchmark runner → Retrieval strategies: selects strategy
src/run_benchmark.py - Benchmark runner → RAG answer chain: builds chain
src/run_benchmark.py - Benchmark runner → RAGAS evaluation: scores answers
src/run_benchmark.py - RAGAS evaluation → Evaluation questions: loads questions
src/evaluate.py - Benchmark runner → Benchmark results: writes results
src/run_benchmark.py - Results dashboard → Benchmark results: reads results
pages/Benchmark_Dashboard.py