File size: 1,300 Bytes
c928117
 
5cf3acc
c928117
 
 
 
 
 
 
 
8ac52c9
 
 
c928117
 
8ac52c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26637e4
8ac52c9
 
 
 
 
 
 
 
 
 
 
 
 
c928117
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
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