A newer version of the Gradio SDK is available:
6.5.1
metadata
title: RAG Chatbot — GPT-5.1 + URLs / Files / Text
emoji: 🧠
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
short_description: GPT-5.1 RAG chatbot for URLs, files, and text sources
🔍 RAG Chatbot — GPT-5.1 + URLs / Files / Text
A universal Retrieval-Augmented Generation (RAG) chatbot powered by OpenAI GPT-5.1 and Gradio 5.49.1, enabling users to inject their own knowledge in real time — via URLs, uploaded files, or raw text blocks — and query it conversationally.
🚀 Features
- OpenAI API key input stored per session (no backend storage)
- GPT-5.1 model for chat; text-embedding-3-large for vector retrieval
- Accepts:
- Live URLs (auto-fetched text)
- Uploaded files (
.txt,.md,.csv,.json) - Custom text areas for notes or raw data
- Interactive presets that auto-fill working examples (ZEN sites, policy QA, etc.)
- Retrieval debugging info displayed transparently for testing relevance
- No external DB — fully in-memory RAG layer for portability
- Works in Hugging Face Space, Google Colab, or local Python
🧩 How It Works
- Enter your OpenAI API key and click Save.
- Add knowledge sources (URLs, uploads, or text).
- Click Build / Refresh Knowledge Base.
- Text is chunked → embedded via
text-embedding-3-large. - Stored in memory as a lightweight vector index.
- Text is chunked → embedded via
- Ask questions — the system retrieves relevant chunks and constrains GPT-5.1 to answer only from those and your system instructions.