Domain libraries · entity catalog

aglaea library

Authored subsystem deep-dive for aglaea, layered on the code-linked entity catalog — what each system is, why it exists, and how it fits.

authored deep-dive
94entities3layers93deep-dives

On this page

The libs/aglaea/ area: 93 Nx libraries that make up Aglaea, the AI-powered fashion, beauty, skincare, haircare and personal-styling domain — a TypeScript foundation tier plus dozens of focused analysis, recommendation, try-on, commerce and engagement engines.

What this area is#

Aglaea (named for the Grace of beauty and adornment) is a single domain split into many small, sharply-scoped Nx libraries rather than one monolith. Every project lives under libs/aglaea/<name>/ and publishes as @aglaea/<name>; each is a normal buildable TypeScript library with a src/ barrel (index.ts), usually a types.ts (database and testing organize theirs differently), and one or more engine modules, plus a colocated *.spec.ts / *.test.ts. There are no empty scaffolds in this area — the smallest package is ~750 LOC and the largest (@aglaea/skin-analysis) is over 10,000 LOC across 49 files. The README at libs/aglaea/README.md is the canonical map of the area.

The libraries fall into a few tiers. A foundation tier (core, database, sdk, events, ai-orchestrator, testing, api-services) owns shared types, persistence, the client SDK, the event bus, model orchestration and contract definitions. On top of it sit analysis engines (skin, body, hair, face, nail, color, fabric) that turn images/measurements into structured profiles; recommendation/curation engines (outfit, occasion, trend, accessory families) that turn profiles into suggestions; virtual try-on / visualization engines that produce render instructions; commerce libraries (shopping assistants, retailer API, product passport); personalization libraries (preference learning, unified profile, conversation); sustainability/care libraries; social/engagement libraries; and device/integration libraries.

The implementation style across the area is domain-specific and science-grounded, not generic CRUD: @aglaea/makeup-recommendation matches foundation shades in CIE L*a*b* with Delta E, @aglaea/weather-service computes PMV/PPD thermal comfort and WBGT, @aglaea/laundry-integration encodes ISO 3758 care symbols, @aglaea/ethical-ai computes equalized-odds and demographic-parity fairness metrics, and @aglaea/enhanced-hair-analysis implements a SALT-score trichoscopy model. Most engines are pure functions and plain data tables (the CLASSES surface is small); the stateful infrastructure (caching, queues, registries, clients) is concentrated in the foundation tier.

How it fits the wider system#

The foundation tier is the hub: nearly every leaf engine depends on @aglaea/core for shared types, color science, validation and cross-cutting infra. @aglaea/database owns the Prisma-style schema and migrations all persisted entities map to; @aglaea/events defines the domain event taxonomy that @aglaea/api-services and engines emit; @aglaea/sdk is the typed client external consumers use; @aglaea/ai-orchestrator is the seam through which engines that need model inference route their calls (with A/B testing, fallback and cost tracking). @aglaea/sophia-integration is the seam designed for cross-domain style Q&A — a self-contained query-router over supplied knowledge entries, intended to front a Sophia knowledge base (not an actually-wired edge). The analysis engines are upstream of the recommendation and try-on engines (a skin or body profile feeds outfit, makeup and fit suggestions), which in turn feed the commerce and engagement layers. Walk the "used by" edges on any node below to see the exact composition.

Entity catalog (94)#

The 94 tracked Nx projects in aglaea, each a code-linked entity node — package, type, source path, declared targets, and its internal dependency graph (depends-on / used-by, resolved from the package manifests, §6/§8), read from the project graph. Grouped by architectural layer; walk the dependency links to travel the system. 93 of these carry an authored deep-dive (what / why / how it fits); the rest are generated scaffolds awaiting one.

data (1)#

lib

@aglaea/database

#

The persistence layer (libs/aglaea/database/src): per-entity schema modules under schema/ (profiles, products, wardrobe, outfits, recommendations, skin-analysis, fabrics, ingredients, trends, brands, body-measurements, social, audit, feedback, preferences, common), a set of timestamped migrations/, and operational helpers connection-pool.ts, read-replica.ts (ReplicaRouter) and backup.ts.

buildtestlint
layer: datascope: aglaeaowner: @GreyChimp

domain (91)#

lib

@aglaea/advanced-jewelry

#

Fine-jewelry/gemstone intelligence (libs/aglaea/advanced-jewelry/src): a jewelry-engine over a GEMSTONE_DATABASE and WATCH_DATABASE, with InvestmentAnalysis and AuthenticityCheck (gemstone hardness, provenance).

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/agentic-shopping

#

An autonomous shopping agent (libs/aglaea/agentic-shopping/src): an agent-engine driving a ShoppingAgent over AgentActions, routing to SPECIALIST_MODELS (scoreSpecialistMatch) and carrying a StylePassport across a ShoppingSession.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/aging-trajectory

#

Skin-aging prediction and prevention (libs/aglaea/aging-trajectory/src): an aging-predictor, a progression-model and evidence-based prevention-scoring.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/ai-orchestrator

#

Model management and inference orchestration (libs/aglaea/ai-orchestrator/src, 12 modules): ModelRegistry, ABTestManager, fallback strategies (FallbackChain, CachedFallback, DegradedFallback), InferenceQueue, BatchInferenceProcessor, CostTracker, ModelMonitor, EdgeDeploymentManager, ModelWarmer, composed by the AIOrchestrator facade — the seam other engines route model calls through.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/api-services

#

The API contract/registry layer (libs/aglaea/api-services/src, 14 modules): a barrel of endpoint definitions (analysis, conversation, profile, recommendation, trends, try-on, wardrobe), their event definitions (analysis/recommendation/ social/wardrobe events) and an api-registry. It is contract types + endpoint/ event definitions, not a running HTTP server.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/avatar-creation

#

Digital-avatar generation (libs/aglaea/avatar-creation/src): an avatar-generator (from measurements/presets) and an avatar-customizer with 30+ adjustable parameters.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/bag-recommendation

#

Handbag/bag styling (libs/aglaea/bag-recommendation/src): a bag-engine that matches by occasion, body proportion, style preference and functional need (including size-by-body-type).

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/belt-styling

#

Belt coordination (libs/aglaea/belt-styling/src, ~4K LOC): a buckle-taxonomy, leather-grading, belt-sizing, body-shape-belting, belt-outfit-coordination and belt-care, composed by a belt-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/biometric-integration

#

Health-data personalization (libs/aglaea/biometric-integration/src): a biometric-collector, appearance-impact assessment and trend-analysis over collected metrics.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/calendar-integration

#

Calendar-aware styling (libs/aglaea/calendar-integration/src): event extraction, dress-code inference, outfit-reminder scheduling and packing-list generation from calendar/travel events.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/care-intelligence

#

Garment-care intelligence (libs/aglaea/care-intelligence/src): a care-guide with expert instructions for 40+ fabrics and a longevity-estimator.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/color-analysis

#

Personal color analysis (libs/aglaea/color-analysis/src, 11 modules): seasonal classification (12 subtypes), undertone analysis, contrast analysis, palette generation, and downstream makeup-matching / hair-color-matching / color-application, built on color-utils.ts.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/comfort-prediction

#

Climate-aware fabric comfort prediction (libs/aglaea/comfort-prediction/src): climate-comfort (how a fabric performs in given weather) and sensitivity-matching for sensitive-skin wearers.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/core

#

The domain foundation (libs/aglaea/core/src, ~10.7K LOC across 21 modules): the shared types.ts/constants.ts, the algorithmic cores (color-science.ts, skin-analysis.ts, body-analysis.ts, hair-analysis.ts, fabric-intelligence.ts, fashion-taxonomy.ts, fragrance-profiling.ts, style-profiling.ts, trend-analysis.ts, recommendation-engine.ts), plus cross-cutting infrastructure used domain-wide — LRUCache/AglaeaCacheKeyBuilder, AglaeaLogger, ConfigManager, the typed AglaeaError hierarchy, TokenBucketLimiter/SlidingWindowLimiter, FeatureFlagManager and validation.ts. This is the most-depended-on package in the area.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/digital-product-passport

#

Product provenance and ESPR compliance (libs/aglaea/digital-product-passport/src, ~4.4K LOC): a dpp-engine plus espr-compliance, blockchain anchoring, data-carriers, supply-chain, repair-score, end-of-life and green-claims verification, with circularity/MCI scoring helpers.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/enhanced-body-measurement

#

A precision measurement pipeline (libs/aglaea/enhanced-body-measurement/src): MEASUREMENT_DEFINITIONS with getTypicalRange/validateMeasurement, plus pose-validation (validatePose, checkPoseCoverage) over a measurement-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/enhanced-hair-analysis

