Pastor configures Knowledge Base
Persona
A pastor in their first 24 hours after account creation. Excited but slightly overwhelmed. They know the chatbot needs to know about their church — service times, staff, what they believe. They want simple forms with hint text, not blank text boxes. They have 20–30 minutes and will refine later.
Entry points
- Training tab — First login; sees "Training" in sidebar, clicks it.
- Onboarding wizard — First-login flow shows "Set Up Your Church Knowledge" as Step 2.
- Email CTA — "You're almost ready — tell us about [Church Name]" →
/admin/[token]?tab=training.
Click-through flow
Steps
-
Open Training tab —
?tab=training. Sub-tabs: Church Knowledge (default), This Week, Theology, Agents, Safety. Starter does NOT show: FAQs or Simulator sub-tabs (Pro+).TrainingTab.tsxloadsorganization_settingsfor this church. -
Fill Church Info — Name (pre-filled), Location, Phone, Website, About Us (200 char). Autosaves every 5 seconds; explicit "Save" updates
organization_settings.church_infoJSONB. -
Fill Service Times — Day of week dropdown, time picker, service type (Main Service, Youth, Prayer, Small Group, Other). Stored in
organization_settings.service_timesas array. -
Add Staff — Name, Title (Pastor, Associate Pastor, Music Minister, Volunteer, Other), Bio (100 char, optional). Stored in
organization_settings.staffas array. Staff names and titles are injected into chatbot system prompt so agent can refer callers to the right person. -
Document upload (optional) — Drag-and-drop zone. Max 20MB. Accepted: pdf, docx, doc, txt, png, jpg, jpeg. POST to
/api/admin/kb-proxy/upload?churchId=[uuid]. File stored in Supabase Storagetraining-documents/[churchId]/[filename]. Embedding job queued;unified_rag_contentrows created withchurch_id,source='upload'. UI shows "Embedding in progress…" → "Ready" (typically within 5 minutes). -
Test chatbot with new knowledge — Navigate to
/chat/[slug]. Type "What time is Sunday service?" or "Who is the pastor?" RAG retrieval loads church facts + uploaded documents. Response should reflect service times, staff names, or document context.
Acceptance spec
Canonical: knowledge/acceptance/starter-chat.md (Touchpoints D-1 through D-6).
Starter tier specifics:
- Church Info, Service Times, Staff forms: available
- Document upload: available
- Theology: denomination selector only (full theology editing is Pro+)
- Agents sub-tab: visible but read-only for Starter
- Safety sub-tab: available
- No FAQ management (Pro+ only)
- No Document simulator (Pro+ only)
Success criteria
- Form fields clear, not overwhelming (hint text on every field).
- Data saves without refresh or error message.
- Uploaded documents show "Embedding..." then "Ready" status.
- Test message references church name, service times, or staff on next query.
- Edits to service times are reflected in chatbot response immediately.
- Document upload rejects files >20MB with a clear error message.
Known failure modes
-
Embedding backlog >5 minutes. Check Supabase cron logs for failed embedding tasks. Monitor
unified_rag_contentfor rows withembedding IS NULL. Source:memory/project_embedding_backlog.md. -
Duplicate rows in unified_rag_content. Upload endpoint must be idempotent — use
(church_id, source_file_hash, source_type)composite unique constraint. Source:memory/feedback_rag_duplicate_detection.md. -
Staff name not in system prompt. Verify
buildSystemPrompt()includesstaff.map(s => s.name + ' (' + s.title + ')').join(', '). Source:memory/feedback_staff_not_in_prompt.md. -
Calendar boundary: today's events excluded. Query must use
event_date >= NOW()(not>). Source:memory/feedback_calendar_boundary.md. -
normalizePlanTier() written back to DB. All writes to
premium_churches.planmust use raw Stripe plan keys, never the collapsed tier. Source:memory/feedback_plan_tier_not_persisted.md.