-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpepper-knowledge-base-activity.html
More file actions
208 lines (201 loc) · 11.3 KB
/
Copy pathpepper-knowledge-base-activity.html
File metadata and controls
208 lines (201 loc) · 11.3 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity: What goes in Pepper's knowledge base?</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tabler-icons/3.31.0/tabler-icons.min.css">
<style>
:root{
--bg-page:#F1EFE8;
--bg-primary:#FFFFFF;
--bg-secondary:#F7F6F1;
--bg-info:#E6F1FB;
--bg-success:#E1F5EE;
--bg-danger:#FCEBEB;
--bg-warning:#FAEEDA;
--text-primary:#2C2C2A;
--text-secondary:#5F5E5A;
--text-tertiary:#888780;
--text-info:#185FA5;
--text-success:#0F6E56;
--text-danger:#A32D2D;
--text-warning:#854F0B;
--border-tertiary:rgba(44,44,42,0.15);
--border-secondary:rgba(44,44,42,0.3);
--border-success:#1D9E75;
--border-danger:#E24B4A;
--border-warning:#EF9F27;
--border-info:#378ADD;
--radius-md:8px;
--radius-lg:12px;
--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
@media (prefers-color-scheme:dark){
:root{
--bg-page:#1A1A18;
--bg-primary:#262624;
--bg-secondary:#2C2C2A;
--bg-info:#0C447C;
--bg-success:#085041;
--bg-danger:#791F1F;
--bg-warning:#633806;
--text-primary:#EDEBE5;
--text-secondary:#B4B2A9;
--text-tertiary:#888780;
--text-info:#85B7EB;
--text-success:#5DCAA5;
--text-danger:#F09595;
--text-warning:#FAC775;
--border-tertiary:rgba(237,235,229,0.15);
--border-secondary:rgba(237,235,229,0.3);
--border-success:#1D9E75;
--border-danger:#E24B4A;
--border-warning:#EF9F27;
--border-info:#378ADD;
}
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:var(--font-sans);color:var(--text-primary);background:var(--bg-page);line-height:1.5;padding:2rem 1rem;-webkit-font-smoothing:antialiased}
.container{max-width:760px;margin:0 auto}
h1{font-size:22px;font-weight:500;margin-bottom:8px}
.kb-intro{font-size:14px;color:var(--text-secondary);line-height:1.6;margin-bottom:1.5rem}
.pool-label{font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;color:var(--text-tertiary);margin-bottom:6px}
.pool{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:1.25rem;padding:12px;background:var(--bg-page);border:0.5px solid var(--border-tertiary);border-radius:var(--radius-lg);min-height:56px}
.bins{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:1.25rem}
.bin{background:var(--bg-secondary);border:0.5px solid var(--border-tertiary);border-radius:var(--radius-lg);padding:11px;min-height:140px}
.bin.in{border-color:var(--border-success)}
.bin.out{border-color:var(--border-danger)}
.bin.depends{border-color:var(--border-warning)}
.bin-title{font-size:12px;font-weight:500;margin-bottom:10px;display:flex;align-items:center;gap:5px;line-height:1.3}
.bin.in .bin-title{color:var(--text-success)}
.bin.out .bin-title{color:var(--text-danger)}
.bin.depends .bin-title{color:var(--text-warning)}
.bin.drag-over{background:var(--bg-info)}
.chip{background:var(--bg-primary);border:0.5px solid var(--border-secondary);border-radius:var(--radius-md);padding:7px 10px;font-size:12px;cursor:grab;user-select:none;display:flex;align-items:center;gap:6px;margin-bottom:8px}
.pool .chip{margin-bottom:0}
.chip:active{cursor:grabbing}
.chip .ic{font-size:14px;color:var(--text-tertiary);flex-shrink:0}
.chip.correct{border-color:var(--border-success);background:var(--bg-success)}
.chip.wrong{border-color:var(--border-danger);background:var(--bg-danger)}
.chip .verdict-ic{margin-left:auto;font-size:14px}
.controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.btn{font-size:13px;font-weight:500;padding:8px 16px;border-radius:var(--radius-md);border:0.5px solid var(--border-secondary);background:transparent;color:var(--text-primary);cursor:pointer;transition:background .15s}
.btn:hover{background:var(--bg-secondary)}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--bg-info);color:var(--text-info);border-color:transparent}
.score{font-size:13px;font-weight:500;color:var(--text-secondary)}
.reasons{margin-top:1.25rem;display:none;flex-direction:column;gap:6px}
.reasons.show{display:flex}
.reason{font-size:12px;line-height:1.6;padding:9px 12px;border-radius:var(--radius-md);border-left:3px solid;background:var(--bg-secondary)}
.reason.r-in{border-color:var(--border-success)}
.reason.r-out{border-color:var(--border-danger)}
.reason.r-depends{border-color:var(--border-warning)}
.reason b{font-weight:500}
</style>
</head>
<body>
<div class="container">
<h1>What goes in Pepper's knowledge base?</h1>
<p class="kb-intro">Chipotle is building Pepper, its customer AI assistant, on a RAG system. As the PM, decide what goes into the vector database. But careful — not every source is a clean yes or no. Some need a policy decision before they belong anywhere. Use the third bin for those. Sort each source, then check.</p>
<div class="pool-label">Data sources</div>
<div class="pool" id="pool" ondragover="allow(event)" ondrop="drop(event,'pool')"></div>
<div class="bins">
<div class="bin in" id="bin-in" ondragover="allow(event)" ondrop="drop(event,'in')">
<div class="bin-title"><i class="ti ti-check" aria-hidden="true"></i> Goes in the KB</div>
</div>
<div class="bin out" id="bin-out" ondragover="allow(event)" ondrop="drop(event,'out')">
<div class="bin-title"><i class="ti ti-x" aria-hidden="true"></i> Keep out</div>
</div>
<div class="bin depends" id="bin-depends" ondragover="allow(event)" ondrop="drop(event,'depends')">
<div class="bin-title"><i class="ti ti-scale" aria-hidden="true"></i> Depends — needs a policy</div>
</div>
</div>
<div class="controls">
<button class="btn primary" onclick="check()">Check answers</button>
<button class="btn" onclick="reset()">Reset</button>
<span class="score" id="score"></span>
</div>
<div class="reasons" id="reasons"></div>
</div>
<script>
const ITEMS=[
{id:'menu',label:'Current menu & prices',icon:'ti-tools-kitchen-2',answer:'in',why:'The core of what Pepper does \u2014 recommend and customise orders. Must be current and authoritative.'},
{id:'competitor',label:'Competitor menus & prices',icon:'ti-swords',answer:'out',why:'Off-brand and a business risk. Pepper should never compare or promote rivals \u2014 a scope decision, not a data gap.'},
{id:'reviews',label:'Customer reviews & complaints',icon:'ti-message-2',answer:'depends',why:'A judgment call. There\u2019s real value \u2014 recurring questions, sentiment, FAQs \u2014 but raw reviews carry misinformation, profanity and personal data. The answer isn\u2019t \u201cin\u201d (Pepper might repeat a false \u201cthis made me sick\u201d claim as fact) or \u201cout\u201d (you\u2019d lose genuine insight). It\u2019s \u201cyes, but only once you\u2019ve defined a curation and filtering policy.\u201d Recognising that is the correct call.'},
{id:'nutrition',label:'Nutrition & calorie data',icon:'ti-heart-rate-monitor',answer:'in',why:'A common, high-value question. Belongs in the KB so Pepper answers accurately instead of guessing.'},
{id:'employee',label:'Employee records & payroll',icon:'ti-id-badge',answer:'out',why:'Sensitive internal data with no customer use. A privacy and security exposure on a public chatbot.'},
{id:'hours',label:'Store hours & locations',icon:'ti-map-pin',answer:'in',why:'Frequently asked and location-specific \u2014 exactly the fresh, factual data RAG is built to serve.'},
{id:'order-history',label:'Past customer order history',icon:'ti-history',answer:'depends',why:'A judgment call. It enables personalisation (\u201cwant your usual?\u201d), but storing and retrieving individual purchase history in a chatbot\u2019s KB raises consent and data-protection questions. Useful and risky at once \u2014 it needs a privacy and consent policy before it belongs anywhere, so it\u2019s a \u201cdepends,\u201d not a clean sort.'},
{id:'stale-promo',label:'Last year\u2019s expired promotions',icon:'ti-calendar-off',answer:'out',why:'Stale data is worse than none \u2014 it makes Pepper confidently wrong. The KB must be curated and current.'},
{id:'allergen',label:'Allergen & ingredient info',icon:'ti-alert-triangle',answer:'in',why:'Safety-critical. Must be retrieved from a verified source, never improvised.'},
{id:'internal-memo',label:'Internal strategy memos',icon:'ti-lock',answer:'out',why:'Confidential. If retrievable, it can leak through a clever question. Never feed secrets into a customer-facing KB.'},
{id:'order-policy',label:'Order, refund & catering policy',icon:'ti-receipt',answer:'in',why:'Needed to handle real transactions and set expectations. Company-specific, so the model can\u2019t know it otherwise.'}
];
let state={};
ITEMS.forEach(i=>state[i.id]='pool');
function zoneEl(z){return z==='pool'?document.getElementById('pool'):document.getElementById('bin-'+z);}
function render(){
['pool','in','out','depends'].forEach(z=>{[...zoneEl(z).querySelectorAll('.chip')].forEach(c=>c.remove());});
ITEMS.forEach(it=>{
const chip=document.createElement('div');
chip.className='chip';
chip.draggable=true;
chip.id='chip-'+it.id;
chip.ondragstart=e=>e.dataTransfer.setData('text',it.id);
chip.innerHTML='<i class="ti '+it.icon+' ic" aria-hidden="true"></i><span>'+it.label+'</span>';
zoneEl(state[it.id]).appendChild(chip);
});
}
function allow(e){e.preventDefault();}
function drop(e,zone){
e.preventDefault();
const id=e.dataTransfer.getData('text');
if(!id)return;
state[id]=zone;
document.getElementById('reasons').classList.remove('show');
document.getElementById('score').textContent='';
render();
}
function check(){
let correct=0,placed=0;
ITEMS.forEach(it=>{
const chip=document.getElementById('chip-'+it.id);
chip.classList.remove('correct','wrong');
const v=chip.querySelector('.verdict-ic');if(v)v.remove();
if(state[it.id]==='pool')return;
placed++;
const ic=document.createElement('i');
ic.className='ti verdict-ic';
if(state[it.id]===it.answer){correct++;chip.classList.add('correct');ic.classList.add('ti-check');ic.style.color='var(--text-success)';}
else{chip.classList.add('wrong');ic.classList.add('ti-x');ic.style.color='var(--text-danger)';}
chip.appendChild(ic);
});
document.getElementById('score').textContent = placed<ITEMS.length ? correct+' / '+ITEMS.length+' correct \u2014 '+(ITEMS.length-placed)+' still unsorted' : correct+' / '+ITEMS.length+' correct';
const r=document.getElementById('reasons');r.innerHTML='';
const order={'in':0,'out':1,'depends':2};
const verdict={'in':'In KB','out':'Keep out','depends':'Depends'};
[...ITEMS].sort((a,b)=>order[a.answer]-order[b.answer]).forEach(it=>{
const d=document.createElement('div');
d.className='reason r-'+it.answer;
d.innerHTML='<b>'+it.label+'</b> → '+verdict[it.answer]+'. '+it.why;
r.appendChild(d);
});
r.classList.add('show');
}
function reset(){
ITEMS.forEach(i=>state[i.id]='pool');
document.getElementById('reasons').classList.remove('show');
document.getElementById('score').textContent='';
render();
}
['pool','in','out','depends'].forEach(z=>{
const el=zoneEl(z);
el.addEventListener('dragenter',e=>{e.preventDefault();el.classList.add('drag-over');});
el.addEventListener('dragleave',e=>{if(!el.contains(e.relatedTarget))el.classList.remove('drag-over');});
el.addEventListener('drop',()=>el.classList.remove('drag-over'));
});
render();
</script>
</body>
</html>