Expert assistant for Bible reference lookups and RPC function usage in the KR92 Bible Voice project...
Covers two related but distinct workflows:
When in doubt which one applies: a known reference (Joh 3:16) → lookup; a free-form query (rakkaus, armo ja totuus) → search. The search path itself classifies the query and picks the right backend.
For schema and API details, read from Docs/context/:
Docs/context/db-schema-short.md - Bible schema tablesDocs/context/supabase-map.md - RPC functions listFor the full search architecture — 7 tabs, per-modality RPCs, query classification, AI-summary caching/feedback, anchor questions, recent additions — read references/search-system.md.
Read it when the task touches:
*SearchSection.tsx componentclassifyQuery, isReference, intent routing)normalizeQueryKey), ai_summary_feedback table, ai-semantic vs ai-search feature_key, quality circuit-breaker (thumbs_down ratio), and the verse-text rendering chain (AISemanticResults → fetchVerseTexts → mapFinnishToOsis → get_verses_by_ref)This skill owns the SEARCH side of AI semantic search (cache, routing, rendering, feature_key selection at the call site). For deeper AI configuration, hand off to ai-prompt-manager:
| Question / task | Skill |
|---|---|
"Why is the AI summary card blank for <book> <ch>:<v>?" |
This skill (verseTextService mapping) |
"Cache miss when I expected a hit for <query>" |
This skill (normalizeQueryKey, prefixed-key rule) |
| "Add a new AI feature key for X" | ai-prompt-manager (registration SQL pattern) |
"Change which model runs ai_semantic_search" |
ai-prompt-manager (ai_feature_bindings) |
"Getting feature_locked / operation_not_found / 429" |
ai-prompt-manager (quota + plan_feature_access) |
| "Edit the prompt template that generates summaries" | ai-prompt-manager (ai_prompt_versions) |
| "Build a new AI UI panel" | ai-prompt-manager (AIProcessingPanel/AIProgressBar/AIErrorBanner) |
User: "How do I fetch John 3:16 in Finnish?" Assistant:
const { data } = await supabase.rpc('get_verse_by_ref', {
p_ref_book: 'John',
p_chapter: 3,
p_verse: 16,
p_version_code: 'finstlk201',
p_language_code: 'fi'
});
User: "Get all verses from Genesis chapter 1" Assistant:
const { data: verses } = await supabase.rpc('get_chapter_by_ref', {
p_ref_book: 'Genesis',
p_chapter: 1,
p_version_code: 'finstlk201',
p_language_code: 'fi'
});
User: "Is '1. Joh.4:8' a valid reference?" Assistant: Yes, this is valid. It follows the Finnish format for numbered books:
Alternative valid formats:
1 Joh.4:8 (without period after number)1.Joh.4:8 (no space)1 John 4:8 (English)User: "Convert 'Joh.3:16' to OSIS format"
Assistant: OSIS format: John.3.16
Finnish formats accepted:
Joh.3:16 (with colon)Joh.3.16 (with period)Johannes 3:16 (full name)get_verse_by_ref(p_ref_book, p_chapter, p_verse, p_version_code, p_language_code)
→ {osis, text_content, verse_id}
get_chapter_by_ref(p_ref_book, p_chapter, p_version_code, p_language_code)
→ [{book_code, book_name, chapter_number, verse_number, osis, text_content, verse_id, version_code}]
get_verses_by_ref(p_ref_book, p_chapter, p_verses[], p_version_code, p_language_code)
→ Same as chapter but filtered
get_verse_study_data(p_version_code, p_book_name, p_chapter, p_verse)
→ Full study data including KJV Strong's tags
search_text(p_query, p_version_code, p_limit)
search_text_extended(p_query, p_version_code, p_limit)
→ [{book_name, chapter_number, verse_number, osis, text_content, verse_id}]
| Code | Name | Language |
|---|---|---|
finstlk201 |
Pyhä Raamattu (STLK 2017) - DEFAULT | Finnish |
finpr_finn |
Pyhä Raamattu (1933/1938) | Finnish |
KJV |
King James Version with Strong's | English |
The system recognizes multiple formats:
finstlk201 for Finnish contentp_limit parameterBook.Chapter:Verse - e.g., Joh.3:16Book.Chapter.Verse - e.g., Joh.3.16Book Chapter:Verse - e.g., John 3:16Number. Book.Chapter:Verse - e.g., 1. Joh.4:8Book.Chapter:Verse-Verse - e.g., Joh.3:16-17Book.Chapter:Verse-Chapter:Verse - e.g., Joh.3:16-4:2Docs/03-API.md for complete API reference