The Challenge
500+ Programs to Search
Traditional keyword search couldn't scale across hundreds of wellness programs with nuanced differences
Intent Gap
Users say "I'm burnt out" but programs are tagged "stress relief" or "rejuvenation" — keyword matching fails
Manual CRM Work
Every inquiry required manual data entry into ActiveCampaign, slowing down lead response time
The Solution
Semantic Search with Vector Embeddings
Built an intelligent matching system using OpenAI embeddings and pgvector. Every retreat program is converted into a 1536-dimensional vector, allowing for natural language understanding beyond keyword matching.
- ✓Natural Language: Users describe feelings, not filter by categories
- ✓Context-Aware: Understands "burnt out" = "stress relief" + "energy recovery"
- ✓Anti-Hallucination: Strict controls prevent AI from inventing fake programs
// User says: "I need to destress"
const embedding = await openai.embeddings.create({
input: userMessage,
model: "text-embedding-3-small"
});
// Semantic search with cosine similarity
const { data } = await supabase.rpc('match_programs', {
query_embedding: embedding.data[0].embedding,
match_threshold: 0.75,
match_count: 5
});
// Returns programs like:
// - "Stress Relief Retreat" (0.89 similarity)
// - "Anxiety Management Program" (0.82 similarity)
// - "Mindfulness & Relaxation" (0.78 similarity)Key Features
Guest Experience

Conversational AI Interface
GPT-4o-mini powered chatbot with persistent session management. Maintains conversation context across page refreshes.

Smart Intent Matching
Understands user emotions and goals. 'I'm exhausted and burnt out' automatically maps to rejuvenation and energy recovery programs.
Operator Tools

ActiveCampaign Integration
Automatic lead capture with custom fields. Creates contacts and deals in CRM pipeline without manual data entry.

Business Dashboard
Full admin panel for retreat operators to manage programs, rooms, pricing, and track CRM sync status.
Technical Architecture
Serverless Edge Functions
Built on Supabase Edge Functions (Deno runtime) for automatic scaling and global distribution.
┌─────────────┐
│ Browser │
└──────┬──────┘
│
▼
┌─────────────────────┐
│ Edge Function │
│ (Deno Runtime) │
│ │
│ • OpenAI API │
│ • pgvector Search │
│ • GPT-4o Response │
└─────┬───────────┬───┘
│ │
▼ ▼
┌──────────┐ ┌──────────────┐
│Supabase │ │ActiveCampaign│
│PostgreSQL│ │ CRM │
└──────────┘ └──────────────┘Technology Stack
Frontend
Backend
Database
AI/ML
Integrations
Deployment
Results & Impact
Key Learnings
- →Anti-hallucination is critical: Implemented strict controls to prevent AI from recommending non-existent programs
- →Similarity thresholds matter: 0.75 threshold provided best balance between recall and precision
- →Session persistence crucial: Users expect conversations to survive page refreshes in modern apps
- →Governance-first design: Built with stakeholder transparency in mind—every recommendation is explainable and auditable
Explore More Projects
See how I've applied AI and full-stack development to other challenges
Next: AI Booking System