iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📚

alche:me: 'Alchemy' for Your Sleeping Cosmetics. A Beauty Revolution through Intelligent Consumption Driven by 16 Autonomous AI Agents

に公開
2026/02/16

Introduction: The Cosmetic Paradox

"I own so many cosmetics, yet I can never decide on my makeup every morning."

"I want to copy the cute look I saw on social media, but I don't have the same items."

I have named this phenomenon the "Cosmetic Paradox." It is a state where, despite having abundant cosmetic inventory as assets, the daily utilization rate is low, and the sheer number of options leads to "decision fatigue" and "guilt over dead stock."

"alche:me", which I developed, is your dedicated autonomous AI agent team that synthesizes infinite possibilities from such "dormant cosmetics (Dead Stock)."

Changes Brought by alche:me

Item Before (Ruts) After (Using alche:me)
Morning Choice 5 minutes of hesitation, then "playing it safe" Confidence and ease choosing from AI suggestions in 1 minute
Dormant Cosmetics A symbol of guilt Excitement as material for a "new look"
Purchasing Behavior Duplicate buying of similar colors Strategic additions based on inventory compatibility analysis
Makeup Records "What did I wear today?" Accumulating daily achievements with Beauty Log
User Psychology "I have to buy to change" "I can shine more with what I already have"

1. Project Overview

Target Users and Pain Points (The Pain)

Working women in their 20s-40s. They often become "cosmetic lost children," buying new releases and limited editions only to let them deteriorate in the back of their vanity.

Solution: Solving with Agentic AI (The Solution)

alche:me is not just an inventory management app. It is a full-stack PWA application where 10 specialized AI agents built with Google Cloud's Agent Development Kit (ADK) autonomously collaborate to plan, execute, and refine solutions toward a goal (the look you want).

  • Asset Management: Just snap a photo with your smartphone, and the AI appraises and registers the item. Product information is automatically supplemented via the Rakuten API.
  • Alchemy (Synthesizing): Generates combinations (recipes) to reproduce your desired look using "only the inventory on hand." 0% hallucination rate.
  • Visualization: Gemini 2.5 Flash generates a look image using an AI character, helping you choose intuitively.
  • Recording: Record daily makeup in the Beauty Log. Utilize it for preference analysis and identifying makeup ruts.
  • Sharing: Publish recipes via social features. Form a beauty community with follows, likes, and comments.
  • Circulation: Check inventory compatibility for items you're considering buying. Support smart shopping through overlap risk and gap analysis.

Implementation Scale

Item Number
AI Agents 10 (Concierge + 8 specialized agents + Simulator)
API Endpoints 25+
Automated Tests 160+ (Python 100 + Frontend 61 + E2E 5)
UI Components 30+
Frontend Screens 15 pages (6 tabs + 5 setting sub-pages + authentication)

💡 Beyond "Not Buying"

alche:me's goal is not simply to save money. It is a platform that sparks the "desire for beauty" through the experience of becoming beautiful with existing cosmetics, ultimately leading to "smart consumption of what is truly necessary."


2. Demo Video

Seeing is believing. Please take a look at how alche:me actually operates and how the agents think and collaborate.


3. System Architecture and "Control Flow"

alche:me adopts a BFF (Backend for Frontend) configuration using Next.js 16 (Cloud Run) for the frontend and Python ADK + FastAPI (Cloud Run) for the backend brain.

Here, I will explain the overall "infrastructure configuration" of the system, separating it from the "command and control system" of the agents operating within it.

3-1. Infrastructure Overview (Infrastructure View)

User requests are passed securely to the Agent Server via the BFF and linked with Firestore.

Figure 1: BFF architecture utilizing Google Cloud

  • Frontend: A PWA built with Next.js 16 (React 19). Runs on Cloud Run. Supports offline caching via Service Worker.
  • BFF: Next.js API Routes perform authentication (Firebase Auth Token validation) and function as a gateway to the Agent Server. It also proxies SSE streaming.
  • Agent Server: FastAPI + Google ADK deployed on Cloud Run. The ADK Runner class manages agent execution, event streaming, and tool invocation.
  • Persistence: Session persistence via DatabaseSessionService (SQLAlchemy). Cross-session memory via InMemoryMemoryService.
  • Data: Cloud Firestore (users, inventory, recipes, Beauty Log, SNS) + Cloud Storage (preview images).

3-2. Agent Orchestration (Agentic View)

Next is the visualization of the core of this system: the "autonomous operation of AI agents."
I built a "command and control system (Control Flow)" where the Root Agent (Concierge) acts as the commander, determining user intent and dynamically routing it to the 8 specialized agents.

Figure 2: Autonomous command and control system headed by Concierge

List of Agents (10 total)

