Skip to content

About

CrewAI Grocery Planner is a Python-based AI grocery planning assistant that uses CrewAI to generate meal plans, shopping lists, and budget-friendly grocery recommendations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

CrewAI Grocery Planner

CrewAI Grocery Planner is a Python-based AI grocery planning assistant built with CrewAI. It helps generate meal plans, shopping lists, budget-friendly grocery recommendations, and leftover-reduction ideas using a multi-agent workflow.

Features

  • Generates structured meal plans with ingredients and difficulty levels
  • Organizes groceries into store sections for easier shopping
  • Estimates costs and helps stay within a budget
  • Suggests money-saving swaps and practical shopping tips
  • Recommends ways to reuse leftovers and reduce food waste
  • Supports dietary restrictions and cooking skill levels
  • Uses optional web search via Serper for recipe research
  • Produces structured outputs using Pydantic models

How It Works

The project defines a set of specialized agents:

  • Meal Planner & Recipe Researcher — searches for a suitable recipe and builds a meal plan
  • Shopping Organizer — groups ingredients into shopping categories
  • Budget Advisor — reviews the plan for cost efficiency and suggests savings
  • Leftover Manager — identifies leftover ingredients and suggests follow-up recipes
  • Report Compiler — combines all outputs into one comprehensive guide

The main workflow in planner.py runs these agents sequentially to produce a full grocery planning experience.

Project Structure

.
├── planner.py
├── leftover.py
├── requirements.txt
├── .env.example
└── config/
    └── tasks.yaml

Requirements

  • Python 3.10+
  • An LLM provider API key
  • Optional: Serper API key for recipe research

Dependencies

Installed from requirements.txt:

  • crewai
  • crewai-tools
  • langchain
  • langchain-community
  • langchain-openai
  • litellm
  • python-dotenv
  • duckduckgo-search
  • databricks-sdk

Setup

1. Clone the repository

git clone https://github.com/xJoeyCodes/crewai-team.git
cd crewai-team

2. Create a virtual environment

python -m venv .venv
source .venv/bin/activate

On Windows:

python -m venv .venv
.venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

Copy .env.example to .env and add your credentials:

cp .env.example .env

Example:

OPENAI_API_KEY=your-openai-key
LLM_MODEL=openai/gpt-4o-mini
SERPER_API_KEY=your-serper-key

You can also use other LiteLLM-compatible providers such as Anthropic or Groq by changing LLM_MODEL and setting the appropriate API key.

Usage

Run the planner:

python planner.py

By default, the script demonstrates a meal-planning workflow for:

  • Meal: Chicken Stir Fry
  • Servings: 4
  • Budget: $25
  • Dietary restrictions: no nuts, low sodium
  • Cooking skill: beginner

Outputs

When you run the script, it can generate files such as:

  • meals.json
  • shopping_list.json
  • shopping_guide.md

The workflow also prints structured example data to the console to show how the models are shaped.

Configuration

LLM model

planner.py reads the model from the LLM_MODEL environment variable:

llm_model = os.getenv("LLM_MODEL", "openai/gpt-4o-mini")

Optional search tool

If SERPER_API_KEY is set, the project uses SerperDevTool for recipe research.

Leftover Management

The LeftoversCrew in leftover.py loads task configuration from config/tasks.yaml and adds a leftover optimization step to the workflow.

This can help:

  • identify ingredients likely to remain unused
  • suggest extra recipes
  • reduce food waste
  • stretch the grocery budget further

Notes

  • The current implementation is demo-oriented and runs immediately when planner.py is executed.
  • The project is focused on a multi-agent grocery planning workflow rather than a reusable package.
  • config/agents.yaml is referenced in leftover.py, so make sure the agent configuration is present if you extend that workflow.

Future Improvements

Possible next steps:

  • add a CLI for custom meal input
  • support multiple meal plans in one run
  • add tests for the Pydantic models and workflow logic
  • improve budget estimation and ingredient normalization
  • expand YAML configuration for agents and tasks

License

No license file is currently included in this repository.

About

CrewAI Grocery Planner is a Python-based AI grocery planning assistant that uses CrewAI to generate meal plans, shopping lists, and budget-friendly grocery recommendations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages