Add platform handlers for Shopify and Wix with domain/config detection#69
Merged
prasjaiswal merged 7 commits intomainfrom Feb 16, 2026
Merged
Add platform handlers for Shopify and Wix with domain/config detection#69prasjaiswal merged 7 commits intomainfrom
prasjaiswal merged 7 commits intomainfrom
Conversation
Introduces a new nlweb-platform-handlers package that enables querying
platform search APIs directly (e.g., Shopify MCP) instead of relying on
a pre-indexed vector database. This is useful for sites that have their
own search endpoints.
Architecture:
- KeywordRetrievalHandler extends DefaultAskHandler, overriding only
_run_query_body() — inherits the full pipeline (decontextualization,
elicitation, ranking, summarization) for free
- LLM-based query rewriting converts natural language to keyword queries
suited for platform search APIs
- ShopifyMCPHandler queries stores via https://{site}/api/mcp using the
search_shop_catalog tool and converts products to schema.org format
- Zero changes to handler.py — uses existing SiteSelectingHandler
config-driven routing via ask_handler_class + ask_handler_import_path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds WixMCPHandler alongside ShopifyMCPHandler in the platform-handlers
package. Queries Wix sites via https://{site}/_api/mcp using
SearchSiteApiDocs (products/services) with fallback to SearchInSite
(general content). Auto-detects content type (Product, Article, WebPage)
and converts to schema.org format. Handles Wix media ID to CDN URL
conversion.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Frontend changes to support Shopify/Wix platform handler results: - Add ProductSchema with offers, brand, ratings, and tags - Add OfferSchema (Offer + AggregateOffer) for product pricing - Add GenericResultSchema as fallback for any schema.org type - Add isSummary(), isProductResult(), isGenericResult() type guards - Reorder parseSchema() to try Summary first, add Product + Generic - Fix result deduplication in useNlWeb to use @id || url instead of just @id (platform results may not have @id) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds two automatic detection steps before explicit handler config:
1. Domain pattern matching (no HTTP, just string matching):
*.myshopify.com → ShopifyMCPHandler
*.wixsite.com → WixMCPHandler
2. Site config 'platform' field for custom domains:
sites:
www.mycustomshop.com:
platform: shopify
Both use lazy dynamic imports — if nlweb-platform-handlers isn't
installed, detection gracefully falls back to DefaultAskHandler.
Refactors handler import logic into shared _import_handler() method.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 8 Shopify stores (gymshark, allbirds, kyliecosmetics, stevemadden, brooklinen, bombas, rothys, colourpop) and 7 Wix sites as platform config entries for testing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
platform-handlersprovider package withShopifyMCPHandlerandWixMCPHandlerfor keyword-based retrieval via MCP endpointsKeywordRetrievalHandlerbase class extendsDefaultAskHandler— overrides only_run_query_body(), inheriting the full pipeline (decontextualization, ranking, summarization)*.myshopify.com,*.wixsite.com) and platform config field (platform: shopify/wix) detection toSiteSelectingHandlerinhandler.pyProductSchema,GenericResultSchema, andisSummary()type guard to frontendparseSchema.tsuseNlWeb.tsto use@id || urlDetection cascade (handler.py)
myshopify.com→ ShopifyMCPHandler,wixsite.com→ WixMCPHandlerplatform: shopifyorplatform: wixin site_config handler sectionask_handler_class+ask_handler_import_pathNew files
ask_api/packages/providers/platform_handlers/— full package with base, shopify, wix, query_rewriteTest plan
make checkpasses in ask_api (295 tests, 0 pyright errors)make checkpasses in frontend.myshopify.comand.wixsite.comdomainsplatform: shopifyandplatform: wixconfig entries route to correct handler🤖 Generated with Claude Code