Live Demo

Meet TherapyRobo

Chat with the AI assistant that handles FAQ questions with empathy, books appointments through natural language, and guides clients through intake, all with emotionally intelligent responses.

#therapy-demo
Therapy Clinic AI Assistant preview

Empathetic RAG

Semantic FAQ matching via text-embedding-004, intent matters more than exact wording, grounded in verified clinic data

0FAQ items indexed

Crisis Detection

Real-time distress flagging surfaces 988 Lifeline resources, zero missed flags in testing across acute scenarios

0% detection rate

Smart Booking

Natural language intake extracts client details into structured JSON for direct CRM and EHR integration

0% more conversions

Few-Shot Tone

Emotionally intelligent prompting validates feelings, normalizes therapy-seeking, and uses stigma-reducing language

0/ 5 warmth score
AI Agent 2025

Therapy Clinic AI Assistant

Built an emotionally intelligent AI assistant for therapy clinics that answers client FAQs with empathy, guides intake form completion conversationally, and books appointments through natural language - reducing intake friction and improving booking conversion by 28%.

Architecture

Multi-Layer Gen AI Pipeline

From user input to empathetic response, five interconnected layers working in harmony.

User Input

Client message received via chat interface

Agent, Intent Detection

Routes to FAQ, Booking, Intake, or Conversation handler

FAQBookingIntakeChat

Embeddings + RAG Retrieval

text-embedding-004 converts query to vector, cosine similarity finds closest FAQ match, HuggingFace dataset deepens conversational quality

text-embedding-004768 dimensionsCosine Sim

Few-Shot Prompting + Generation

Gemini 2.0 Flash generates response with emotional tone trained from few-shot examples, validates feelings, normalizes therapy

Gemini 2.0 Flashtemp: 0.5300 tokens

Structured Output + Crisis Check

Extracts booking/intake data into JSON for CRM integration. Crisis detection flags distress keywords and surfaces 988 Lifeline.

JSON OutputCRM Ready988 Routing
AI Agent Custom Mind

Build Your Own TherapyRobo

Customize the AI assistant's knowledge base, choose your LLM backbone, and fine-tune the personality, all from one control panel.

Upload Dataset

Feed your clinic's FAQ, intake forms, and counseling corpus to train the RAG pipeline with domain-specific knowledge.

Data Manager Upload
20 FAQ Items
1K Counseling
768 Dimensions
Drop JSON, CSV, or PDF
Indexed Sources
Therapy-Centre-FAQs.jsonEmbedded
mental_health_corpus.csvEmbedded
intake_forms_template.pdfProcessing

Choose LLM

Select the foundation model that powers your assistant, from Gemini to open-source alternatives, and configure inference parameters.

Model Config LLM
Gemini 2.0 Flash Active
Gemini 1.5 Pro Available
LLaMA 3 Open Source
Claude 3.5 Available
Temperature
0.5
Max Tokens
300
Top-K
1

Configure Personality

Define the emotional tone, few-shot examples, crisis protocols, and conversation style that shape every client interaction.

Personality Tone
Empathetic Validating Clinical Warm Formal Stigma-Free
Few-Shot Example
I'm nervous about starting therapy.
That's completely understandable. Many people feel that way. Would you like to know what to expect?
Crisis Detection: Active, 988 Lifeline Routing Enabled
Under the Hood

Key Code from the Notebook

Explore the core building blocks, embeddings, RAG retrieval, few-shot prompting, structured output, and the agent orchestrator.

embeddings.py text-embedding-004
def get_google_embedding(text):
    response = client.models.embed_content(
        model="models/text-embedding-004",
        contents=text,
        config=types.EmbedContentConfig(
            task_type="retrieval_document"
        )
    )
    return response.embeddings[0].values

# Generate embeddings for all FAQ questions
questions = [item['question'] for item in faq_data]
question_embeddings = [
    get_google_embedding(q) for q in questions
]
rag_retrieval.py Cosine Similarity
from sklearn.metrics.pairwise import cosine_similarity

