Inspiration

We have funerals when we lose loved ones — but everyday emotions have nowhere to go. The frustrations we can't voice, the anxiety that keeps returning, the regrets we can't let go of. No one has designed a farewell for them. So we built EmoFuneral: a sacred space where negative emotions are given a dignified farewell, transformed, and laid to rest.

What it does

EmoFuneral is an emotion healing web app that guides users through AI-powered therapeutic rituals to process negative emotions. Here's how it works:

  1. Express your worry — Users type or speak (via Gemini ASR with multilingual support) what's weighing on them.
  2. AI emotion analysis — The system classifies the emotion (Anger, Anxiety, Grief, Depression, Frustration, etc.) and recommends one of three rituals, each grounded in established psychotherapy:
    • Fire Ritual (CBT) — Cognitive Behavioral Therapy: challenges irrational beliefs, burns away distorted thinking, and crystallizes a new perspective.
    • Water Ritual (AEDP) — Accelerated Experiential Dynamic Psychotherapy: allows emotions to flow freely, validates the pain, and offers gentle comfort through ripples.
    • Earth Ritual (ACT) — Acceptance and Commitment Therapy: accepts the pain without resistance, plants it as a seed, and grows actionable commitments.
  3. Emotion Visualization — Gemini 2.5 Flash Image generates an abstract visual representation of the user's feelings, layered with dynamic particle effects. This materializes the intangible, providing a visual "vessel" to anchor and process complex emotions.
  4. Immersive ritual experience — Users watch their worry transform through animated ritual sequences (fire, water, earth) with synchronized sound effects and background music, choose from 3 AI-generated therapeutic perspectives, and witness their emotion become a totem (Crystal, Ripple, or Tree).
  5. Crisis safety net — When the system detects high-risk content (self-harm/suicidal ideation), it immediately provides professional safety resources (988 Lifeline, Crisis Text Line, 911) and grounding exercises instead of a normal ritual.
  6. Emotion Museum — Every completed ritual is preserved as a flip-card memory in a 3D carousel gallery, building a personal emotional archive where past pain is treasured as nourishment for growth.

How we built it

We built an end-to-end emotional processing pipeline powered by a multi-agent AI architecture using Google ADK (Agent Development Kit) and multiple Gemini models:

  • Multi-Agent Orchestration (Google ADK): The backend orchestrates multiple specialized AI agents — a Query Routing Agent (Gemini 2.5 Flash Lite) performs content validation and risk classification upfront; an Emotion Analysis Agent (Gemini 3 Flash Preview) classifies emotions and maps them to one of three therapy-grounded rituals: Fire (CBT), Water (AEDP), or Earth (ACT). Dedicated Ritual Agents then generate personalized cognitive reframing perspectives, with a Web Search Agent (Google Search grounding) providing real-time context for time-sensitive worries.
  • Crisis Safety Pipeline: A dedicated Crisis Support Agent detects high-risk content and immediately bypasses the normal ritual flow — designed with a fail-open architecture to never block users who need help.
  • AI-Powered Visual & Audio Experience: We prototyped the 3D particle orbs in Google AI Studio, enabling even our designer and product manager to vibe code interactive visual effects — accelerating the creative process across the whole team. The frontend (React 19 + Vite + TypeScript) features immersive ritual animations (fire, water, earth videos with synchronized audio effects and background music), 3D canvas-based particle orbs that morph colors to match AI-generated emotion images (Gemini 2.5 Flash Image with a dedicated Image Prompt Agent), and Framer Motion transitions throughout.
  • Multi-Modal Input & Emotion Museum: Users can input worries via text or voice (Gemini ASR with multilingual support and auto-punctuation). Every completed ritual is preserved in the Emotion Museum — because every sincere farewell deserves to be remembered.
  • AI Governance & Quality Assurance: We built a comprehensive LLM evaluation suite — Giskard scans for harmfulness, sycophancy, hallucination, and prompt injection; pydantic-evals with LLMJudge runs quality rubrics on ritual perspectives; all traced via Logfire observability.

Challenges we ran into

Specs-Driven Development with Coding Agents

We adopted a specs-driven development approach across the project. Detailed technical specs and PRDs were written upfront, then used as context for coding agents like Gemini to generate, review, and iterate on code. This applied to the full development lifecycle — from implementation to code review. While our team does have frontend experience, the sheer volume of immersive ritual animations and visual effects far exceeded what we could deliver manually within the hackathon timeframe. By pairing our specs with AI coding agents, even our designer and product manager could contribute to interaction development, significantly accelerating the path from concept to polished implementation.

