Skip to main content

13 docs tagged with "rag"

View all tags

Chat Message Flow

End-to-end flow for a single chatbot message — moderation, agent selection, RAG retrieval, tool execution, and streaming response from /api/chatbot/stream

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)

Chatbot Conversation Pipeline — Complete Code Trace

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.

Debug Chatbot Issues

Diagnose chatbot problems — wrong responses, tools not saving, widget not loading, LLM errors — using Vercel logs, Supabase queries, and the RAG debug flow

How the Voice Agent Works

End-to-end explanation of the ChurchWiseAI voice agent — body analogy, service map, call flow, and fallback chain

OpenAI Integration

OpenAI text-embedding-3-small for all RAG vector embeddings (unified_rag_content), plus gpt-4o-mini as the chatbot LLM fallback when Claude is unavailable

RAG Query Flow

How RAG queries work — embedding the user query, pgvector cosine search against unified_rag_content, theological lens filtering, and injecting results into LLM context

Regenerate Vector Embeddings

Regenerate OpenAI text-embedding-3-small vectors for unified_rag_content rows — identify rows with null embeddings, run the embedding script, and verify RAG search improves

Theological Lens Matching

How church denomination is mapped to a theological lens, and how that lens filters RAG results and adjusts vocabulary in chatbot and voice agent responses

Voice Agent Call Lifecycle

Non-technical walkthrough of a complete voice call — from phone ring through greeting, RAG lookup, tool use, potential Care Agent handoff, and post-call DB writes

Voice Turn Processing Pipeline

Step-by-step pipeline for each voice turn — noise filtering, moderation check, RAG retrieval, LLM inference, tool execution, and TTS output — implemented via on_user_turn_completed callbacks and call_handler.py utilities