Inspiration
For anyone with curly hair, wash day isn't just a routine—it is a literal science experiment. You have to balance the daily weather (humidity/dew point), your hair’s porosity, and complex product ingredient chemistry. If you use a high-glycerin gel on a 90% humidity day, or mix an alkaline shampoo with an acidic leave-in, your hair is ruined.
It takes entirely too much mental bandwidth. I didn't want to build a chatbot that I had to ask for advice every day. I wanted a true Taskmaster—an autonomous background agent that handles the heavy lifting of hair care chemistry while I sleep.
What it does
Curl Chemist is a serverless, autonomous hair care agent that completely manages your curly hair routine:
- Multimodal Ingestion: Instead of typing out products, you just upload a photo of an ingredient label. The Vision Scanner Agent extracts the messy, unstructured text and saves the chemical profile to your shelf.
- The Nightly Background Chore: Triggered asynchronously by Google Cloud Scheduler, the agent wakes up, fetches tomorrow's weather in your city, scans your shelf for chemical or climate conflicts, formulates a safe routine, and actively hits the Google Calendar API to block out time for your wash day.
- Wash Comparison Agent: It takes your daily hair selfies, sends them to Gemini Vision alongside historical weather data, and visually compares your curl definition over time. Crucially, it adjusts for climate—it knows not to blame a product if it was just a humid day.
How I built it
I built Curl Chemist on Google Cloud (Cloud Run, Firestore, Cloud Storage) utilizing the new Google GenAI SDK.
- The ReAct Orchestrator: I bypassed rigid Python scripts and built a custom ReAct loop powered by Gemini 3.5 Flash. The LLM receives a goal and a tool registry, and autonomously sequences the API calls.
- Hybrid Chemist Engine: To prevent AI hallucinations, the agent first evaluates your products against a strict, deterministic JSON rule engine. It only uses Gemini at the very end to consolidate proven conflicts into natural language.
- Model Armor (Security): Before any payload hits the main orchestrator, it passes through a Zero-Trust gateway. I deployed a Gemma model as an inline guardrail to actively scan incoming payloads for prompt injection attacks and strip out PII.
Challenges I ran into
1. LLM Hallucinations in Chemistry: Early on, the LLM would occasionally hallucinate chemical conflicts that didn't exist. This is dangerous for a utility app. I solved this by enforcing strict architectural discipline—decoupling the logic so a deterministic rule engine handles the science, and the LLM only handles the synthesis. 2. The Combinatorial Explosion of Conflicts: When the deterministic rule engine evaluates a full shelf of products, it generates a massive, repetitive web of warnings (e.g., one alkaline shampoo separately clashing with a gel, a cream, and a leave-in). Outputting this raw data would cause terrible UX and alert fatigue. I solved this by using Gemini as an intelligent consolidation layer. It ingests the raw, combinatorial JSON array and expertly deduplicates, groups, and resolves contradictions, outputting a single, clean, personalized warning.
Accomplishments that I'm proud of
- Successfully building a true "Taskmaster" that operates entirely outside of the standard chat loop.
- Implementing Gemma not as a gimmick, but as a functional security perimeter (Model Armor) to prevent prompt injection.
- Building the Multimodal Wash Comparison Agent that doesn't just look at photos, but cross-references visual hair health with historical climate data to generate accurate insights.
What I learned
I learned that true Agentic architecture requires strict engineering discipline. You can't just string prompts together and hope for the best. To build something production-ready, you need isolated tools, deterministic fallbacks, self-healing try/catch blocks, and rigorous security boundaries. I also learned how powerful it is to route different tasks to specialized models (Gemini for reasoning/vision, Gemma for security).
What's next for Curl Chemist
The next step is building a proactive Shopping Agent. When Curl Chemist notices you are running low on a safe product, or if it detects a severe pH clash on your shelf, it will autonomously research alternatives available in your local area, verify their ingredients against the rule engine, and queue them up in your cart.
Built With
- ai-agents
- automation
- backend
- cloud-dlp
- cloud-pub/sub
- cloud-scheduler
- cloud-storage
- fastapi
- firestore
- gemini-3.5-flash
- gemma
- generative-ai
- google-calendar-api
- google-cloud
- google-cloud-run
- google-genai-sdk
- open-meteo-api
- python
- react-framework
- rest-api
- serverless
- uvicorn
- vertex-ai
Log in or sign up for Devpost to join the conversation.