# Aglaea - AI-Powered Fashion, Beauty & Personal Style Platform

Aglaea (Greek goddess of beauty, splendor, glory, magnificence, and adornment)
is the comprehensive fashion, beauty, skincare, haircare, and personal styling
domain. Named after one of the three Charites (Graces), Aglaea represents the
pinnacle of AI-driven personal style intelligence.

## Domain Overview

Aglaea provides end-to-end personal style intelligence across fashion, beauty,
skincare, haircare, fragrance, and accessories. The platform combines computer
vision analysis (skin biomarkers, body measurements, color profiling), trend
forecasting, fabric intelligence, and recommendation engines to deliver
hyper-personalized styling advice at scale.

## Target Metrics (Industry-Leading SOTA)

| Capability                  | Target    | Reference           |
| --------------------------- | --------- | ------------------- |
| Body type classification    | 94%+      | Academic research   |
| Trend forecasting accuracy  | 91%+      | Heuritech           |
| Skin analysis biomarkers    | 150+      | Haut.AI             |
| Fabric identification       | 99.99%+   | Style3D             |
| Color analysis accuracy     | 90-95%    | Dressika/Glance     |
| Fit satisfaction prediction | 0.74+     | FashionINSTA        |
| Return rate reduction       | 17-28%    | McKinsey/Fytted     |
| Virtual try-on conversion   | 90%+ lift | Industry benchmarks |
| Fragrance first-pick match  | 90%+      | AI scent matching   |

## Architecture

```
libs/aglaea/
├── core/                       # Domain foundation: types, schemas, color science, validation
├── database/                   # Prisma schemas, migrations, seeding
├── sdk/                        # Unified SDK & TypeScript client
├── events/                     # Domain event types & pub/sub integration
├── ai-orchestrator/            # Model routing, A/B testing, fallback strategies
├── testing/                    # Mock factories, fixtures, test utilities
│
├── skin-analysis/              # Skin biomarker detection & analysis
├── enhanced-skin-analysis/     # Advanced skin condition tracking
├── color-analysis/             # Seasonal color analysis & palette generation
├── body-analysis/              # Body type classification & measurement
├── enhanced-body-measurement/  # Precision body measurement pipeline
├── face-shape-analysis/        # Face shape detection & recommendations
├── hair-analysis/              # Hair type, texture & condition analysis
├── enhanced-hair-analysis/     # Advanced hair profiling & diagnostics
├── nail-analysis/              # Nail health & style analysis
│
├── fashion-taxonomy/           # Garment classification & style taxonomy
├── fabric-identification/      # Fabric type detection & properties
├── fabric-properties/          # Fabric care, durability, sustainability data
├── fit-prediction/             # Size & fit prediction engine
├── comfort-prediction/         # Comfort scoring & prediction
├── style-taxonomy/             # Style classification & vocabulary
├── style-evolution/            # Personal style evolution tracking
├── style-history/              # Fashion history & period analysis
│
├── outfit-recommendation/      # AI outfit generation & scoring
├── wardrobe-management/        # Digital wardrobe CRUD & analytics
├── occasion-engine/            # Context-aware occasion-based styling
├── trend-forecasting/          # Trend detection, prediction & lifecycle
├── material-trends/            # Fabric & material trend analysis
├── celebrity-style/            # Celebrity look matching & recreation
├── cultural-adaptation/        # Culture-aware styling adjustments
├── inclusive-fashion/          # Size-inclusive & adaptive fashion
│
├── skincare-routine/           # Personalized skincare regimen builder
├── hair-routine/               # Hair care routine optimization
├── nail-care/                  # Nail care routine & product matching
├── ingredient-intelligence/    # Cosmetic ingredient analysis & safety
├── ingredient-scanner/         # Product label scanning & parsing
├── beauty-calendar/            # Seasonal beauty routine scheduling
├── wellness-beauty/            # Wellness-beauty connection analysis
├── aging-trajectory/           # Skin aging prediction & prevention
├── aesthetic-treatments/       # Non-invasive treatment recommendations
│
├── fragrance-intelligence/     # Scent profiling & recommendation
├── makeup-recommendation/      # Makeup shade & product matching
├── makeup-looks/               # Complete makeup look generation
├── hairstyle-recommendation/   # Hairstyle suggestion engine
│
├── shoe-recommendation/        # Footwear matching & sizing
├── bag-recommendation/         # Handbag & bag styling
├── jewelry-recommendation/     # Jewelry matching & layering
├── advanced-jewelry/           # Fine jewelry & gemstone intelligence
├── watch-recommendation/       # Watch styling & matching
├── eyewear-recommendation/     # Glasses & sunglasses matching
├── hat-recommendation/         # Headwear styling
├── belt-styling/               # Belt coordination engine
├── scarf-styling/              # Scarf & wrap styling
│
├── virtual-tryon-fashion/      # Garment virtual try-on
├── virtual-tryon-makeup/       # Makeup virtual try-on
├── virtual-tryon-hair/         # Hairstyle virtual try-on
├── virtual-tryon-nails/        # Nail art virtual try-on
├── virtual-tryon-accessories/  # Accessories virtual try-on
├── avatar-creation/            # Digital avatar generation
├── before-after/               # Before/after comparison engine
│
├── personal-shopper-ai/        # AI personal shopping assistant
├── shopping-assistant/         # Product discovery & comparison
├── shopping-concierge/         # Premium shopping concierge service
├── agentic-shopping/           # Autonomous shopping agent
├── product-matching/           # Product similarity & matching
├── retailer-api/               # Retailer integration layer
├── digital-product-passport/   # Product provenance & authenticity
│
├── preference-learning/        # User preference ML pipeline
├── lifestyle-profiler/         # Lifestyle analysis & profiling
├── unified-profile/            # Cross-module user profile aggregation
├── memory-system/              # Interaction memory & context
├── conversation-engine/        # Natural language style consultation
├── multi-modal-input/          # Voice, image, text input processing
│
├── sustainability-scoring/     # Environmental impact scoring
├── sustainable-fashion/        # Eco-friendly fashion intelligence
├── care-intelligence/          # Garment care & maintenance
├── laundry-integration/        # Smart laundry & care scheduling
├── generative-design/          # AI fashion design generation
│
├── style-coaching/             # AI style coaching & education
├── style-communities/          # Social style communities
├── outfit-sharing/             # Outfit sharing & social features
├── inspiration-feed/           # Style inspiration content feed
├── expert-network/             # Human stylist marketplace
├── family-features/            # Family & group styling
├── event-prep/                 # Event-specific styling preparation
├── calendar-integration/       # Calendar-aware styling
├── gamification/               # Style gamification & rewards
│
├── smart-mirror/               # Smart mirror integration
├── smart-device/               # IoT & wearable integration
├── biometric-integration/      # Health data for personalization
├── weather-service/            # Weather-aware styling
├── sophia-integration/         # Cross-domain knowledge integration
├── ethical-ai/                 # Bias detection & fairness
├── api-services/               # REST/GraphQL API layer
└── README.md
```

