--- title: RAG Pedagogical Demo emoji: 🎓 colorFrom: blue colorTo: purple sdk: gradio sdk_version: 4.44.0 app_file: app.py pinned: false license: mit --- # 🎓 RAG Pedagogical Demo An interactive educational application to learn about Retrieval Augmented Generation (RAG) systems. ## What is RAG? Retrieval Augmented Generation (RAG) combines information retrieval with language generation to create more accurate and grounded AI responses. Instead of relying solely on a language model's training data, RAG systems: 1. **Retrieve** relevant information from a document corpus 2. **Augment** the query with this retrieved context 3. **Generate** an answer based on both the query and the retrieved information ## Features - 📚 **Upload your own PDFs** or use the default corpus - 🔧 **Configure retrieval parameters**: embedding models, chunk size, top-k, similarity threshold - 🤖 **Configure generation parameters**: LLM selection, temperature, max tokens - 📊 **Visualize the process**: see retrieved chunks, similarity scores, and prompts - 🌍 **Bilingual interface**: English and French ## How to Use 1. **Corpus Tab**: Upload a PDF or use the default corpus about RAG 2. **Retrieval Tab**: Choose embedding model and retrieval parameters 3. **Generation Tab**: Select language model and generation settings 4. **Query Tab**: Ask questions and see how RAG works! ## Educational Value This demo helps you understand: - How documents are processed and chunked - How semantic search retrieves relevant information - How context is provided to language models - How different parameters affect the results Perfect for students, educators, and anyone curious about modern AI systems! ## Technology - **Framework**: Gradio - **Embeddings**: Sentence Transformers - **Vector Store**: FAISS - **LLMs**: HuggingFace Inference API - **Infrastructure**: HuggingFace ZeroGPU --- *Note: This application runs on ZeroGPU. Initial requests may take longer as models are loaded.*