Backend Challenge: Emotional Support vs. Sycophancy, and Taming Image Generation

An emotion healing app must validate users' feelings without blindly agreeing — sycophancy is therapeutically harmful. At the same time, we needed a guardrail layer to block harmful inputs (prompt injection, abusive text) before they reached the ritual agents. We built continuous evaluation tests for both: honest reframing over empty comfort, and reliable input filtering.

Another major challenge was image generation. Gemini 2.5 Flash Image would frequently fail when the safety block level was set high, rejecting prompts related to emotional content. Rather than lowering the safety threshold, we built a dedicated Image Prompt Agent with a feedback-retry loop: when image generation fails, the agent analyzes the rejection reason, regenerates a new prompt using Gemini's thinking mode, and retries — up to 3 attempts. This allowed us to keep strict safety settings while still reliably producing healing images for users.

Accomplishments that we're proud of

  • Multi-agent AI architecture built entirely on Google ADK with multiple Gemini model configurations, each optimized for its specific role (fast routing vs. deep reasoning vs. image generation).
  • Crisis safety pipeline that detects self-harm/suicidal ideation and provides immediate professional resources — designed to never fail closed, because blocking a user in crisis is the worst possible outcome.
  • Comprehensive AI governance — LLM evaluation suite covering safety, sycophancy, hallucination, prompt injection, and therapeutic quality, all traced with Logfire observability.
  • Psychology-grounded design — every ritual interaction maps directly to established therapeutic methodologies (CBT, AEDP, ACT), not just feel-good platitudes.
  • Immersive multi-sensory experience — fire/water/earth video animations with synchronized audio, 3D canvas particle orbs, and Framer Motion transitions that make the ritual feel sacred and meaningful.
  • Global team, global product — built across multiple time zones, supporting English and Chinese with i18next internationalization.

What we learned

Asynchronous Team Collaboration Across Time Zones: Facing the challenge of team members scattered across different time zones, we learned to build effective asynchronous workflows. By clearly defining task priorities and ownership upfront, we achieved smooth collaboration without relying on synchronous meetings. This experience taught us that distributed teams can move fast when communication is structured and intentional.

Practicing Responsible AI: While building the safety protection module, we developed a deeper appreciation for AI ethics. We learned how to pursue "emotional resonance" while using Gemini's language understanding to establish strict safety boundaries. When the system detects escalating emotional intensity or crisis signals, it immediately triggers gentle guidance toward professional help resources, rather than mechanical warning pop-ups. This balance between technological warmth and life safety was our biggest takeaway.

"Completion" Has More Humanistic Value Than "Deletion": Through the entire building process, our team reached a consensus: in the digital world, users need more than just "clearing space"; they need psychological closure. The Emotion Museum embodies this philosophy. Pain isn't something to discard, but something that can be transformed and treasured. This understanding will guide our future product thinking.

What's next for EmoFuneral

  • Expanded ritual animations — Bring the Earth and Water rituals to the same immersive animation quality as Fire, with unique visual sequences and soundscapes for each element.
  • Longitudinal emotional tracking — Analyze patterns across a user's Emotion Museum over time, offering AI-generated insights like "Your anxiety peaks on Sundays" or "You've processed 80% more anger this month than last."
  • Community features — A shared, anonymized Emotion Museum where users can see that they're not alone, with aggregate emotional trends and collective healing milestones.
  • Localization & global crisis support — Expand beyond English and Chinese to more languages, and adapt crisis resources (hotlines, text lines) for different countries and regions.
  • Security & user validation — Add user authentication, rate limiting, and security headers to verify user identity and protect API endpoints for production use.
  • Production deployment — Launch as a publicly available service with user accounts, persistent data, and performance optimization at scale.
  • Professional therapist referral — Partner with mental health platforms to offer seamless handoffs when the AI detects patterns that would benefit from professional support.
  • Native mobile app — Bring the full ritual experience to iOS and Android with haptic feedback during ritual animations for an even more tactile healing experience.

Built With

  • alembic
  • biome
  • bun
  • docker
  • fastapi
  • framer-motion
  • gemini-api
  • giskard
  • github-actions
  • google-adk
  • google-ai-studio
  • i18next
  • just
  • logfire
  • msw
  • pydantic
  • pydantic-evals
  • python
  • react
  • render.com
  • ruff
  • sqlalchemy
  • sqlite
  • tailwind-css
  • typescript
  • uv
  • vite
  • zustand
Share this project:

Updates