Spaces:
Sleeping
Sleeping
A newer version of the Streamlit SDK is available:
1.52.2
metadata
title: RAG System Demo
emoji: π€
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.28.1
app_file: app.py
pinned: false
π€ Enterprise RAG System Demo - Hugging Face Edition
A simplified, demonstration version of the Enterprise RAG System that uses Hugging Face models instead of OpenAI/Anthropic APIs. Perfect for showcasing RAG capabilities and deploying on Hugging Face Spaces for free!
π Live Demo
Try it on Hugging Face Spaces β
β¨ What This Demo Shows
This streamlined version demonstrates the complete RAG pipeline of the original Enterprise system:
π Complete RAG Workflow
- Document Upload & Processing - PDF, DOCX, TXT, CSV support
- Text Chunking & Embeddings - Smart text splitting with sentence-transformers
- Vector Search - ChromaDB for semantic similarity search
- AI-Powered Q&A - Hugging Face transformers for response generation
- Source Attribution - Shows which documents were used for answers
ποΈ Enterprise Features (Simplified)
- Multi-format Support - Same document types as the full system
- Hybrid Search - Semantic search with relevance scoring
- Real-time Chat Interface - Interactive Q&A with chat history
- Source Tracking - See which documents contributed to each answer
- Responsive UI - Clean, professional interface built with Streamlit
π§ Technical Architecture
Models Used (Hugging Face)
- Text Generation:
microsoft/DialoGPT-smallordistilgpt2(lightweight) - Embeddings:
sentence-transformers/all-MiniLM-L6-v2(384 dimensions) - Vector Store: ChromaDB (in-memory for demo)
Key Differences from Original
| Original Enterprise System | This Demo Version |
|---|---|
| OpenAI/Anthropic APIs | Hugging Face Transformers |
| PostgreSQL + Redis | In-memory storage |
| JWT Authentication | No authentication (demo) |
| Microservices Architecture | Single Streamlit app |
| Production deployment | Hugging Face Spaces |
π¦ Installation & Setup
Option 1: Run Locally
# Clone this demo
git clone <repo-url>
cd rag-demo-hf
# Install dependencies
pip install -r requirements.txt
# Run the app
streamlit run app.py
Option 2: Deploy on Hugging Face Spaces
- Create a new Space on Hugging Face
- Select Streamlit as the SDK
- Upload these files:
app.pyrequirements.txtREADME.md
- Your demo will be live at
https://huggingface.co/spaces/YOUR_USERNAME/SPACE_NAME
π― How to Use
1. Upload Documents
- Click "Upload Documents" in the sidebar
- Select PDF, DOCX, TXT, or CSV files
- Click "Process Documents" to add them to the knowledge base
2. Ask Questions
- Type your question in the chat input
- The system will:
- Search for relevant document chunks
- Generate an AI-powered response
- Show source documents used
3. Review Sources
- See relevance scores for each source
- Click on document excerpts to see the content used
- Source attribution shows which documents contributed to answers
π Performance & Capabilities
What Works Great
- β Document Processing - Handles multiple formats reliably
- β Semantic Search - Finds relevant content accurately
- β Source Attribution - Clear tracking of information sources
- β User Experience - Intuitive chat interface
Demo Limitations (vs. Full System)
- π Text Generation - Smaller models, shorter responses
- πΎ Memory - In-memory storage (resets on restart)
- π Security - No authentication or user management
- π Scale - Optimized for demonstration, not production
π Original vs Demo Comparison
Original Enterprise RAG System
- Purpose: Production-ready enterprise solution
- Models: OpenAI GPT-4, Anthropic Claude
- Infrastructure: PostgreSQL, Redis, Docker
- Features: Authentication, rate limiting, monitoring
- Deployment: Self-hosted or cloud production
This Demo Version
- Purpose: Showcase RAG capabilities and architecture
- Models: Open-source Hugging Face models
- Infrastructure: Streamlit + in-memory storage
- Features: Core RAG functionality only
- Deployment: Hugging Face Spaces (free)
π Key Demo Features
1. Real RAG Pipeline
Document Upload β Text Extraction β Chunking β Embeddings β Vector Store β Search β LLM Response
2. Interactive Experience
- Upload your own documents
- Ask domain-specific questions
- See exactly which sources were used
- Get contextual, relevant answers
3. Educational Value
- See RAG in action with your own data
- Understand the workflow from documents to answers
- Explore source attribution and relevance scoring
- Experience the full user journey
π― Perfect For
- π Learning RAG concepts - See how it works end-to-end
- πΌ Client demonstrations - Show RAG capabilities quickly
- π¬ Prototyping - Test ideas before building production systems
- π Education - Teach AI and NLP concepts interactively
π Related Projects
- Original Enterprise RAG System - Full production system
- Hugging Face Transformers - Model library used
- ChromaDB - Vector database
- Streamlit - Web framework
π License
MIT License - Feel free to use this demo for learning, presentations, or as a starting point for your own RAG systems!
π€ Built with Hugging Face β’ Powered by Open Source AI
This demo shows that you can build powerful RAG systems using entirely open-source components!