Inspiration
E-commerce search shouldn't require a data science team.
While exploring Elasticsearch's capabilities, I realized that small-to-medium e-commerce stores face an impossible choice: stick with basic keyword matching, or hire expensive experts to unlock advanced search features. Amazon has teams of data scientists tuning relevance—but what about the millions of Shopify and WooCommerce stores?
I wanted to bridge this gap using AI. What if Elasticsearch could automatically discover product schemas, understand natural language, and build intelligent queries—without any manual configuration? That's how ShopQuery was born.
## What it does
ShopQuery is an open-source AI search layer that transforms any e-commerce platform into an intelligent product discovery engine.
Instead of forcing users to search with exact keywords, ShopQuery understands natural language intent:
- User: "gaming laptop and accessories under $1500 for teenager"
- ShopQuery: Understands categories (laptops, gaming accessories), constraints (price, age), searches across multiple categories, and returns intelligently ranked results
Key capabilities:
- 🧠 Natural language understanding - Shoppers describe what they want naturally
- 🔍 Zero-config schema discovery - Auto-learns product structure using Elasticsearch aggregations
- 🎯 Multi-category reasoning - Searches across categories and ranks by complete intent
- 📡 Real-time transparency - Streams status updates so users see what the AI is doing
It works as a drop-in layer for Shopify, WooCommerce, or any platform using Elasticsearch—no migration required.
## How we built it
Architecture: 4-tool agentic pipeline combining Elasticsearch + Google Gemini
Tech Stack:
- Elasticsearch - Schema discovery via aggregations, hybrid search, full-text queries
- Google Gemini 2.5 Flash - Intent parsing, query generation, intelligent ranking
- Go - High-performance REST API backend
- React + TypeScript - Demo frontend with real-time streaming
- Docker + Terraform - Local development and GCP deployment
The Pipeline:
- Intent Understanding (Gemini) - Parses natural language into structured queries
- Schema Discovery (Elasticsearch) - Uses aggregations to auto-discover product fields
- Dynamic Search (Gemini + Elasticsearch) - Builds optimized queries per category
- Intelligent Ranking (Gemini) - Ranks results across categories by relevance
Why this stack? Elasticsearch is already standard in e-commerce, so adoption is frictionless. Gemini adds intelligence without replacing existing infrastructure.
## Challenges we ran into
1. Schema Discovery Reliability Getting Elasticsearch aggregations to reliably discover schemas across diverse product catalogs was tricky. Different stores structure data differently—some use nested objects, others use flat fields. I built a robust field sampling system that handles various data structures.
2. Streaming NDJSON with Go Implementing real-time status updates required streaming NDJSON responses from the Go backend. Managing goroutines, ensuring proper connection handling, and preventing memory leaks while streaming LLM responses took several iterations to get right.
3. Query Generation Consistency Gemini sometimes generated invalid Elasticsearch query DSL. I implemented JSON mode with strict validation, retry logic, and fallback strategies to ensure reliable query generation even when schemas are complex.
4. Cross-Category Ranking Teaching the AI to rank products across different categories fairly was challenging. A $1,200 laptop isn't directly comparable to a $50 mouse. I solved this by having Gemini consider the original intent holistically rather than just price or similarity scores.
## Accomplishments that we're proud of
✅ Novel use of Elasticsearch aggregations - Auto-discovering schemas in real-time without manual configuration is a unique approach I haven't seen elsewhere
✅ Production-ready system - Not just a prototype—fully deployable with Docker Compose locally or Terraform on GCP, complete with proper error handling and caching
✅ Real transparency - The streaming status updates give users complete visibility into what the AI is doing, building trust instead of being a black box
✅ Platform-agnostic design - Works with any e-commerce platform, making it widely applicable
✅ Actual demo with real data - Indexed 1,354 real products across 26 categories and the searches genuinely work well
✅ Open source with MIT license - Committed to democratizing intelligent search for everyone
## What we learned
Elasticsearch is incredibly powerful beyond basic search. The aggregation framework can do so much more than faceted search—it's perfect for schema discovery, analytics, and dynamic query building. Most developers underutilize it.
Agentic AI architectures are the future. Breaking the system into specialized tools (intent understanding, schema discovery, search, ranking) made it modular, testable, and actually explainable—unlike monolithic LLM approaches.
Streaming beats polling for UX. Real-time NDJSON updates transformed the user experience. Instead of a loading spinner, users see exactly what's happening: "Discovering categories... Searching laptops... Ranking results..."
Small stores need this. While building, I talked to several Shopify store owners. They're frustrated with search but can't afford Algolia or custom development. There's a real market for intelligent, affordable search.
LLMs + traditional search = best of both worlds. Elasticsearch handles scale and speed, Gemini adds reasoning and understanding. Neither alone would work—together they're powerful.
## What's next for ShopQuery
### Immediate (Post-Hackathon)
- [ ] Shopify & WooCommerce plugins - One-click integration for popular platforms
- [ ] Conversation history - Multi-turn queries like "show me cheaper options" or "what about gaming headsets?"
- [ ] Performance optimizations - Query result caching, smarter schema cache invalidation
### Medium-Term
- [ ] Vector embeddings - Add semantic search using Elasticsearch's vector capabilities
- [ ] Analytics dashboard - Show store owners popular queries, search trends, conversion metrics
- [ ] A/B testing framework - Compare AI search vs traditional to prove ROI
- [ ] Pre-built connectors - BigCommerce, Magento, custom REST APIs
### Long-Term Vision
- [ ] Multi-language support - Leverage Gemini's multilingual capabilities
- [ ] Visual search - Upload images to find similar products
- [ ] Personalization engine - Learn user preferences over time
- [ ] Recommendation system - "Customers who searched for X also liked Y"
- [ ] SaaS offering - Hosted version for non-technical store owners
Built With
- elastic
- elasticsearch
- gcp
- go
Log in or sign up for Devpost to join the conversation.