Skip to main content

Knowledge > Products > SermonWise AI > Features

SermonWise AI Features

Complete feature catalog for SermonWise AI, covering the generation pipeline, supplemental materials, community sharing, templates, dashboard analytics, and all API routes.


1. Core Sermon Generation

The flagship feature. A multi-step wizard guides the user through inputs, then streams a fully structured sermon outline aligned to their theological tradition.

ItemValue
UI Route/sermons/app/new
ComponentSermonWizard (src/components/sermons/SermonWizard.tsx)
APIPOST /api/sermons/generate
AuthRequired (Supabase session)

User Flow (SermonWizard Steps)

Step 1: Scripture Passage — free-text (e.g., "Romans 8:28-30"), validated against sai_scripture
Step 2: Theme (optional) — free-text, influences prompt framing
Step 3: Theological Tradition — 17 traditions via LensSelector component
Step 4: Sermon Method — 12 methods from sai_sermon_methods OR legacy style picker
Step 5: Target Audience — Mixed Congregation, Youth, Young Adults, Seniors, etc.
Step 6: Voice Style (opt) — tone, language, illustration frequency, application emphasis
Step 7: Generate — streams NDJSON progress events with stage labels

AI Generation Pipeline (Pseudocode)

function generateSermon(input):
// 1. Validate quota
usage = fetchUsage(user_id, current_month_year)
if usage.generation_count >= tierLimit: return QUOTA_EXCEEDED

// 2. Fetch inputs
scripture = query sai_scripture WHERE book/chapter/verse match (WEB translation)
ragContext = query unified_rag_content matching passage + lens, LIMIT 20
lens = query sai_theological_lenses WHERE id = input.lens_id
method = query sai_sermon_methods WHERE id = input.method_id

// 3. Assemble prompt (sermon-prompt.ts)
prompt = assemblePrompt(scripture, ragContext, lens.vocabulary,
lens.hermeneutics, method.structure, method.lens_adaptations[lens],
input.audience, input.voiceStyle)

// 4. Stream LLM response
model = tier == 'sermon_pro' ? 'higher-tier' : 'gpt-4o-mini'
stream = callLLM(model, prompt)
for chunk in stream: yield { event: 'progress', stage, content }

// 5. Persist
INSERT INTO sermons (...) VALUES (...)
UPSERT sermon_generation_usage SET generation_count += 1

return parseSermonOutline(stream.fullText)

Output Structure

interface SermonOutline {
title: string
sections: { id: string; title: string; content: string;
scriptures: string[]; illustration: string | null }[]
applications: string[]
prayerSuggestions: string[]
metadata: { theologicalLens: string; method: string; style: string;
audience: string; wordCount: number;
ragContentUsed: string[]; idealLengthMinutes: number }
}

Rate Limiting

ConstraintValue
Per-user burst2 requests per 30 seconds
Monthly quota (Free)2 sermons
Monthly quota (Pro)15 sermons
Quota reset1st of each month (keyed by month_year column)

2. Title Generator

Lightweight standalone tool for sermon title brainstorming. Top-of-funnel SEO feature.

ItemValue
UI Route/sermons/titles
APIPOST /api/sermons/titles
AuthNot required
Rate limit5 per 60s per IP
Output8-10 title suggestions (JSON array)
LLMgpt-4o-mini, temperature 0.8
CostFree, no quota consumption

Saved Titles

Authenticated users can bookmark titles from the generator. Saved titles are stored in saved_sermon_titles (one row per title, user_id-scoped) and visible in two places:

  1. Title Generator page (/sermons/titles): A "Show/Hide Saved Titles" toggle reveals the user's bookmarks with Use This → and Remove actions. Component: TitleGeneratorTool.
  2. Dashboard (/sermons/app): The SavedTitlesSection component fetches saved titles on mount and renders them after the All Sermons grid — visible only when the user has at least one saved title (silent empty state). Each card shows the title, angle, style pill, scripture, theme, and tradition; Use This → pre-fills the sermon wizard; Remove is optimistically instant with snap-back on failure. PostHog events: saved_title_used and saved_title_removed (both with source: 'dashboard').
Saved Titles APIMethodPurpose
/api/sermons/titles/savedGETFetch user's saved titles
/api/sermons/titles/savedPOSTSave a new title
/api/sermons/titles/saved?id=DELETERemove a saved title

3. Sermon Derivatives (Supplemental Materials)

After generating a sermon, users derive supplemental materials saved as sermon_derivative records linked to the parent sermon.

ItemValue
UI Route/sermons/app/[id] (Materials tab)
ComponentsDerivativePanel, MaterialsTab
APIPOST /api/sermons/derive
Tier gatePro only (sermon_pro)
Monthly cap60 per user per month (added 2026-05-11)

Monthly Derivative Cap (2026-05-11)

Pro users are capped at 60 derivative generations per calendar month. This protects margins — at the cap, worst-case LLM spend ≈ $2.10/user vs the $19.95/mo plan price.

Rationale: 15 sermons × 3 derivative types = 45 + 33% retry headroom = 60.

Implementation:

  • sermon_generation_usage table gains a derivative_count INTEGER NOT NULL DEFAULT 0 column.
  • Two new Supabase RPCs: increment_derivative_usage_capped(user_id, month_year, limit) and decrement_derivative_usage(user_id, month_year).
  • Route reserves the slot atomically BEFORE the LLM call and refunds on any failure path (no LLM response, JSON parse failure, DB save failure, unhandled exception).
  • Cap returns HTTP 429 with { error, limit, current }. DerivativePanel surfaces a pastoral "monthly limit reached" banner (dismissible) rather than a raw error string.
  • getSermonUsage() now returns derivativeCount, derivativeLimit, derivativeRemaining fields for Pro users so the dashboard can surface remaining budget.

Migration: churchwiseai-web/migrations/2026-05-11-derivative-monthly-cap.sql

Derivative Types

TypeDescriptionLengthmax_tokens
Children's SermonAge-appropriate retelling (5-7 min)~500 words6144
Small Group Discussion Guide8-10 questions with leader notes~800 words4096
Social Media SnippetsInstagram (150-300 words) + Twitter (280 chars) + Bulletin (2-3 sentences) + JSON structure~400 words5120
Slide Deck OutlineSlide titles, bullets, scripture refs~400 words4096

max_tokens rationale: social_media was originally 2048 (too small — caused JSON truncation and parse failures for Pro users in production). Bumped to 5120 on 2026-05-11. children needs 6144 because it generates a multi-field structured JSON (story + activity + prayer + object lesson). small_group at 4096 handles 6-8 discussion questions with leader notes comfortably. Route: src/app/api/sermons/derive/route.ts.

function generateDerivative(sermon_id, type):
// 1. Pro-tier gate — 403 if free user
// 2. Atomic cap check — 429 if derivative_count >= 60
sermon = query sermons WHERE id = sermon_id AND user_id = current_user
result = callLLM('claude-haiku', buildDerivativePrompt(sermon.content, type))
// On failure: refund derivative_count via decrement RPC
INSERT INTO sermons (status='derivative', parent_sermon_id, ...) VALUES (...)
return result

4. Community Sharing & Showcase

Community (User-Submitted)

ItemValue
UI Route/sermons/community
APIGET/POST /api/sermons/community
AuthBrowse: no, Submit: yes

Features: search by keyword/scripture/theme, filter by tradition, sort by newest/viewed/reviewed. Moderation queue at /sermons/app/moderate (founder-only). Users can post star ratings and text reviews.

Sharing restrictions (2026-05-11): Derivative sermons (status='derivative') — children's sermons, small group guides, social media posts — cannot be shared to the community. The API returns 400 with a clear error. The "Share to Community" button is hidden in SermonWorkspace when sermonStatus === 'derivative'. Attempting to share a derivative would fail at the DB layer because shared_sermons.scripture_reference is NOT NULL and derivatives have scripture_reference=null.

Showcase (Pre-Generated)

ItemValue
UI Route/sermons/showcase
ComponentsShowcaseBrowser, ShowcaseCompare

Pre-generated sets showing one passage across all 17 traditions side by side. Demonstrates the key differentiator without signup. PDF export available.


5. Sermon Templates

