Skip to content

hughmancoder/recipe-agent

Repository files navigation

Recipe Agent

Agent that suggests recipes from the pantry list from a specified file such as files/ingredients.txt or a specified ingredients such as find me chicken and rice recipes

Project Description

Key Features

  • Import pantry list or specify ingredients in prompt
  • Searches recipes on google based on key ingredients
  • Extracts ingredients from recipe website
  • Calculates matching and missing ingredients
  • Summarises ingredients you have (core ingredients) and ingredients you need (other ingredients)

Architecture

Architecture

Agents

  • input_agent – resolves file path vs free text
  • main_ingredients_agent – extracts key ingredients from user text for search
  • recipe_search_agent – finds recipe URLs via Google search based on key ingredients
  • url_critic_agent – validates search agent URLs and can call exit_loop
  • recipe_verification_loop – LoopAgent that iterates search and critiques search
  • recipe_ingredient_agent – fetches the recipe page and extracts ingredients
  • recipe_ranking_agent – compares user ingredients vs recipe ingredients
  • display_agent - summarises the data as markdown output for the user

Tools

  • resolve_input – extracts user input when it is a file path
  • get_match_outcomes – computes matched and missing ingredients by comparing sets
  • google_search
  • fetch_webpage_content – fetches page HTML/text from a URL

Examples

UI

See Examples Here

Example Ingredient lists

Setup

Prerequisites: Python, Pip

Install the ADK package

pip install google-adk

Create and activate a virtual environment from project root directory

python -m venv .venv && source .venv/bin/activate On Windows: .venv\Scripts\activate)

Install dependencies

pip install -r requirements.txt

Configure API key

You can manage your API key on google cloud studio here

cd app

echo "GOOGLE_GENAI_USE_VERTEXAI=True" >> app/.env

echo "GOOGLE_API_KEY=YOUR_AI_STUDIO_API_KEY" >> app/.env

Your API key should be in the .env file in app/

Run agent

From root directory

Run Locally

adk run app

In web ui

adk web --port 8000

Makefile

Refer to makefile for further commands

Further Resources

Project Link

Docs reference

Video demo

Future Features

  • Run pipeline in parallel to suggest and rank multiple recipes.
  • Store recipe text content in model context to allow users to ask follow up questions on recipe.
  • Deploy to API with JSON output for application integration.
  • Integrate agent with a shopping list application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published