Caeliai – AI-Powered Fashion Research Assistant

Caeliai is an AI-powered fashion research assistant. Users interact with Caeliai via a chat interface to:

Core Features

Identify Fashion Items

From text descriptions or (planned) image uploads, Caeliai identifies specific items including brand, name, and details.

Get Market Data

Finds current retail and resale prices with direct links from a curated list of trusted online stores.

Discover Design Context

Estimates an item's debut season and retrieves relevant runway imagery.

Conduct Brand Analysis (Health & Manufacturing Focus)

For a given brand (and optional product category), Caeliai researches:

  • Typical primary materials used
  • Common manufacturing locations (leveraging importyeti.com)
  • Widely known health/safety certifications
  • Summary of potential human health considerations associated with identified materials

Live calls to the Perplexity Sonar API power all interactions. Usage is managed via a credit system.

How We Built It

Caeliai is built with a modern serverless architecture:

Frontend

  • Next.js 14 with TypeScript
  • React for the user interface
  • Deployed on Vercel

Backend API & Core Logic

  • Supabase Edge Functions (Deno runtime, TypeScript)
  • The chat-handler function handles:
    • User authentication (JWT verification via Supabase Auth)
    • Credit management (Supabase PostgreSQL)
    • Dynamic prompt construction for different query types
    • Secure calls to the Perplexity Sonar Pro API
    • Validation and parsing of Sonar responses

AI Engine

  • Perplexity Sonar Pro API
  • Uses:
    • search_domain_filter to constrain results to trusted domains (e.g., retail, runway, health research, importyeti.com)
    • response_format: json_schema for reliable, structured output
    • Planned support for both text and image input

Database & Authentication

  • Supabase PostgreSQL for storing user credits and chat history
  • Supabase Auth for user sign-up and login

Key Backend Logic

  • A token accumulator system converts Sonar token usage into "credits" for users

Challenges We Ran Into

Reliable Structured Output

Getting consistent JSON required extensive prompt engineering. Using response_format: json_schema improved reliability significantly.

API Parameter Nuances

Learning how to use parameters like search_domain_filter (with its domain limit and syntax) and json_schema involved careful testing and documentation review.

Balancing Detail with Brevity

Prompts needed to elicit detailed but concise responses that stay within token limits, especially for brand analysis.

Credit System Design

We iterated on a model that reflects token usage fairly across different query types. The final solution is a token-to-credit accumulator.

Accomplishments We're Proud Of

  • Integrated the Sonar API effectively with json_schema and domain filtering
  • Developed a unique brand analysis flow with health and supply chain insights
  • Built an end-to-end MVP with full auth, chat, API, and AI features in a short timeframe
  • Delivered a tool focused on health-conscious and transparent fashion research

What We Learned

  • json_schema is critical for building reliable LLM apps with structured outputs
  • Targeted domain filtering improves information relevance and accuracy
  • Iterative prompt engineering is key to optimizing LLM outputs
  • Serverless tools like Supabase Edge Functions are excellent for rapid, secure MVPs

What's Next for Caeliai

  • Launch a public waitlist and collect feedback
  • Expand the brand and item directory using Sonar insights
  • Create a "Caeliai Verified" system for trusted profiles
  • Refine health and sustainability scoring with more data
  • Add asynchronous research via models like sonar-deep-research
  • Implement full image upload and identification
  • Build a viral trend tracker analyzing social media brand buzz

Built With

  • database
  • docker-(for-local-supabase-dev)
  • edge-functions)-database:-supabase-postgresql-apis:-perplexity-sonar-pro-api-(core-ai-engine)
  • future:-stripe-api)-key-tools:-supabase-cli
  • git
  • javascript
  • languages:-typescript
  • python-(for-internal-cli-research-tool-not-part-of-deployed-app)-frontend-framework:-next.js-14-(with-react)-backend-framework/runtime:-supabase-edge-functions-(deno)-platform:-vercel-(frontend-hosting)
  • sql
  • supabase-(auth
  • supabase-api
Share this project:

Updates