18 free, pre-generated templates for special occasions. No auth required. SEO content designed to attract organic traffic and convert to signups.

ItemValue
UI Route/sermons/templates
ComponentTemplateClientView

Categories

CategoryTemplates
Life EventsFuneral, Wedding, Baptism, Baby Dedication
Church CalendarAdvent, Christmas, Epiphany, Lent, Easter, Pentecost
Cultural HolidaysThanksgiving, New Year, Independence Day
Church MilestonesOrdination, Church Anniversary, Building Dedication

Each includes: title, suggested scriptures, full outline, applications, prayer suggestions.


6. Dashboard & Analytics

Route: /sermons/app (authenticated). Component: SermonDashboard.

SectionContent
Stats RowTime saved (~5 min/sermon), total sermons, total materials, traditions explored (x/17), usage remaining
Bible Book ChartDonut chart by Bible book (BibleBookChart component)
OT/NT BalanceVisual ratio of Old vs New Testament sermons
Traditions ProgressProgress bar: x of 17 traditions explored
Quick ActionsNew Sermon, Title Ideas, Browse Community
Sermon GridSearchable, filterable, tagged by tradition/method
Saved TitlesSavedTitlesSection — visible after the sermon grid when user has ≥1 saved title; silent empty state; Use This → pre-fills wizard; optimistic Remove
function getDashboardStats(user_id):
sermons = query sermons WHERE user_id AND status != 'deleted'
materials = query sermon_derivative WHERE parent_sermon_id IN (ids)
usage = query sermon_generation_usage WHERE user_id AND month_year = current
return { totalSermons, totalMaterials, timeSaved: count * 5,
traditionsExplored: DISTINCT(lens_id).count, usageRemaining,
bibleBooks: GROUP BY book, otNtRatio }

7. Compare Page (Marketing)

Route: /sermons/compare. Conversion page showing generic AI vs SermonWise output.

PassageTraditionWhat It Shows
Romans 8:28ReformedSovereignty emphasis, TULIP alignment
Matthew 28:19Baptist (SBC)Believer's baptism, Great Commission focus
Acts 2:1-4PentecostalHoly Spirit empowerment, gifts activation
John 6:53Roman CatholicEucharistic theology, Real Presence

Each shows a "Generic AI" column (bland, vague) next to "SermonWise" (tradition-specific vocabulary, proper hermeneutics).


8. Sermon Methods

12 structured methods in sai_sermon_methods with section templates and per-lens adaptation.

#MethodDescription
1Textual ExpositionVerse-by-verse through the passage
2Topical DevelopmentTheme-driven with supporting texts
3Narrative ArcStory structure (tension, climax, resolution)
4Doctrinal TeachingSystematic unpacking of a doctrine
5Application-DrivenStarts with life situation, works back to text
6DialogicalQuestion-and-answer format
7Inductive DiscoveryObservation, interpretation, application
8Redemptive-HistoricalPlaces passage in salvation history arc
9Liturgical ReflectionTied to lectionary / church calendar
10Pastoral CareAddresses suffering, doubt, pastoral needs
11Evangelistic AppealOutreach-focused, clear gospel presentation
12Prophetic ChallengeSocial justice, kingdom ethics, prophetic voice

Each method adapts per tradition (e.g., "Textual Exposition" for Reformed emphasizes covenant theology and word studies; for Pentecostal, Spirit illumination and experience).

Library: churchwiseai-web/src/lib/sermon-methods.ts


9. Database Schema

sermons

ColumnTypeNotes
idUUID PK
user_idUUID FK profilesOwner
titleTEXTGenerated title
scripture_referenceTEXTe.g., "Romans 8:28-30"
themeTEXTOptional
theological_lens_idUUID FK sai_theological_lenses
sermon_styleTEXTLegacy: expository/topical/narrative/devotional
method_idUUID FK sai_sermon_methodsStructured method
target_audienceTEXT
contentJSONBFull SermonOutline object
statusTEXTdraft/published/shared/deleted/derivative
is_shared, author_name, view_countCommunity sharing fields
created_at, updated_atTIMESTAMPTZ

sermon_generation_usage

