How reichenbch/rag-examples works
This repository demonstrates three RAG approaches for private-dataset question answering and parsing, plus a Gradio chat application for the LangChain/LlamaIndex/OpenAI approach. In the app, a user question is language-identified, used to construct a language-specific prompt, and passed to a retrieval QA chain backed by a persisted FAISS index and ChatGPT; the answer is returned to chat. The notebooks also document Meta’s original RAG, multilingual variants, and evaluation metrics. Notebook internals are not sampled, so those branches are shown only at the documented capability level.
Main entry points: gradio_app.py Chat interface · dataset.txt Private dataset · index.faiss Persisted FAISS index · LangChain LLamaIndex RAG.ipynb LlamaIndex LangChain RAG
Components 17
Gradio application
- Chat interface
gradio_app.py - Language identification
gradio_app.py - Language prompt
gradio_app.py - Chat history
gradio_app.py
Retrieval and generation
- Retrieval QA chain
gradio_app.py - FAISS retriever
gradio_app.py - Persisted FAISS index
faiss_doc_idx/index.faiss - OpenAI embeddings
gradio_app.py - ChatGPT generation
gradio_app.py
Notebook implementations
- Original Meta RAG
Meta Original RAG Model Implementation.ipynb - LlamaIndex LangChain RAG
LangChain LLamaIndex RAG.ipynb - LaBSE multilingual RAG
LaBSE + RAG - Multilingual Support.ipynb - WER and ROUGE metrics
LangChain LLamaIndex RAG.ipynb
Other components
- Questioner
- OpenAI service
- FastText model source
- Private dataset
dataset.txt
Connections 18
- Questioner → Chat interface: asks
README.md - Chat interface → Language identification: identifies language
gradio_app.py - Chat interface → Language prompt: builds prompt
gradio_app.py - Chat interface → Chat history: formats history
gradio_app.py - Chat interface → Retrieval QA chain: runs query
gradio_app.py - Retrieval QA chain → Language prompt: uses prompt
gradio_app.py - Retrieval QA chain → FAISS retriever: retrieves context
gradio_app.py - FAISS retriever → Persisted FAISS index: searches
gradio_app.py - Persisted FAISS index → OpenAI embeddings: loads with
gradio_app.py - Retrieval QA chain → ChatGPT generation: generates answer
gradio_app.py - ChatGPT generation → OpenAI service: calls
README.md - Language identification → FastText model source: downloads model
gradio_app.py - Retrieval QA chain → Chat interface: returns answer
gradio_app.py - Private dataset → Original Meta RAG: uses dataset
README.md - Private dataset → LlamaIndex LangChain RAG: uses dataset
README.md - Private dataset → LaBSE multilingual RAG: uses dataset
README.md - LlamaIndex LangChain RAG → WER and ROUGE metrics: reports metrics
README.md - LaBSE multilingual RAG → WER and ROUGE metrics: reports metrics
README.md