DEV Community

Cover image for Dr Vignesh Narayan R's Skin AI Assistant: A Safety-First Dermatology Agent (Built with React + Algolia)
Dr. Vignesh Narayan R
Dr. Vignesh Narayan R

Posted on

Dr Vignesh Narayan R's Skin AI Assistant: A Safety-First Dermatology Agent (Built with React + Algolia)

This is a submission for the Algolia Agent Studio Challenge: Conversational Experiences

What I Built

I built Dr Vignesh Narayan R's Skin AI Assistant, a safety-first dermatology assistant designed to help patients navigate the overwhelming world of skincare.

Instead of being a generic chatbot that "guesses" answers, this agent acts as a specialized medical triage tool. It takes into account three critical data points—Skin Type, Weather Conditions, and Medical History—to recommend safe skincare ingredient formulations.

Crucially, it is engineered to be medically responsible:

  • It refuses to recommend specific commercial brands (to avoid bias).
  • It proactively filters out ingredients that are contraindicated for specific conditions (e.g., if a user has Eczema, it knows to block Salicylic Acid recommendations, even if the user has acne).
  • It always directs users to book a physical consultation for prescription-strength treatments.

Demo

You can try the live application here:

https://drvigneshnarayanrskinai.netlify.app/

(Note: Since this is running on a free instance, please allow up to 60 seconds for the agent to "wake up" and respond to your first message. If it stays quiet, the daily API test quota may have paused—please try again later!)

GitHub Repo Source Code:
https://github.com/drvigneshnarayanr/drvigneshnarayanrskinai/

How I Used Algolia Agent Studio

I leveraged Algolia Agent Studio to build a RAG (Retrieval Augmented Generation) workflow that grounds the AI in medical fact rather than probability.

The Data Index
I created a custom dataset (dermatology_rules.json) containing clinical skincare rules. Instead of just indexing product names, I structured the data with medical metadata:

  • formulation_type (e.g., "Occlusive Ointment")
  • safe_for_conditions (e.g., ["Psoriasis", "Atopic Dermatitis"])
  • contraindicated_for (e.g., ["Acne Prone"])

Targeted Prompting & Configuration
I used the Agent Studio to configure a specific system prompt that enforces a "Safety Check" logic:

"Analyze the User Input... Search your knowledge base... Before recommending ANY product, check its contraindicated_for field. If the user has a condition listed there, YOU MUST DISCARD THAT RESULT."

Searchable Attributes
To ensure the agent actually "reads" the safety tags, I configured Algolia's Searchable Attributes to prioritize safe_for_conditions and weather_suitability. This allows the agent to perform semantic filtering—finding the right medical rule even if the user uses colloquial language.

Why Fast Retrieval Matters

In healthcare and dermatology, accuracy is non-negotiable. A standard LLM might hallucinate a product that sounds real but contains irritants.

By using Algolia's fast retrieval:

  • Reduced Hallucinations: The agent generates answers only from the retrieved context (my curated JSON file). If the safe answer isn't in the index, the agent knows to say "I don't know" rather than making up medical advice.
  • Contextual Speed: Users get advice tailored to their current weather and skin condition instantly. The search index filters 100+ possibilities down to the single safest option in milliseconds, allowing the LLM to focus on crafting a compassionate response rather than searching for facts.

Team

Dr. Vignesh Narayan R - Consultant Dermatologist & Developer.

Top comments (0)