Composite PK: (user_id, month_year). Tracks generation_count, last_generation_at, and (as of 2026-05-11) derivative_count INTEGER NOT NULL DEFAULT 0 for the monthly derivative cap. Two Postgres RPCs manage the derivative counter atomically: increment_derivative_usage_capped and decrement_derivative_usage.

sermon_derivative

ColumnTypeNotes
idUUID PK
parent_sermon_idUUID FK sermons
typeTEXTchildren_sermon/discussion_guide/social_media/slide_deck
contentJSONB
created_atTIMESTAMPTZ

profiles (relevant columns)

subscription_tier (free/sermon_pro), free_tier_sermon_limit (default 2).


10. API Route Catalog

All under churchwiseai-web/src/app/api/sermons/.

RouteMethodAuthPurpose
generatePOSTYesGenerate sermon (streams NDJSON)
titlesPOSTNoTitle suggestions
listGETYesUser's sermons
usageGETYesMonthly quota
statsGETYesDashboard statistics
[id]GET/DELETEYesSermon CRUD
[id]/derivativesGET/POSTYesMaterials
checkoutPOSTYesStripe checkout session
communityGET/POSTMixedBrowse/submit shared sermons
community/[id]GETNoView shared sermon
community/[id]/reviewsPOSTYesSubmit review
community/moderatePOSTFounderApprove/reject submissions
lectionaryGETNoLectionary readings
methodsGETNoSermon methods list
portalGETYesMulti-endpoint batch fetch
derivePOSTYesDerive supplemental materials

11. Key Library Files

All in churchwiseai-web/src/lib/.

FilePurpose
sermon-pricing.tsTier definitions, Stripe price IDs, trial config
sermon-brand.tsBrand config (domain, colors, tagline, nav)
sermon-usage.tsQuota enforcement, usage tracking
sermon-prompt.tsPrompt assembly, RAG fetch, scripture, vocabulary
sermon-methods.ts12 methods, section templates, per-lens adaptation
sermon-voice-style.tsVoice style customization (tone, language, illustrations)
sermon-export.tsExport to Word (.docx) and Markdown
sermon-lectionary.tsLectionary calendar data, date-to-reading mapping

12. Component Inventory

All in churchwiseai-web/src/components/sermons/.

ComponentPurpose
SermonWizardMulti-step generation form
SermonResultDisplays generated outline
SermonWorkspaceFull-page sermon editor (view/edit/materials)
SermonNavTop navigation bar
SermonFooterFooter with legal links and branding
SermonHeroMarketing hero section
SermonUpgradeButtonFree-to-Pro upgrade CTA
LensSelector17-tradition picker
BibleBookChartDonut chart by Bible book
VocabularyHighlighterHighlights tradition-specific terms
DerivativePanelGenerate supplemental materials
MaterialsTabLists derivatives for a sermon
ShowcaseBrowserBrowse showcase entries
ShowcaseCompareSide-by-side tradition comparison
TemplateClientViewRenders free templates
CrossPromoBannerPromotes ChurchWiseAI voice/chatbot
OnboardingGateNew user onboarding flow
InlineTitleGeneratorEmbedded title widget
SermonBreadcrumbBreadcrumb navigation
SavedTitlesSectionDashboard section — saved title cards, Use This → wizard link, optimistic remove

13. SEO & Caching Headers

Route PatternRobotsCache
/sermons (homepage)index, followISR
/sermons/pricingindex, followCached
/sermons/templatesindex, followCached
/sermons/communityindex, followRevalidate
/sermons/showcaseindex, followCached
/sermons/compareindex, followCached
/sermons/privacy, /termsindex, followCached
/sermons/login, /signupnoindexNo cache
/sermons/app/*noindexNo cache, private

14. Cross-Promotion

SermonWise surfaces ChurchWiseAI products via CrossPromoBanner:

  • Appears on dashboard and post-generation
  • Promotes Voice Agent and Chatbot to engaged pastors
  • Links to churchwiseai.com pricing, dismissible per-session

Reverse: ITW illustration pages link to SermonWise for full generation. ChurchWiseAI blog posts about sermon prep link to sermonwise.ai.


See Also