Concierge (Root Agent / gemini-2.5-flash)
├── Inventory Manager     — Cosmetic image recognition & inventory management
├── Product Search        — Product supplementation via Google Search + Rakuten API
├── Cosmetic Alchemist    — Recipe generation using only hand-on inventory
├── Memory Keeper         — Record and retrieval of Beauty Log
├── Trend Hunter          — Trend analysis from SNS/beauty media
├── TPO Tactician         — Makeup suggestions based on weather/plans
├── Profiler              — Preference tendency analysis & rut detection
├── Makeup Instructor     — Substitution techniques & procedural guidance
└── Simulator (stub)      — Preview image generation (server-side post-processing)
  • Intent Classification: Concierge categorizes user intent using 9 routing rules defined in the system prompt.
  • "Leave it to me" Theme Proposals: For vague requests like "What's my makeup today?", Concierge checks inventory and proposes 3 theme ideas. It delegates to the Alchemist after selection.
  • Shopping Consultation: Concierge analyzes compatibility for items under consideration using tools directly.

Innovation in Development Process: Utilizing Claude Code

In the development of this project, I fully utilized Claude Code (Opus 4.6) from Phase 1 MVP construction to Phase 2/3 10-batch implementation.

By receiving AI-powered coding support, humans were freed from creating boilerplate code and could concentrate all resources on agent prompt design and injecting product philosophy. This was truly a next-generation development experience where humans and AI collaborate.


4. Deep Dive: The Behind-the-Scenes of Agentic Implementation

We implemented not just a simple API wrapper, but "agents that autonomously think, judge, and correct." Here are the technical highlights.

① Autonomous Routing: Concierge Intent Classification

Concierge is not just a proxy, but an autonomous router that interprets a user's vague intent and selects the optimal agent.

For example, when receiving a vague request like "Suggest a makeup look for today," it does not immediately delegate to the Alchemist; instead, it checks the inventory first and presents three theme ideas:

I've thought of a makeup look perfect for you today!
Which theme catches your eye? ✨

1️⃣ **Natural Translucent Makeup** — A light finish that brings out your bare skin
   Utilize those beige shadows that have been sleeping!

2️⃣ **Mature Chic Makeup** — A neat, polished look that shines in the office
   Time for that matte lipstick you haven't used lately

3️⃣ **Korean Idol Glow Makeup** — Focused on glossy skin and sparkling eyes
   A combination of glitter shadows and highlighter

At this time, it uses the get_inventory_summary and get_today_context tools to proactively retrieve inventory bias, season, and items not used for over 30 days to reflect them in the suggestions.

[Case: Rainy Day Date Makeup]

Requests mentioning weather or TPO are delegated to the tpo_tactician_agent:

  • TPO Tactician: Retrieves weather via OpenWeatherMap API → "80% humidity in the rain. Waterproof recommended, matte finish to prevent smudging."
  • Concierge: Instructs the alchemist_agent to create a recipe using the TPO analysis results as context.

By having the Concierge integrate the insights of multiple agents, we realize "context matching" that is impossible with simple searches.

② Complete Prevention of Hallucination: Inventory Constraint Engine

"Including items not in the inventory in a recipe" — This is a fatal problem for a makeup recipe generation AI. In alche:me, we have suppressed this hallucination rate to 0%.

3-Layer Prevention Mechanism

Layer 1: Prompt Constraints
Strictly define "Only items present in inventory can be used" in the Alchemist's system prompt.

Layer 2: validate_recipe_items Tool
A validation tool called by the Alchemist itself after recipe generation:

def validate_recipe_items(item_ids_json: str, tool_context: ToolContext) -> dict:
    """Verifies if all item IDs in the recipe exist in Firestore inventory"""
    user_id = _resolve_user_id(tool_context)
    item_ids = json.loads(item_ids_json)
    ref = _inventory_ref(user_id)
    missing = []
    for item_id in item_ids:
        doc = ref.document(item_id).get()
        if not doc.exists:
            missing.append(item_id)
    return {
        "status": "success",
        "all_valid": len(missing) == 0,
        "missing_items": missing,
    }

Layer 3: Quality Gate via Testing
Automatically verify the inclusion of non-inventory items with test_hallucination.py. This is executed every time in the CI/CD pipeline, setting Hallucination Rate = 0% as a quality gate (QG-1).

③ SSE Streaming: Real-time Thinking Visualization

By showing the agent's thought process to the user in real-time, we have turned the 45-60 second wait time into an "exciting experience."

5 Types of SSE Events

POST /api/chat → BFF (Next.js) → POST /chat (FastAPI) → ADK Runner
                                                            ↓
                                              SSE Event Stream
                                              ├── progress:       "Creating makeup recipe..."
                                              ├── text_delta:     Sequential text delivery
                                              ├── recipe_card:    Recipe JSON
                                              ├── preview_image:  Preview image URL
                                              └── done:           Completion signal

Tool/Agent Progress Messages

We detect tool calls and agent transfers from ADK events and convert them into Japanese progress messages:

_TOOL_PROGRESS_MAP = {
    "get_inventory_summary": "Checking hand-on cosmetics...",
    "validate_recipe_items": "Verifying items in recipe...",
    "save_recipe":           "Saving makeup recipe...",
    "get_weather":           "Retrieving weather info...",
    "analyze_preference_history": "Analyzing preference trends...",
    # ... for 18 tools
}
_AGENT_PROGRESS_MAP = {
    "alchemist_agent":     "Creating makeup recipe...",
    "trend_hunter_agent":  "Analyzing trends...",
    "profiler_agent":      "Analyzing preference trends...",
    # ... for 8 agents
}

