# Demo Scripts - Quick Reference
## ๐ Quick Start
```bash
./ask.sh # Conversational mode (recommended)
./ask.sh --simple # Simple mode (no memory)
```
---
## ๐ Available Demo Scripts
### 1. **conversational_demo.py** - WITH Memory ๐ฌ (RECOMMENDED)
**Best for:** Natural conversations, follow-up questions
```bash
python scripts/conversational_demo.py
```
**Features:**
- โ
Remembers conversation history
- โ
Handles "it", "them", "that one" references
- โ
Perfect for drilling down on topics
- โ
Commands: `history`, `clear`, `help`, `stats`
**Example:**
```
You: What OLED TVs are available?
AI: We have OLED in sizes 42", 48", 55"...
You: Which is cheapest? โ "Which" refers to OLED TVs
AI: The 42" model at $899.99
You: How many in stock? โ "How many" refers to 42" OLED
AI: 201 units across 3 warehouses
```
---
### 2. **interactive_demo.py** - No Memory
**Best for:** Exploring different unrelated topics
```bash
python scripts/interactive_demo.py
# Or single question:
python scripts/interactive_demo.py --query "What OLED TVs are available?"
```
**Features:**
- โ
Fast and simple
- โ
Each question is independent
- โ
Commands: `help`, `stats`
- โ No conversation memory
---
### 3. **run_demo.py** - Basic Demo
**Best for:** Testing the system
```bash
python scripts/run_demo.py
```
**Features:**
- โ
Runs 2 predefined queries
- โ
Shows retrieval process
- โ No interactivity
---
## ๐ฎ Commands (in interactive/conversational modes)
| Command | Conversational | Interactive | Description |
|---------|---------------|-------------|-------------|
| `help` | โ
| โ
| Show example questions |
| `stats` | โ
| โ
| System statistics |
| `history` | โ
| โ | Show conversation history |
| `clear` | โ
| โ | Clear conversation memory |
| `exit`, `quit` | โ
| โ
| Exit the program |
---
## ๐ Comparison
| Feature | Conversational | Interactive | Basic |
|---------|---------------|-------------|-------|
| **Conversation Memory** | โ
| โ | โ |
| **Follow-up Questions** | โ
| โ | โ |
| **Multiple Questions** | โ
| โ
| โ (only 2) |
| **Custom Questions** | โ
| โ
| โ |
| **Conversation History** | โ
| โ | โ |
| **Speed** | Medium | Fast | Fast |
| **Best For** | Conversations | Exploration | Testing |
---
## ๐ก Which One Should I Use?
### Use **Conversational Mode** when:
- โ
Asking follow-up questions
- โ
Having a conversation about a topic
- โ
Drilling down into details
- โ
Want natural back-and-forth
### Use **Interactive Mode** when:
- โ
Asking unrelated questions
- โ
Want maximum speed
- โ
Don't need context between questions
### Use **Basic Demo** when:
- โ
Just testing if system works
- โ
Learning how the code works
---
## ๐ง Common Usage Patterns
### Pattern 1: Topic Investigation (Use Conversational)
```bash
python scripts/conversational_demo.py
You: What products have warranty issues?
You: Tell me more about those issues
You: Which supplier is responsible?
You: Show me their quality ratings
You: What are our alternatives?
```
### Pattern 2: Quick Lookups (Use Interactive)
```bash
python scripts/interactive_demo.py
You: What OLED TVs are available?
You: What's in Warehouse-East?
You: Show me November sales
# Each question is independent
```
### Pattern 3: Single Question (Use Interactive with --query)
```bash
python scripts/interactive_demo.py --query "What products are low in stock?"
```
---
## ๐ฏ Example Sessions
### Conversational Session (Natural Flow)
```
./ask.sh
โ What OLED TVs do we have?
๐ก OLED sizes: 42", 48", 55", 65", 77", 83"
โ Price range?
๐ก From $899 (42") to $3,499 (83")
โ Best seller?
๐ก The 55" model with 400+ units sold in November
โ Any quality issues?
๐ก 12 warranty claims, mostly dead pixels in Q4 batch
โ history
๐ Shows all 4 Q&A pairs
โ clear
๐ Conversation reset
โ What about LCD TVs?
๐ก Fresh conversation about LCD...
```
### Interactive Session (Independent Questions)
```
python scripts/interactive_demo.py
โ What OLED TVs are available?
๐ก OLED sizes: 42", 48", 55"...
โ Show shipping delays
๐ก 15 shipments have delays...
โ Customer feedback on audio
๐ก Soundbar ratings average 4.2/5...
# Each answer is independent
```
---
## โ๏ธ Customization
### Change Models
Edit `config/config.yaml`:
```yaml
ollama:
llm_model: "llama3.1:latest" # Change LLM
embedding_model: "nomic-embed-text" # Change embeddings
```
### Change Retrieval Settings
```yaml
retrieval:
vector_search_k: 5 # More results = more context
keyword_search_k: 5
csv_weight: 0.4 # Adjust CSV vs text balance
text_weight: 0.6
```
---
## ๐ Troubleshooting
### "Connection refused to Ollama"
```bash
# Start Ollama
ollama serve
# Verify
curl http://localhost:11434
```
### "No module named 'hybrid_rag'"
```bash
source .venv/bin/activate
pip install -e .
```
### Conversation getting confused
```
# In conversational mode:
type: clear
# Starts fresh
```
### Slow responses
```bash
# Use interactive mode instead (no history overhead)
./ask.sh --simple
```
---
## ๐ Learn More
- **CONVERSATION_MEMORY.md** - Deep dive into how memory works
- **QUICK_START.md** - Complete usage guide
- **ARCHITECTURE.md** - Technical details
- **USAGE_COMPARISON.md** - Detailed comparison
---
## ๐ Learning Path
### Day 1: Get Started
```bash
./ask.sh
# Ask questions, explore your data
```
### Day 2: Understand Memory
```bash
# Compare both modes
python scripts/conversational_demo.py
python scripts/interactive_demo.py --simple
```
### Day 3: Customize
```bash
# Edit config/config.yaml
# Tune retrieval parameters
# Run boundary tests
```
---
## โก Quick Commands
```bash
# Easiest - conversational with memory
./ask.sh
# Simple mode - no memory
./ask.sh --simple
# Single question
python scripts/interactive_demo.py --query "Your question"
# Test system
python scripts/run_demo.py
# Performance test
python scripts/boundary_testing.py
```
---
**Bottom Line:**
New users โ **`./ask.sh`** (conversational mode)
Power users โ Choose based on task:
- Conversation = `conversational_demo.py`
- Quick lookups = `interactive_demo.py`
- Testing = `run_demo.py`