Spaces:
Running
Running
A newer version of the Gradio SDK is available: 6.14.0
metadata
title: RAG Chatbot Demo
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 6.13.0
python_version: '3.10'
app_file: app.py
pinned: false
Demo RAG Chatbot
A Python demo chatbot that:
- loads configuration from environment variables or
config.yaml - scrapes the configured website
- builds embeddings using HuggingFace models
- retrieves relevant chunks (RAG)
- generates answers using SambaNova API
- returns formatted text output with citations
Setup
Install dependencies:
pip install -r requirements.txtConfigure environment variables:
SAMBANOVA_API_KEY: your SambaNova API keyWEBSITE: the URL to scrapeEMBEDDING_MODEL: HuggingFace model (default:sentence-transformers/all-MiniLM-L6-v2)SYSTEM_PROMPT: optional behavior prompt
Or create
config.yamlwith these keys.
Run CLI Mode
python chatbot.py
Type a question and press Enter. Type exit to quit.
Run with Gradio UI
python app.py
Interactive web interface with real-time answers and citations display.
Hugging Face Spaces
For deployment on Hugging Face Spaces:
Set the following secrets in your Space settings:
SAMBANOVA_API_KEYWEBSITEEMBEDDING_MODEL(optional)SYSTEM_PROMPT(optional)
The app will automatically use these environment variables.