## Key Libraries

### Foundation

- `@aglaea/core` - Types, schemas, color science, body/skin/hair analysis
  algorithms, validation
- `@aglaea/database` - Prisma schemas, migrations, seeding for all domain
  entities
- `@aglaea/sdk` - Unified TypeScript client for external consumers
- `@aglaea/events` - Domain events for analysis, recommendations, purchases
- `@aglaea/ai-orchestrator` - Model routing, versioning, A/B testing, fallbacks
- `@aglaea/testing` - Mock factories, fixtures, integration test utilities

### Analysis Engines

- `@aglaea/skin-analysis` - 150+ biomarker detection (pores, wrinkles,
  pigmentation, hydration)
- `@aglaea/color-analysis` - Seasonal color analysis with 12 subtypes, palette
  generation
- `@aglaea/body-analysis` - Body type classification, proportional analysis
- `@aglaea/hair-analysis` - Hair type, texture, porosity, scalp health analysis
- `@aglaea/face-shape-analysis` - Face shape detection for accessory/hairstyle
  matching

### Recommendation Engines

- `@aglaea/outfit-recommendation` - Context-aware outfit generation
- `@aglaea/fragrance-intelligence` - Scent profiling, layering, occasion
  matching
- `@aglaea/makeup-recommendation` - Shade matching, product compatibility
- `@aglaea/fit-prediction` - Size prediction and fit satisfaction scoring

## Configuration

| Variable              | Description                  | Default                                              |
| --------------------- | ---------------------------- | ---------------------------------------------------- |
| `AGLAEA_DATABASE_URL` | PostgreSQL connection URL    | `postgresql://oshun:oshun_dev@localhost:5432/aglaea` |
| `AGLAEA_REDIS_URL`    | Redis connection for caching | `redis://localhost:6379/5`                           |
| `AGLAEA_S3_BUCKET`    | S3 bucket for image storage  | `aglaea-images`                                      |
| `AGLAEA_AI_ENDPOINT`  | AI model inference endpoint  | `http://localhost:8080`                              |
| `AGLAEA_API_PORT`     | API server port              | `4034`                                               |

## Development

```bash
# Run core tests
cd libs/aglaea/core && npx vitest run

# Type check
cd libs/aglaea/core && npx tsc --noEmit

# Run specific library tests
cd libs/aglaea/<library> && npx vitest run
```
