Skip to content

Sneegha1511/Product_Finder_AI_Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Product Finder AI Agent

This project was built for the AI Agent Prototype Assignment.

It is a simple chatbot-style product finder that lets users search using normal language instead of selecting filters manually. For example, a user can type:

Show me clothing products under $50

The agent understands the request, identifies the category and price condition, calls the correct Python filtering function, and displays the matching products as cards.

How it works

The application uses Google ADK with Gemini to understand the user’s message.

Gemini is only used to interpret the request and decide which tool to call. The actual product filtering is done using regular Python code and the provided JSON dataset.

The application follows this flow:

User message → Google ADK agent → Python filtering tool → products.json → Streamlit product cards

The agent has access to two tools:

  • filter_by_category for category-based searches
  • filter_by_price for maximum, minimum, exact-price, and combined category-price searches

The project uses one agent and does not use embeddings, RAG, multiple agents, or ADK’s built-in web interface.

User enters a product request ↓ Streamlit sends it to the AI agent ↓ Gemini understands the category and price ↓ ADK connects Gemini to the correct Python filtering tool ↓ Python searches the product data ↓ Matching products are returned ↓ Streamlit displays them as product cards

Features

  • Search products using natural language
  • Filter products by category
  • Filter products below a given price
  • Filter products above a given price
  • Find products with an exact price
  • Combine category and price filters
  • Display results with an image, name, description, category, and price
  • Simple chatbot-style interface built with Streamlit
  • API key stored securely using a .env file

Technologies used

  • Python
  • Google Agent Development Kit
  • Gemini
  • Streamlit
  • JSON
  • python-dotenv
  • Git and GitHub

Project structure

  • app.py runs the Streamlit interface and communicates with the ADK agent
  • agent.py defines the Product Finder agent, its instructions, and its tools
  • product_filter.py contains the deterministic category and price filtering functions
  • products.json contains the product dataset provided in the assignment
  • requirements.txt contains the packages required to run the project
  • .env stores the Gemini API key locally

Installation

  1. Make sure Python and Git are installed.

  2. Clone the repository:

    git clone https://github.com/Sneegha1511/Product_Finder_AI_Agent.git
    
  3. Open the project folder:

    cd Product_Finder_AI_Agent
    
  4. Create a virtual environment:

    python -m venv .venv
    
  5. Activate the virtual environment:

    .venv\Scripts\Activate.ps1
    
  6. Install the required packages:

    python -m pip install -r requirements.txt
    
  7. Create a Gemini API key from Google AI Studio:

    https://aistudio.google.com/apikey
    
  8. Create a .env file in the project folder and add:

    GOOGLE_GENAI_API_KEY=your_key_here
    
  9. Run the application:

    python -m streamlit run app.py
    
  10. Open the app in your browser:

    http://localhost:8501

  11. Press Ctrl + C in the terminal to stop it.

  12. Example Searches

  • Show me all clothing products
  • Show electronics under 200
  • Show groceries over 30
  • Find products that cost exactly 49

future improvements

  • Add more product categories and larger dataset
  • Implement more complex filtering options such as adding brand, colors, ratings, price ranges, product name searches
  • implement advanced filters with tick boxes
  • Add user authentication and personalized recommendations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages