Chatbot Architecture
Technical architecture of the chatbot request pipeline — moderation, RAG retrieval, agent routing, tool calling, streaming response, and the LLM provider strategy (Claude primary / GPT-4o-mini fallback)
Technical architecture of the chatbot request pipeline — moderation, RAG retrieval, agent routing, tool calling, streaming response, and the LLM provider strategy (Claude primary / GPT-4o-mini fallback)
Definitive source of truth for the entire chatbot request lifecycle, from HTTP request arrival to response return. Every code path, every tool, every third-party call, every expected result. Generated 2026-04-02 from a full read of every file in the pipeline.
Durable reference for what makes a world-class agentic chatbot. Principles are permanent; vendor/model choices are pluggable and must be re-evaluated quarterly.
Design for deferring empathy-sensitive tool execution so HEAR protocol is structurally enforced in chatbot responses
Reference for how Claude Code agents are configured — session-start hook, available MCP tools, skills (slash commands), CLI access, and how multiple agents coordinate safely
End-to-end explanation of the ChurchWiseAI voice agent — body analogy, service map, call flow, and fallback chain
Replace all MailerLite automations with Resend + cron-based email system
Context
Exact DDL, column-level changes, migration sequence, and code-path updates for the shared-core + per-vertical-tenant-tables architecture chosen on 2026-04-21. This is the implementation companion to the decision doc.
Source of truth for all Stripe payment flows. Payment-first principle — no DB writes until checkout.session.completed webhook confirms payment.
Everything that happens from "pastor hears about ChurchWiseAI" through "visitor sends first message or call is answered." Covers the church admin setup journey (Track A) and the visitor discovery journey (Track B), and traces how admin-entered config flows into every AI response.
Context
Index of all documented process flows — 8 customer-facing flows, 8 system flows, and 4 agent-internal flows covering every major user journey and automated pipeline
Technical architecture for ShareWiseAI — OAuth platform connections (Facebook, Instagram, LinkedIn), post scheduling API, cron-based publishing, and multi-tier subscription gating
High-level overview of the three active codebases (churchwiseai-web, pewsearch, sermon-illustrations), how they connect, and the shared infrastructure they run on
Status
Multi-tenant LiveKit Agents SDK architecture — one deployed agent serves all churches via SIP trunk phone-number routing, with per-church config loaded from Supabase at call init
Definitive step-by-step trace of every function, LLM call, STT/TTS step, database query, and third-party service call from SIP arrival to call termination. Required reading before touching any voice code.