RAG / README.md
francismurray's picture
change emoji
5cf3acc

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
title: RAG
emoji: πŸ”
colorFrom: yellow
colorTo: green
sdk: gradio
sdk_version: 5.30.0
app_file: app.py
pinned: false
license: mit
short_description: Retrieval-Augmented Generation (RAG)
models:
  - bert-base-uncased
  - google/flan-t5-base

πŸ“„πŸ” Retrieval-Augmented Generation (RAG) Demo

A simple yet powerful RAG application that lets you upload documents and ask questions about them.

Features

  • πŸ“„ Upload multiple .txt files
  • πŸ” Automatic document processing and indexing
  • πŸ’‘ Query your documents using natural language
  • πŸ€– Get AI-generated answers based on your content

How It Works

  1. Upload - Add your text files to the system
  2. Index - Documents are embedded using bert-base-uncased
  3. Query - Ask a question about the documents
  4. Retrieve - The system finds the most relevant content using cosine similarity
  5. Generate - flan-t5-base creates a natural language answer

Technical Details

  • Built with Hugging Face's Transformers
  • Uses cosine similarity for matching
  • No GPU required (ZeroGPU compatible)
  • Runs completely in-memory

Usage

Simply upload your text files, ask a question, and get an answer within seconds!

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference