A workflow demonstrating how the Shopping Agent can search for products, compare prices, and provide shopping recommendations.

Quick Start

1

Install Package

First, install the PraisonAI Agents package:

pip install praisonaiagents
2

Set API Key

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY=your_api_key_here
3

Create Script

Create a new file shopping_assistant.py:

from praisonaiagents import Agent, Tools
from praisonaiagents.tools import duckduckgo

# Create Shopping Agent
shopping_agent = Agent(
    name="ShoppingAssistant",
    role="Shopping Specialist",
    goal="Find the best prices and deals across stores",
    instructions="You are a Shopping Agent",
    tools=[duckduckgo]
)

# Search for product prices
response = shopping_agent.start(
    "I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table"
)

# Save price comparison
with open('price_comparison.md', 'w') as f:
    f.write(response)

Understanding Shopping Assistant

The Shopping Agent combines multiple capabilities for effective price comparison:

  1. Store Search: Uses DuckDuckGo to find retailers
  2. Price Analysis: Gathers pricing information
  3. Price Comparison: Compares prices across stores
  4. Deal Finding: Identifies special offers and discounts

Features

Price Comparison

Compare prices across multiple stores.

Deal Detection

Find special offers and discounts.

Store Analysis

Evaluate retailer reliability.

Price Tracking

Monitor price changes over time.

Example Usage

# Example: Compare product prices
from praisonaiagents import Agent, Tools
from praisonaiagents.tools import duckduckgo

agent = Agent(instructions="You are a Shopping Agent", tools=[duckduckgo])
agent.start("I want to buy iPhone 16 Pro Max, check 5 stores and give me price in table")

Next Steps

Was this page helpful?