惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
G
Google Developers Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
P
Proofpoint News Feed
V
Visual Studio Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 叶小钗
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
H
Help Net Security
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
量子位
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a Cross-Border Price-Comparison Agent: A Live Bu...
BuyWhere · 2026-06-23 · via DEV Community

BuyWhere

Why a build log (and not another tutorial)

Every AI shopping tutorial shows the same thing: install the SDK, call a tool, ship. None of them show what happens when the API returns a price that is stale, the merchant is geo-blocked, or the agent has to reconcile four different currencies for a single shopper query.

This is the build log of a working cross-border shopping agent — what we shipped, what broke, and the patterns we now use on every customer integration.

What we are building

A conversational agent that takes a product brief ("noise-cancelling headphones under SGD 400") and returns the three cheapest matching offers across SG, US, and JP retailers in real time, with currency conversion and shipping transparency.

It uses BuyWhere MCP as the price-discovery layer (5M+ products, 6M+ offers, 100+ merchants, 5 currency modes).

The architecture, after three iterations

v1 — naive: agent calls search_products, picks top 3, returns them. Failed because the agent had no idea which offers were in stock or shippable to the user.

v2 — offer-aware: agent calls search_products (with mode=offer), then calls get_product on each to pull current price + shipping. Failed because round-trips to get_product added 8–11s of uncached latency on the first request.

v3 — multi-region, currency-normalised (the one that ships):

  1. search_products with mode=offer and a regional filter
  2. Filter offers by in-stock + ships_to=user_region in the agent prompt
  3. For cross-region results, call find_similar to get the same product in the local catalog and pick the cheaper of (local offer + shipping) vs (foreign offer + conversion + shipping)
  4. Return three results with a one-line rationale per choice

The result is a 1.2–2.4s response time and a 73% click-through on the top result, measured over 1,800 shopper queries last week.

Three patterns we use on every integration now

1. Always pass mode=offer for shopping tasks

mode=product returns the canonical product card (good for browsing and category pages). mode=offer returns the cheapest live offers per merchant (good for shopping decisions). Mixing them in the same agent flow gives the model two different mental models of "cheapest" and the answers stop being reproducible.

2. Always specify currency at search time

The currency parameter on search_products is a conversion and a filter — it returns the offer converted to your target currency and skips offers that the merchant does not ship to your region. We default to USD for global use cases and SGD for SG-locked ones. Without it, you get a mix of currencies the user has to reconcile.

3. Always treat find_similar as a re-pricing tool, not a discovery tool

find_similar finds the same product across merchants. In a price-comparison agent, the right move is: take the top result, then call find_similar to see if the same SKU is cheaper elsewhere in the same currency. Discovery is search_products; re-pricing is find_similar.

What we learned (and what we are still figuring out)

  • The agent prompt is the cache. Same model, same tool, same data — different system prompt, different result quality. We have a prompts/shopper.md that we update whenever a regression slips in.
  • Latency is a feature, not a bug. A 1.2s response is a better answer than a 0.6s response that omits the shipping-cost check.
  • The hardest problem is still data freshness. BuyWhere re-prices every offer on a 4–6h cadence. For sale items, that is not enough — we are now testing 1h re-pricing for items under 20% off and 15-minute for items under 50% off.

Try it yourself

The full build (LangChain + BuyWhere MCP) takes about 30 minutes if you have Node 20+ and an OpenAI key:

# install the MCP server
npm install -g @buywhere/mcp-server
# set credentials
export BUYWHERE_API_KEY=...
# clone the reference agent
git clone https://github.com/buywhere/shopper-agent-example
cd shopper-agent-example && npm install && npm start

The repo includes a case-study notebook that walks through each iteration and the exact queries that motivated the design decisions above.


Building a cross-border shopping agent and want a second pair of eyes? We are running free integration calls this month — book one at partners@buywhere.ai.