#

Advanced hair diagnostics (libs/aglaea/enhanced-hair-analysis/src): classification-scales, trichoscopy (density mapping and miniaturization ratios), hair-shaft-analysis (diameter classification against HAIR_DIAMETER_THRESHOLDS and coefficient-of-variation thresholds, plus a simulated pull test and calculateSALTScore for alopecia) and treatment-guidance.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/enhanced-skin-analysis

#

Advanced skin tracking layered on the base engine (libs/aglaea/enhanced-skin-analysis/src): an AdvancedBiomarker database, MultiAngleFusion (combining multiple AngleCaptures with quality-weighted fusion), a SkinAtlasEntry reference set, and a privacy-engine for sensitive-image handling.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/ethical-ai

#

Bias detection and fairness (libs/aglaea/ethical-ai/src, ~3.5K LOC): a fairness-metrics module computing demographic parity, equalized odds, equal opportunity, predictive parity, calibration and treatment equality (runComprehensiveFairnessAudit), plus a bias-engine, intersectional-bias, inclusive-language, database-gaps, remediation and model-card generation.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/event-prep

#

Event-specific styling preparation (libs/aglaea/event-prep/src): the event-prep module that builds preparation plans for a specific event.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/events

#

The typed domain event system (libs/aglaea/events/src): event type definitions plus an in-memory transport — InMemoryEventPublisher, EventConsumer, InMemoryEventStore, DeadLetterQueue, EventReplayer and EventAnalytics, with helpers.ts for constructing/validating payloads.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/eyewear-recommendation

#

Eyewear matching (libs/aglaea/eyewear-recommendation/src): an eyewear-engine selecting frames by face shape, measurements, style and color profile.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/fabric-identification

#

Textile identification (libs/aglaea/fabric-identification/src) grounded in fiber characteristics and weave structures: a fiber-identifier, weave-detector, texture-analyzer and an aggregate fabric-classifier.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/fabric-properties

#

Fabric performance and comfort data (libs/aglaea/fabric-properties/src): a scientifically-grounded performance-database (40+ fabrics) and a comfort-scorer.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/face-shape-analysis

#

Face-geometry analysis (libs/aglaea/face-shape-analysis/src): landmark detection, a face-shape-classifier, feature-analysis and proportion-analysis, producing style-recommendations (for hairstyle/ eyewear/accessory matching) and a face-analysis-report.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/family-features

#

Family/group styling (libs/aglaea/family-features/src, ~3.3K LOC): a family-engine, growth-tracking (height percentiles, predictHeight6Months, heightToChildSize, next-size-up date prediction), hand-me-down planning, child-safety and family-coordination.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/generative-design

#

AI fashion-design generation (libs/aglaea/generative-design/src): a design-engine that parses a DesignPrompt into ParsedDesignAttributes, producing a GeneratedDesign, MoodBoard and VisualizationSpec (design description/spec output, not pixel rendering).

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/hair-routine

#

Hair-care routine building for all types 1A–4C (libs/aglaea/hair-routine/src): wash-optimization, styling-routine and a treatment-scheduler.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/hat-recommendation

#

Headwear styling (libs/aglaea/hat-recommendation/src) with real millinery knowledge: a hat-database (32 styles), face-shape-matching, hat-sizing, hat-etiquette and hat-care, composed by a hat-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/ingredient-intelligence

#

Cosmetic-chemistry knowledge (libs/aglaea/ingredient-intelligence/src, ~4K LOC): a 100+-ingredient ingredient-database with INCI data, pH ranges and comedogenic ratings, plus ingredient-analysis and an interaction-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/ingredient-scanner

#

Product-label scanning (libs/aglaea/ingredient-scanner/src): INCI-list parsing with correctOcrErrors, a BarcodeLookup, an INGREDIENT_DATABASE, and a ScanResult/SafetyAlert surface checked against a UserSensitivityProfile.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/inspiration-feed

#

The style inspiration feed (libs/aglaea/inspiration-feed/src, ~4.6K LOC): feed-algorithms, content-sources aggregation (with a SourceRateLimiter), a personalization-engine, content-scoring and a diversity-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/laundry-integration

#

