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.
- 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
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.
.
├── planner.py
├── leftover.py
├── requirements.txt
├── .env.example
└── config/
└── tasks.yaml
- Python 3.10+
- An LLM provider API key
- Optional: Serper API key for recipe research
Installed from requirements.txt:
crewaicrewai-toolslangchainlangchain-communitylangchain-openailitellmpython-dotenvduckduckgo-searchdatabricks-sdk
git clone https://github.com/xJoeyCodes/crewai-team.git
cd crewai-teampython -m venv .venv
source .venv/bin/activateOn Windows:
python -m venv .venv
.venv\Scripts\activatepip install -r requirements.txtCopy .env.example to .env and add your credentials:
cp .env.example .envExample:
OPENAI_API_KEY=your-openai-key
LLM_MODEL=openai/gpt-4o-mini
SERPER_API_KEY=your-serper-keyYou can also use other LiteLLM-compatible providers such as Anthropic or Groq by changing LLM_MODEL and setting the appropriate API key.
Run the planner:
python planner.pyBy 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
When you run the script, it can generate files such as:
meals.jsonshopping_list.jsonshopping_guide.md
The workflow also prints structured example data to the console to show how the models are shaped.
planner.py reads the model from the LLM_MODEL environment variable:
llm_model = os.getenv("LLM_MODEL", "openai/gpt-4o-mini")If SERPER_API_KEY is set, the project uses SerperDevTool for recipe research.
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
- The current implementation is demo-oriented and runs immediately when
planner.pyis executed. - The project is focused on a multi-agent grocery planning workflow rather than a reusable package.
config/agents.yamlis referenced inleftover.py, so make sure the agent configuration is present if you extend that workflow.
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
No license file is currently included in this repository.