How sujpatel/ai-agent-clothes works
This is the FastAPI backend for an AI wardrobe and outfit assistant. A user authenticates, uploads a garment photo or submits a flat-lay for detection and review, then confirms items for storage and search. For recommendations, the API retrieves available wardrobe candidates and asks Gemini to choose an outfit, optionally using live weather; it saves the conversation so the user can refine the result. The graph follows the sampled API and service calls, with README-documented integrations and capabilities included where source excerpts were limited.
Main entry points: main.py FastAPI routes · ingestion.py Garment tagging · detection.py Garment detection · vectorstore.py Wardrobe index
Components 19
API and identity
- FastAPI routes
app/main.py - JWT verification
app/auth.py
Wardrobe ingestion
- Image validation
app/uploads.py - Garment detection
app/detection.py - Garment tagging
app/ingestion.py - Clothing attributes
app/models.py - Flat-lay evaluation
eval_flatlay.py
Outfit recommendation
- Outfit composition
app/composition.py - Weather lookup
app/weather.py - Gemini retries
app/gemini_utils.py
Data and storage
- Photo storage
app/photo_store.py - Wardrobe index
app/vectorstore.py - Text embeddings
app/embeddings.py - Conversation sessions
app/session_store.py
External services
- Gemini API
- Pinecone
- Supabase
- Open-Meteo
Other components
- Mobile app user
Connections 27
- Mobile app user → FastAPI routes: sends requests
README.md - FastAPI routes → JWT verification: verifies identity
app/main.py - FastAPI routes → Image validation: validates images
app/main.py - FastAPI routes → Garment detection: detects batch items
app/main.py - FastAPI routes → Garment tagging: tags items
app/main.py - FastAPI routes → Photo storage: uploads and fetches
app/main.py - FastAPI routes → Wardrobe index: manages wardrobe
app/main.py - FastAPI routes → Outfit composition: requests outfit
app/main.py - FastAPI routes → Conversation sessions: loads and saves
app/main.py - Garment detection → Garment tagging: provides crop hints
README.md - Garment tagging → Clothing attributes: returns attributes
app/ingestion.py - Garment tagging → Gemini API: requests tags
README.md - Garment detection → Gemini API: requests boxes
README.md - Garment tagging → Gemini retries: uses retry wrapper
app/ingestion.py - Garment detection → Gemini retries: uses retry wrapper
app/detection.py - Wardrobe index → Text embeddings: embeds descriptions
app/vectorstore.py - Wardrobe index → Pinecone: queries and updates
app/vectorstore.py - Wardrobe index → Photo storage: deletes photo
app/vectorstore.py - Outfit composition → Wardrobe index: retrieves candidates
app/composition.py - Outfit composition → Gemini API: chooses outfit
app/composition.py - Outfit composition → Weather lookup: calls tool
app/composition.py - Weather lookup → Open-Meteo: fetches conditions
README.md - Conversation sessions → Supabase: reads and writes
app/session_store.py - Photo storage → Supabase: stores photos
app/photo_store.py - JWT verification → Supabase: verifies against JWKS
README.md - Flat-lay evaluation → Garment detection: evaluates detection
eval_flatlay.py - Flat-lay evaluation → Garment tagging: evaluates tagging
eval_flatlay.py