On the frontend (React), we receive SSE with EventSource and sequentially render text via text_delta events. The recipe_card event dynamically displays an interactive recipe card.

④ Memory & Session: Self-healing Interaction Foundation

We implemented a mechanism for agents to function correctly even during long conversations.

Persistent Sessions

Conversation history is persisted to the DB via ADK's DatabaseSessionService (SQLAlchemy + aiosqlite). Conversations are not interrupted even after server restarts.

session_service = DatabaseSessionService(db_url="sqlite+aiosqlite:///sessions.db")
memory_service = InMemoryMemoryService()
runner = Runner(
    agent=root_agent,
    app_name="alcheme",
    session_service=session_service,
    memory_service=memory_service,
)

Automatic Session Overflow Recovery

When a session exceeds 20 events, ADK's InMemoryMemoryService automatically extracts important memories (user preferences, past recipe trends). Afterwards, the session is reset, and the memories are utilized in a new session.

Even if a token limit error occurs, it is automatically reset & retried. The dialogue continues without the user noticing.


5. Implementation Overview: 6 Experience Tabs

alche:me's frontend is designed as a mobile-first PWA. It features six tabs in a glassmorphism bottom navigation, each providing independent functionality.

Tab Icon Functional Overview
Concierge ✨ AI chat. SSE streaming dialogue, recipe card display, and preview image generation
Feed 📰 SNS feed. Recipe publishing, following, liking, commenting. Infinite scroll
Scan 📷 Cosmetic scan. Multi-image support (up to 4), appraisal effects, Rakuten API candidate display
Vanity 📦 Inventory list. Category filters & search. Item details show specs, remaining amount, and PAO
Recipe 📖 Recipe list. Management of AI-generated recipes, public/private toggling, one-tap rating
Log 📅 Beauty Log. Calendar view for daily makeup records. Mood, weather, and rating

Preview Image Generation (Simulator)

After recipe generation, we use the native image generation capability of Gemini 2.5 Flash on the server side to automatically generate preview images of the AI character wearing the makeup. This is processed asynchronously with a 15-second timeout and delivered via the preview_image SSE event. No user photos are used, ensuring privacy protection.

SNS Features

Inspired by Cookpad/WEAR, we implemented recipe-sharing SNS features:

  • Cursor-based pagination: Infinite scroll using Firestore startAfter
  • Follow/Like: Guaranteed counter consistency via Firestore transactions
  • Comment + Quick Reactions: 3 types: "Lovely!", "Want to try!", "Helpful!"
  • User Profile: Follower count, post count, and public profile

6. Testing and Quality Assurance

Testing Pyramid

Layer Tool Number of Tests Target
Python Unit pytest 100+ Tool functions, prompt quality, schema validation
Frontend Vitest 61+ API Route, components, hooks, security
E2E Playwright 5 Authentication → Scan → Recipe generation → Inventory → Details

CI/CD Pipeline

Two jobs are executed in parallel via GitHub Actions:

jobs:
  frontend:   # TypeScript type check + Vitest
  agent:      # Python pytest (100+ tests)

Quality Gates

Gate Criteria Status
QG-1: Hallucination Rate 0% (No out-of-inventory item inclusion) ✅ 0%
QG-7: Unit Tests All tests passed ✅ 160+ pass
QG-9: E2E Major flows passed ✅ 5 specs pass

7. Future Prospects

alche:me is an attempt to redefine the value of "what you possess" through technology. It currently operates with 10 agents, but we are planning further expansions.

Batch 9: Phase 3 Agent Addition → 14 Agents

Agent Role
Content Curator Reverse lookup of YouTube videos and recipes using hand-on items
Health Monitor Proposals based on physical condition via Google Fit / Apple HealthKit integration
Event Strategist Beauty To-Do list calculated backward from calendar events
Product Scout Real-time Rakuten/Amazon inventory search

Batch 10: B2B Foundation + Community Expansion

  • BigQuery Data Analytics Platform: B2B insights on "which cosmetics are used in combination with what"
  • Recipe Tree Visualization: Visualizing the chain from original → arrangement
  • Tsukurepo (Arrangement Posts): Arranging other users' recipes with your own inventory
  • Tag Community: Tag-based communities like #SpringType #AffordableCosmetics

Technical Evolution

  • VertexAI RAG Memory: Migration from InMemoryMemoryService → Persistent RAG-based memory
  • BigQuery ML K-means: Enhanced Profiler preference clustering
  • Google Calendar API Integration: Automating TPO Tactician's schedule retrieval

Conclusion

Starting from a prototype, alche:me has grown into a full-stack PWA application with 10 AI agents, over 25 API endpoints, over 160 automated tests, and 6 experience tabs.

I am convinced that the combination of Gemini and ADK can create a "partner that autonomously thinks, collaborates, and learns" beyond a traditional "chatbot."

"You can shine more with what you have" — I want to deliver this experience to as many "cosmetic lost children" as possible.

Thank you for reading this article to the end!

Discussion