> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phidata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopping Agent

## Overview

The Shopping Partner Agent is a personalized product recommendation agent that helps users find items matching their preferences and needs. It uses FirecrawlTools to search trusted e-commerce platforms, ensuring recommendations are accurate, in stock, and sourced from reliable websites.

## Implementation

Create a file `shopping_agent.py` with the following code:

```python shopping_agent.py theme={null}
from phi.agent import Agent
from phi.model.google import Gemini
from phi.tools.firecrawl import FirecrawlTools

agent = Agent(
    name="shopping partner",
    model=Gemini(id="gemini-2.0-flash-exp"),
    instructions=[
        "You are a product recommender agent specializing in finding products that match user preferences.",
        "Prioritize finding products that satisfy as many user requirements as possible, but ensure a minimum match of 50%.",
        "Search for products only from authentic and trusted e-commerce websites such as Google Shopping, Amazon, Flipkart, Myntra, Meesho, Nike, and other reputable platforms.",
        "Verify that each product recommendation is in stock and available for purchase.",
        "Avoid suggesting counterfeit or unverified products.",
        "Clearly mention the key attributes of each product (e.g., price, brand, features) in the response.",
        "Format the recommendations neatly and ensure clarity for ease of user understanding.",
    ],
    tools=[FirecrawlTools()],
)
agent.print_response(
    "I am looking for running shoes with the following preferences: Color: Black Purpose: Comfortable for long-distance running Budget: Under Rs. 10,000"
)
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install required libraries">
    ```bash theme={null}
    pip install phidata google-generativeai openai firecrawl-py
    ```
  </Step>

  <Step title="Set environment variables">
    ```bash theme={null}
    export GOOGLE_API_KEY=****
    export FIRECRAWL_API_KEY=****
    ```
  </Step>

  <Step title="Run the agent">
    ```bash theme={null}
    python shopping_agent.py
    ```
  </Step>
</Steps>
