Chat Functionality - RAG [Alpha 1️⃣]

Added by Justin Sheehan Justin S. June 13, 2025 3:15am
Column
Done July 10, 2025 1:50am
Assigned to
Troy Pastoral Troy P.
Notes
Sources: ProjectSmart - 🟣 Daryle Doden Bot | AE
Subtasks
Setup Pinecone vector database Troy Pastoral Troy P. Jun 17, 2025
Setup Rag with Pinecone / Open AI with system prompts Troy Pastoral Troy P. Jun 17, 2025
Link up Project Smart articles Troy Pastoral Troy P. Jun 17, 2025
Troy Pastoral
Troy Pastoral AI Whisperer Edited June 13, 2025 9:38am June 13, 2025 9:38am
I connected the openAI assistant for now, since it's already working. Let's figure out how to fragment the sources (pdfs) later on
image.png Download
Troy Pastoral
Troy Pastoral AI Whisperer June 13, 2025 9:58am June 13, 2025 9:58am
Moving forward, here's what we should be doing:

🧠 RAG in OpenAI
  • Handles chunking, embedding, semantic search
  • Your PDF is already embedded and indexed in your assistant’s vector store
  • OpenAI manages context window, retrieval scoring, etc.
📦 Storage in Supabase
  • You store raw documents in Supabase Storage (rag-documents bucket)
  • Keep metadata in a table (e.g., file name, tags, upload date, owner)
🎯 Benefits of This Setup
✅ Easier updates — Just re-upload files or sync to OpenAI manually
✅ Audit & control — Files stay in your storage, not just OpenAI
✅ RLS and privacy — You can control who accesses which files
✅ Future migration path — You can eventually run your own embedding pipeline if needed

🔄 How the Flow Would Work
  1. Upload a PDF → Supabase Storage (rag-documents)
  2. (Optional) Sync to OpenAI Assistant (manually or via Edge Function)
  3. In chat:
  •  Your app uses the Assistant API
  • OpenAI handles the RAG using the vector store tied to the assistant
  4. Store metadata, chats, and thread IDs in Supabase
  5. Preview files or sources using Supabase Storage links
Justin Sheehan
Justin Sheehan Chief Journey Officer June 19, 2025 2:42pm June 19, 2025 2:42pm
Troy what's the system prompt we're using for the Doden Bot?

To adjust the style, length, etc. 
Troy Pastoral
Troy Pastoral AI Whisperer Edited June 19, 2025 4:02pm June 19, 2025 4:02pm
Justin    const modePrompts = {
    coach: "You are a leadership coach. Provide guidance on leadership development, team management, and professional growth.",
    family: "You are a family advisor. Focus on family relationships, parenting, work-life balance, and family values.",
    investor: "You are an investment advisor. Provide insights on financial decisions, investment strategies, and business opportunities.",
    ambassador: "You are a diplomatic ambassador. Focus on relationship building, representation, and strategic communication.",
    faith: "You are a faith counselor. Provide guidance grounded in spiritual wisdom and values-based decision making."
  };

supabase/functions/pinecone-rag-chat/utils/openai.ts
Shall we use Raunek's prompt?
Justin Sheehan
Justin Sheehan Chief Journey Officer June 25, 2025 3:20am June 25, 2025 3:20am
Troy  

Screenshot 2025-06-24 at 11.20.10 PM.png Download
Screenshot 2025-06-24 at 11.19.57 PM.png Download

errors showing up on this account
  • Username: pascutmalina@gmail.com
  • Password: tGh!0|75pk0S