Textile-care science (libs/aglaea/laundry-integration/src, ~5.6K LOC): ISO 3758 care-symbols interpretation, evidence-based stain-treatment, detergent-matching, load-optimization, hygiene-science and seasonal-care.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/product-matching

#

Product similarity and dupe-finding (libs/aglaea/product-matching/src): a skin-profile-matcher (scoring products against skin type/concerns/sensitivities/ allergies) and a dupe-finder.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/shoe-recommendation

#

Footwear matching (libs/aglaea/shoe-recommendation/src): a shoe-engine covering occasion, outfit formality, body type, foot concerns, climate and heel guidance.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/skin-analysis

#

The flagship computer-vision skin engine (libs/aglaea/skin-analysis/src, 49 files, ~10.4K LOC). Biomarker detectors span acne, pores, wrinkles (forehead, glabellar, crow's-feet, nasolabial, marionette, neck), pigmentation (melasma, sun-spot, freckle, post-inflammatory, hypopigmentation), redness/rosacea/ inflammation, hydration/barrier, oiliness, texture, undertone, Fitzpatrick and UV damage — over the preprocessing pipeline (SkinImagePreprocessor, face-detection, segmentation, lighting, quality-validation) and a temporal layer (progress-comparison, significance-testing, milestone-detection).

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/smart-mirror

#

Smart-mirror integration (libs/aglaea/smart-mirror/src, ~4.4K LOC): a mirror-protocol with session/capability negotiation, AR-overlay generation, hardware-profiles, a lighting-engine, an interaction-engine and a widget-system.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/sophia-integration

#

Cross-domain knowledge integration (libs/aglaea/sophia-integration/src, ~5K LOC): query-routing of style Q&A over supplied knowledge entries, a citation-engine, knowledge-domains mapping and research-enhancement of recommendations. This is the seam designed to front a Sophia knowledge base — self-contained, not an actually-wired cross-domain edge.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/style-evolution

#

Personal-style change tracking over time (libs/aglaea/style-evolution/src): an evolution-tracker (phases/milestones), growth-metrics, and an evolution-report with goal setting.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/sustainability-scoring

#

Fabric-level sustainability scoring (libs/aglaea/sustainability-scoring/src): LCA-based fabric-scoring (fiber lifecycle data) and supply-chain assessment.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/unified-profile

#

Cross-module profile aggregation (libs/aglaea/unified-profile/src): a profile-aggregator, cross-analysis insights, a recommendation-router and a profile-sync manager.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/virtual-tryon-hair

#

Hairstyle virtual try-on (libs/aglaea/virtual-tryon-hair/src): hair-color-viz and hair-style-viz producing color/style render parameters.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/virtual-tryon-makeup

#

Makeup virtual try-on (libs/aglaea/virtual-tryon-makeup/src): a face-mesh generator and a makeup-renderer producing layered makeup render specs.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/wardrobe-management

#

The digital wardrobe (libs/aglaea/wardrobe-management/src): digitization, organization, optimization (gap analysis) and analytics.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/watch-recommendation

#

Horological recommendation (libs/aglaea/watch-recommendation/src, ~5.2K LOC): a watch-database (30+ real watches), movement-guide, brand-heritage, investment-analysis, wrist-fitting and watch-care, composed by a watch-engine.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp
lib

@aglaea/weather-service

#

Weather-aware styling (libs/aglaea/weather-service/src, ~3.7K LOC): thermal comfort modeling (PMV/PPD), wind chill, heat index and WBGT in thermal-calculations, plus a layering-system, precipitation-gear, uv-protection, air-quality and an outfit-planner.

buildtestlint
layer: domainscope: aglaeaowner: @GreyChimp

infra (2)#

lib

@aglaea/sdk

#

The unified TypeScript client for external consumers (libs/aglaea/sdk/src): AglaeaClient over an AglaeaHttpClient, plus AglaeaWebSocket, auth providers (ApiKeyAuthProvider/TokenAuthProvider), RetryHandler, InterceptorManager, BatchProcessor, FileUploader and the AglaeaAPIError type.

buildtestlint
layer: infrascope: aglaeaowner: @GreyChimp
lib

@aglaea/testing

#

Self-contained test utilities for the domain (libs/aglaea/testing/src): mock factories, fixtures, mock-images, anonymization, integration helpers, plus a BenchmarkRunner, ChaosMonkey, SnapshotManager and TestContext.

buildtestlint
layer: infrascope: aglaeaowner: @GreyChimp