Tutorial

How to Build a Product Search Agent on Azure AI

An r/AZURE post showed a 6-part product search agent. Wire Scavio as the data layer for Amazon + Walmart + Reddit signal.

An r/AZURE post showcased a 6-part build of an AI product search agent. The data layer determines breadth of coverage. This tutorial wires Scavio as the multi-source layer.

Prerequisites

  • Azure subscription
  • Azure AI Foundry or Azure Functions
  • Scavio API key

Walkthrough

Step 1: Provision an Azure Function

TypeScript or Python runtime.

Text
// Azure Function HTTP trigger; runtime: Node 20 or Python 3.11.

Step 2: Define a product_search tool

Calls Scavio Amazon + Walmart endpoints.

async function productSearch(query: string) {
  const H = { 'x-api-key': process.env.SCAVIO_API_KEY!, 'Content-Type': 'application/json' };
  const [a, w] = await Promise.all([
    fetch('https://api.scavio.dev/api/v1/amazon/search', { method: 'POST', headers: H, body: JSON.stringify({ query }) }).then(r => r.json()),
    fetch('https://api.scavio.dev/api/v1/walmart/search', { method: 'POST', headers: H, body: JSON.stringify({ query }) }).then(r => r.json())
  ]);
  return { amazon: a.products?.slice(0, 5) ?? [], walmart: w.products?.slice(0, 5) ?? [] };
}

Step 3: Wire into Azure AI Foundry

Register product_search as an agent tool.

Text
// In Azure AI Foundry agent config, point to the Function URL with API-Key auth.

Step 4: Add Reddit signal as second tool

r/BuyItForLife and product subs.

async function redditOpinions(query: string) {
  return fetch('https://api.scavio.dev/api/v1/reddit/search', { method: 'POST', headers: H, body: JSON.stringify({ query }) }).then(r => r.json());
}

Step 5: Test end-to-end

Prompt: 'best home fitness equipment under $100 with positive Reddit reviews.'

Text
// Agent uses both tools; LLM ranks based on cross-source signal.

Python Example

Python
# Equivalent Python with azure.functions framework.

JavaScript Example

JavaScript
// TypeScript variant shown in steps.

Expected Output

JSON
Azure-native product search agent that covers Amazon + Walmart + Reddit opinion signal. Outperforms single-source agents on subjective product queries.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Azure subscription. Azure AI Foundry or Azure Functions. Scavio API key. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

An r/AZURE post showed a 6-part product search agent. Wire Scavio as the data layer for Amazon + Walmart + Reddit signal.