Spaces:
Paused
Paused
Quick Start Guide β‘
Get your Graph RAG Chatbot running in 5 minutes!
Prerequisites
- Groq API Key (free at https://console.groq.com)
- One of: Docker, Python 3.8+, or Hugging Face account
π Fastest Way: Docker Compose (Recommended)
1. Get API Key
- Visit https://console.groq.com
- Sign up/Login
- Click "API Keys" β Create new API key
- Copy the key
2. Configure
cd /path/to/project
cp .env.example .env
# Edit .env and paste your API key:
# GROQ_API_KEY=your_actual_key_here
3. Launch
docker-compose up -d
4. Access
Open browser: http://localhost:7860
β Done! Your app is running.
Alternative: Local Python Setup
1. Create environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
2. Install dependencies
pip install -r requirements.txt
3. Set API key
export GROQ_API_KEY="your_api_key_here" # On Windows: set GROQ_API_KEY=...
4. Run app
python app.py
5. Access
Open: http://localhost:7860
Alternative: Hugging Face Spaces (No local setup!)
1. Create Space
- Go to https://huggingface.co/spaces
- Click "Create new Space"
- Select "Docker" SDK
- Fill in details β Create
2. Upload files
git clone https://huggingface.co/spaces/YOUR_USERNAME/graph-rag-chatbot
cd graph-rag-chatbot
cp /path/to/app.py .
cp /path/to/Dockerfile .
cp /path/to/requirements.txt .
cp -r /path/to/templates .
cp /path/to/.dockerignore .
git add -A
git commit -m "Initial upload"
git push
3. Add API key
In Space Settings β Repository secrets:
- Name:
GROQ_API_KEY - Value: your_api_key
β Done! App deploys automatically
Using the Application
Upload Documents
- Click the upload area (or drag & drop)
- Select PDF, CSV, or TXT file
- Watch the progress bar
- Status changes: queued β processing β ready
View Knowledge Graph
- Click "π View Full Graph" (appears when ready)
- Or go to "Knowledge Graph" tab
- Select document from dropdown
Chat with Your Document
- Select document from dropdown
- Type your question
- Click "Send" (or press Enter)
- Read the answer!
Test Files
Quick CSV Test
Create test.csv:
Name,Role,Salary
Alice,Engineer,120000
Bob,Manager,110000
Carol,Designer,100000
Upload it and try asking:
- "Who is the highest paid?"
- "How many employees?"
- "What roles are in the data?"
Troubleshooting
"GROQ_API_KEY not found"
# Linux/Mac
echo "GROQ_API_KEY=your_key" >> .env
# Windows
echo GROQ_API_KEY=your_key >> .env
Port 7860 in use?
# Find what's using it
lsof -i :7860 # Mac/Linux
netstat -ano | findstr :7860 # Windows
# Use different port
PORT=8000 python app.py
Docker build fails?
# Clean and rebuild
docker-compose down
docker system prune -a
docker-compose up -d
Model download slow?
The embedding model (~400MB) downloads once on first run. This is normal and can take 2-3 minutes. Subsequent runs are instant.
Common Commands
# View logs
docker-compose logs -f
# Stop app
docker-compose down
# Restart
docker-compose restart
# See what's running
docker-compose ps
# Check file storage
ls -la data/
Feature Overview
| Feature | Status | Notes |
|---|---|---|
| PDF Upload | β | Up to 50MB |
| CSV Upload | β | Auto-detected |
| TXT Upload | β | Plain text |
| Knowledge Graph | β | Auto-visualized |
| RAG Chat | β | Uses Groq Mixtral |
| Real-time Updates | β | Every 1.5s |
| Mobile UI | β | Responsive |
| Multi-document | β | Process in parallel |
| API Access | β | JSON endpoints |
API Quick Reference
# Upload file
curl -F "files=@document.pdf" http://localhost:7860/api/upload
# Get documents
curl http://localhost:7860/api/documents
# Query document
curl -X POST -H "Content-Type: application/json" \
-d '{"query":"What is...?","document":"doc.pdf"}' \
http://localhost:7860/api/query
# Delete document
curl -X DELETE http://localhost:7860/api/delete/doc.pdf
Next Steps
- β App running locally? Perfect!
- π€ Upload a test document
- π View the knowledge graph
- π¬ Try asking a question
- π Deploy to production (HF Spaces)
Need Help?
- Check
README.mdfor detailed docs - See
TESTING.mdfor test cases - Review
space_config.mdfor HF deployment - Check logs:
docker-compose logs -f
You're all set! π Start exploring!