File size: 1,950 Bytes
e9f4038
 
 
 
 
 
190b585
e9f4038
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190b585
 
 
 
e9f4038
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: Ask Anything Lab
emoji: 🧠
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "6.11.0"
app_file: app.py
pinned: true
license: mit
short_description: "See what happens when AI processes your words"
---

# Ask Anything Lab

Live companion visualization for John Patterson's TEDx talk *"Ask Anything: AI, Emotion, and Influence"* (May 1, 2026).

Two modes share one URL:

- **Presenter** — clicker-controlled stage demo, hardcoded ER-story data, zero API calls, zero latency
- **Audience** — 300 attendees visit a QR code, type their own prompt, watch it embed/retrieve/synthesize live, answer three study questions

## Run locally

```bash
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py
```

Open http://localhost:7860

## Environment variables

```
ANTHROPIC_API_KEY=     # required for audience mode (falls back to placeholder data otherwise)
SUPABASE_URL=          # Supabase project URL
SUPABASE_SERVICE_KEY=  # Supabase service_role key — server-side only, bypasses RLS
SUPABASE_ANON_KEY=     # (optional) anon key fallback
```

Without Supabase keys, study submissions log to stdout (`[STUDY] {...}`).

## Keyboard / clicker controls (presenter mode)

| Action  | Keys                                          |
|---------|-----------------------------------------------|
| Forward | ArrowRight, Space, PageDown, ArrowDown, Enter |
| Back    | ArrowLeft, PageUp, ArrowUp, Backspace         |

## Supabase schema

```sql
CREATE TABLE tedx_study (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  session_id TEXT NOT NULL,
  prompt TEXT,
  q1_surprising_stage TEXT,
  q2_trust_before INT,
  q3_trust_after INT,
  created_at TIMESTAMPTZ DEFAULT now()
);
ALTER TABLE tedx_study ENABLE ROW LEVEL SECURITY;
CREATE POLICY "anon_insert" ON tedx_study FOR INSERT TO anon WITH CHECK (true);
CREATE POLICY "service_read" ON tedx_study FOR SELECT TO service_role USING (true);
```