Case Study
Spidey Store
An AI-powered conversational commerce platform that translates natural-language shopping intent into structured product retrieval and recommendations.
Overview
Spidey Store demonstrates conversational shopping by mapping free-form user queries to structured MongoDB filters and dynamic recommendations.
Problem
Traditional e-commerce search often fails for semantic requests like style, color, and budget combinations expressed in natural language.
Why It Matters
Conversational retrieval makes discovery faster and more intuitive by preserving context across turns instead of forcing users through rigid filters.
Role
Built an end-to-end AI shopping assistant with multi-turn memory, retrieval orchestration, and a recommendation workflow.
Architecture
Decoupled FastAPI orchestration from retrieval and recommendation services: ProductSearchFilters -> ProductFilterNormalizer -> MongoQueryBuilder -> ProductSearchService, with a separate RecommendationService and SimilarityScorer.
Architecture Signal
Query
Pydantic AI Agent
Filter Extraction
Normalization
Mongo Query
Product Search
Recommendations
Results
Spidey Store Architecture
AI orchestration, structured retrieval, recommendation scoring, and MongoDB-backed product discovery flow.
Stack
Python 3.10+, FastAPI, Pydantic AI, MongoDB Atlas, Groq (Qwen 2.5 32B), Pydantic v2, Logfire, Vanilla JS, CSS
Implementation
Implemented Text2NoSQL filter extraction, colloquial term normalization, and modular query execution to support context-aware product search and recommendation flows.
Engineering Decisions
- Separated AI orchestration from retrieval and recommendation modules to keep the system extensible.
- Used schema-enforced filter extraction to convert unstructured chat into validated query inputs.
- Added observability with Logfire for tracing latency, database calls, and LLM tool behavior.
Challenges
- Interpreting ambiguous natural-language shopping intent reliably.
- Maintaining context continuity across multi-turn queries.
- Normalizing colloquial terms into canonical catalog attributes.
Solutions
- Built a structured retrieval pipeline with filter parsing, normalization, and query-building stages.
- Introduced a memory layer and context merger to persist session constraints across turns.
- Implemented content-based recommendation scoring across category, color, price, and ratings.
Results
Delivers context-aware conversational shopping and includes one-click seeding of 500+ products for rapid end-to-end testing.
Evaluation
Behavior is validated through interactive chat flows, structured retrieval outputs, and recommendation response checks documented in the API workflow.
Metrics
Seed dataset size
500+ products
Lessons
- Natural-language shopping benefits from strict schema mapping before query execution.
- Conversation memory materially improves multi-turn retrieval relevance.
Future Improvements
- Hybrid lexical plus vector search integration.
- Image-based product search workflows.
- Voice-driven shopping input.
- Authentication for persistent preference profiles.
- Redis-backed distributed session caching.