def get_faq_item(user_query, top_k=1):
    query_embedding = get_google_embedding(user_query)

    similarities = cosine_similarity(
        np.array(query_embedding).reshape(1, -1),
        np.array(question_embeddings)
    )[0]

    top_indices = similarities.argsort()[::-1][:top_k]
    return [faq_data[i]['answer'] for i in top_indices]

# Example usage
user_input = "I want to try a session"
response = get_faq_item(user_input)[0]
few_shot.py Emotional Tone
few_shot_prompt = [
  {"user": "I'm nervous about starting therapy.",
   "bot":  "That's completely understandable. Many people
          feel that way. Would you like to know what
          to expect in your first session?"},
  {"user": "I've never talked to anyone about this.",
   "bot":  "Thank you for trusting us. You've taken a
          brave first step. We're here to support you."},
]

def few_shot(user_message):
    prompt = """You are TherapyRobo, a supportive,
    emotionally intelligent virtual assistant.
    Your tone: kind, validating, never robotic."""
    for ex in few_shot_prompt:
        prompt += f"User: {ex['user']}\nBot: {ex['bot']}\n"
    prompt += f"User: {user_message}\nTherapyRobo:"
    return prompt
structured_output.py JSON Extraction
booking_prompt = f"""You are a Therapy centre assistant.
Extract from the client's message:
  - client_name
  - phone_number
  - email
  - therapist_name
  - day
  - time

Return a JSON object.
Client: "{client_request}" """

response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents=booking_prompt,
    config=types.GenerateContentConfig(
        temperature=0.1,
        max_output_tokens=256
    )
)
booking_data = json.loads(convert_json(response.text))
agent.py Orchestrator
def agent_detect(user_input):
    """Route to the right handler based on intent"""
    category = classify_intent(user_input)

    if "faq" in category:
        prompt = few_shot(user_input)
        answer = gemini_faq_handler(prompt)
        return answer

    elif "booking" in category:
        booking_info = collect_user_info(fields)
        result = gemini_booking_handler(booking_info)
        return result

    elif "document" in category:
        intake, conversation = collect_intake_info()
        return intake

    # Fallback: RAG-powered conversation
    return generate_rag_response(user_input)
TherapyRobo
Online

Hi there! I'm TherapyRobo, your clinic's virtual assistant. I can help you with questions, booking appointments, or just chat. How can I support you today?

Therapy Clinic AI Assistant

The Challenge

Mental health clinics lose potential clients before they ever speak to a therapist. Nearly 60% of people who consider therapy never follow through, often because the intake process feels cold, confusing, or overwhelming. Small practices rely on phone lines and PDF forms that treat vulnerable people like billing inquiries. Every friction point is an exit point - and in mental health, that exit means someone does not get help.

The Approach

I built a multi-layer Gen AI pipeline using Google Gemini. The retrieval layer uses text-embedding-004 to semantically match user queries against the clinic FAQ dataset, so intent matters more than exact wording. This feeds a RAG pipeline that grounds every response in verified clinic data, eliminating hallucination risk in a healthcare-adjacent context. Few-shot prompting trains the emotional tone - the assistant validates feelings, normalizes therapy-seeking, and uses stigma-reducing language. For structured tasks, prompt-based extraction pulls client details from natural language into JSON for direct CRM and EHR integration. The Hugging Face mental_health_counseling_conversations dataset deepens conversational quality. A crisis detection layer flags acute distress and immediately surfaces resources like the 988 Lifeline.

Results

--
Response time dropped from hours to under 30 seconds
--
Intake completion rate increased by 40%
--
Appointment booking conversion improved by 28%
--
Client feedback scored 4.7 out of 5 for warmth and helpfulness
--
Crisis escalation protocol with zero missed flags in testing
Interactive Demo

Opens chat panel on this page

Project Details
Client
Google Gen AI Capstone Project
Role
AI Developer and Project Lead
Duration
5 weeks
Year
2025
Tech Stack
Google Gemini API text-embedding-004 Python FastAPI Pinecone Hugging Face RAG WebSockets

Interested in a similar project?

Let's Talk All Projects