đź’ˇ Inspiration

WeDive is a comprehensive scuba diving platform designed to connect divers with local spots, creatures, and community logs. The vision for WeDive began in December 2025, and development has been ongoing.

Scuba diving demands extreme accuracy, safety awareness, and personalization. Recommending a deep, high-current drift dive to a beginner with fewer than 20 logged dives can lead to life-threatening real-world risks. Conventional conversational AI chatbots frequently suffer from hallucinations and a lack of continuous adaptability—a critical limitation that our early AI concierge version also faced.

To solve this, we undertook an "Agentic Redesign" of the WeDive AI Concierge.

Instead of a static chatbot, we transformed it into a truly Collaborative Partner Agent. It actively listens to diver feedback (👍/👎), uses an asynchronous LLM-as-a-Judge to automatically analyze its own mistakes, and dynamically injects Negative Guardrails into runtime system prompts for future conversations—achieving real-time self-evolution without expensive model re-training.


🚀 What It Does

  • Personalized Diver Guidance: Reads diver profiles (log count, macro vs. topography preferences, current tolerance) to recommend safe, tailored dive spots.
  • In-Context Reinforcement Learning (In-Context RL):
    • Negative Feedback (👎 Bad): Triggers a background Cloud Function where Gemini 3.5 Flash acts as an automated auditor ("LLM-as-a-Judge"). It extracts the root cause of dissatisfaction into a concise rule (e.g., "Do not recommend strong current drift spots for divers with < 20 logs") and stores it in Firestore (concierge_guardrails).
    • Dynamic Guardrail Injection: Fetches active guardrails at runtime and injects them into system instructions, preventing repeat mistakes instantly.
  • Advanced RAG (Query Rewriting Pipeline):
    • Pre-processes conversational user queries into clean, search-optimized keywords before querying Vertex AI Search (wedive-ai-assistant), removing noise and maximizing retrieval precision.

🛠️ How We Built It

  • LLM Engine: gemini-3.5-flash via @google/genai SDK.
  • Google Cloud Infrastructure:
    • Cloud Functions v2 (asia-northeast1): Serverless execution for Concierge API, Feedback Callable endpoints, and Firestore Triggers.
    • Firestore: Persistent storage for sessions, feedback logs, guardrails, and few-shot patterns.
    • Vertex AI Search (Agent Builder): Managed RAG datastore for diving spots and diver log grounding.
  • Frontend / Client: React Web (wedive-web) and React Native Expo Mobile App (wedive-app).

đźš§ Challenges We Ran Into

  1. Safety Hallucinations in High-Risk Domains: Recommending deep, high-current drift dives to novice divers poses real-world safety risks. Standard LLMs lack built-in safety boundary enforcement.
  2. Token Inflation & Memory Cost Control: Unrestricted conversation history causes payload token inflation and high Firestore I/O costs. We engineered an automated 5-turn (10-message) sliding window pipeline to maintain conversation continuity while keeping operational costs near zero.

🏆 Accomplishments That We're Proud Of

  1. Autonomous In-Context RL Engine: We successfully built a self-evolving agent that continuously adapts to user feedback (👍/👎). Using Gemini 3.5 Flash as an LLM-as-a-Judge, the system analyzes failures and injects negative guardrails in real-time without expensive model fine-tuning.
  2. Fully Serverless Google Cloud Architecture: Achieving high performance, real-time safety, and personalized RAG with $0 fixed infrastructure costs using Cloud Functions v2 and Firestore.

🎓 What We Learned

Transition from Generic Chatbot to Domain-Specialized Agent: Off-the-shelf general LLMs are insufficient for specialized domains like scuba diving. True value comes from grounding the model in diver experience metrics, persona constraints, and automated self-correction loops.


đź”® What's Next for Innovative AI Agent

Domain-Aware Hybrid Vector Search: We aim to fully integrate Advanced RAG with Vector Search for dive spots and creature taxonomies. However, diving data cannot be solved by simple text embeddings alone—a spot's semantic beauty must be balanced against strict hard boundaries (depth limits, current levels, certification). We are currently designing a hybrid retrieval algorithm that fuses vector similarity with deterministic safety constraints.


Built With

Share this project:

Updates

Submission history