Project Info
Inspiration
Food waste is a surprisingly common problem in everyday life. The USDA estimates that 30-40% of the U.S. food supply is wasted. Yet much of this waste does not happen because families do not care. It happens because everyday food decisions are disconnected: people forget what they bought, lose track of what expires next, struggle to turn available ingredients into meals, and buy items they already have. Confusion around food date labels makes the problem worse. A 2025 national survey from the Harvard Law School Food Law and Policy Clinic, ReFED, and the Johns Hopkins Bloomberg School of Public Health found that 43% of U.S. consumers always or usually discard food near or past its label date, while 88% do so at least occasionally. Our team saw that recipe apps, grocery lists, pantry trackers, and meal planners usually operate as separate tools. We wanted to connect those decisions into one continuous system that helps households use food before buying more. That idea became PantryAgent: an AI-assisted food management system that turns pantry inventory into actionable, low-waste meal decisions. Sources: USDA Food Loss and Waste and ReFED's 2025 national survey.
What it does
PantryAgent helps users manage food from purchase to consumption. Users can photograph a grocery receipt, and Claude Vision extracts edible items, quantities, categories, and estimated shelf lives. Before anything is saved, users can review, edit, or remove the extracted items. The pantry then sorts food by expiration urgency instead of alphabetically. Users can also import public recipe-blog URLs. Browserbase converts the original page into structured ingredients and instructions, allowing trusted recipes from the web to participate in the same planning workflow as saved recipes. PantryAgent recommends meals that use soon-to-expire ingredients first. Its weekly planner considers pantry quantities, recipe requirements, imported recipes, and meals the user selected manually. It flags likely shortages and adds only missing ingredients to the shopping list. The loop continues after planning: marking a shopping item as bought adds it to inventory, while marking a meal as eaten records the meal and deducts matching ingredients from the pantry. Nutrition estimates support the workflow, but waste reduction remains the primary goal.
How we built it
We built PantryAgent using modern web technologies, a structured database, and AI-powered automation. The application uses Next.js, React, TypeScript, and Tailwind CSS to deliver a clean, mobile-first experience. Supabase and PostgreSQL store pantry inventory, recipes, meal plans, shopping lists, dietary logs, and web-extraction records. Claude powers grocery receipt understanding, meal-plan generation, and nutrition reconciliation. Browserbase serves as our web-action layer: it retrieves recipe content through Fetch and escalates to a real browser with Stagehand when pages require JavaScript, scrolling, popup handling, or interaction. When a user submits a recipe URL, Browserbase extracts the original page into a consistent JSON structure. The system validates that essential information, such as ingredients and instructions, is present before saving it. For missing nutrition data, Browserbase searches for supporting sources, while Claude reconciles the evidence with ingredient quantities and serving sizes. Confidence labels, source links, and action logs make the process more transparent and reduce unsupported AI assumptions. Our meal-planning engine combines pantry quantities, expiration dates, recipe requirements, and user-selected meals to prioritize food that should be consumed first. It identifies shortages, adds only missing ingredients to the shopping list, returns purchased items to inventory, and deducts ingredients after a meal is completed. We also used Pika as our creative production layer. Pika supported the visual development of our website, team logo, and UI assets. Our final demo video, including AI-generated team presenters, voice and facial synchronization, supporting visuals, transitions, captions, and editing, was also generated and assembled using Pika.
Challenges we ran into
One major challenge was extracting reliable structure from inconsistent recipe websites. Ingredients can omit quantities, instructions may be buried inside long articles, and important content may sit behind popups, collapsed recipe cards, or lazy-loaded sections. A single extraction method was not reliable enough, which led us to build the Fetch-first validation and Stagehand fallback pipeline. Another challenge was deciding how much AI should infer. Receipt shelf life, recipe quantities, and nutrition values can all contain uncertainty. We added editable receipt results, schema validation, source-backed nutrition evidence, confidence labels, and deterministic calculations instead of treating the first model response as unquestionable truth. The hardest product-design challenge was not any individual AI call. It was making inventory, recipes, planning, shopping, and meal completion behave as one stateful loop. We repeatedly refined the data contracts and transitions so that each action changes what the next recommendation sees.
Accomplishments we're proud of
We are proud that PantryAgent is an end-to-end product rather than a collection of disconnected AI features. We built a receipt-to-pantry workflow with human review, an expiry-aware inventory, a Browserbase recipe importer with a real browser fallback, an AI-assisted weekly planner, evidence-aware nutrition estimates, and a shopping loop that returns purchases to inventory and deducts ingredients after meals. Most importantly, the product connects those capabilities around a clear social-impact goal: helping households waste less food and avoid unnecessary repeat purchases. Ethical considerations We treat AI as an assistant, not an authority. Users review receipt results before saving them. Shelf-life and nutrition outputs are explicitly labeled as estimates and should not be treated as food-safety or medical advice. Nutrition results expose evidence, source links, and confidence instead of hiding uncertainty. PantryAgent can prepare shopping lists but does not automatically purchase or check out. The current hackathon build uses a single demo user; a production release would require account isolation, least-privilege database access, explicit image-retention controls, and clear consent for any personal data processing.
What we learned
We learned that useful AI products depend less on one impressive prompt than on reliable data pipelines, validation, human checkpoints, and state transitions. We also learned to match the tool to the task. Browserbase Fetch is the efficient path for simple pages, while Stagehand is valuable when the web becomes interactive. Claude is strongest when reasoning over structured context, and deterministic application code should perform calculations and state updates whenever possible. Pika is a flexible creative toolkit for generating images and videos, editing existing footage, and turning raw assets into polished visual stories. Most of all, users care about whether the entire workflow reduces effort and supports better decisions, not how many separate AI features appear in the interface.
What's next
We see PantryAgent as the foundation for a larger food management ecosystem. Future improvements include direct integration with grocery delivery services such as Amazon Fresh and DoorDash, automatic pantry synchronization after grocery purchases, computer vision-based ingredient recognition from fridge photos, and personalized nutrition recommendations for goals such as weight loss, muscle gain, or dietary restrictions. We also want to improve expiration prediction using food-specific shelf-life models and build AI agents that automatically update meal plans as pantry inventory changes. Our long-term vision is to create a fully automated kitchen assistant that helps users reduce food waste, eat healthier, and spend less time managing groceries and meal planning. By connecting inventory, recipes, shopping, and nutrition into one intelligent system, PantryAgent makes sustainable eating easier, smarter, and more effortless.
PantryAgent
PantryAgent is an AI-assisted food management app that helps households cook what they already own before it expires. It connects pantry inventory, trusted recipes, weekly meal planning, nutrition evidence, and grocery replenishment into one continuous workflow.
Instead of treating inventory, recipes, and shopping as separate lists, PantryAgent keeps them synchronized: groceries enter the pantry, recipes are matched against available food, planned meals reveal shortages, eaten meals reduce inventory, and purchased items flow back into the pantry.
High-Level Workflow
flowchart LR
A[Receipt photo] --> B[Structured pantry inventory]
C[Recipe blog URL] --> D[Normalized recipe]
D --> E[Recipe library]
B --> F[Expiry-aware matching]
E --> F
F --> G[Weekly meal plan]
G --> H{Ingredients available?}
H -- No --> I[Shopping list]
I -->|Marked as bought| B
H -- Yes --> J[Cook and mark as eaten]
J --> K[Diet log]
J -->|Deduct ingredients| B
1. Build the pantry from real purchases
The user uploads a grocery receipt. Claude Vision extracts edible items, quantities, categories, and estimated shelf lives. The user can review or edit the result before saving it to Supabase as inventory sorted by expiration date.
Items can also enter the pantry from the shopping list: marking an ingredient as bought creates a new inventory record, closing the purchase-to-pantry loop.
2. Build a reusable recipe library
Users can save recipes and import public recipe-blog URLs. The importer first uses Browserbase Fetch to extract structured data quickly. If the page is incomplete or requires interaction, it falls back to a Browserbase browser session with Stagehand to handle popups, jump-to-recipe controls, collapsed sections, and lazy-loaded content.
Regardless of the source, recipes are normalized into the same model: title, ingredients, steps, servings, calories, tags, and source metadata. This shared shape lets imported and saved recipes participate in the same planning workflow.
3. Attach evidence-backed nutrition estimates
When an imported page does not provide calories, or when the user requests verification, PantryAgent selects the recipe's major ingredients and uses Browserbase Search and Fetch to collect nutrition facts from the web. Claude then reconciles those facts with ingredient quantities and serving count.
The resulting per-serving estimate is saved with its confidence level, estimation method, source links, and extracted evidence. Meal-plan cards can therefore distinguish page-reported calories from browser-supported estimates and AI fallback values.
4. Recommend meals around what expires first
PantryAgent supports two levels of recommendation:
- An instant local matcher ranks recipes by how many soon-to-expire ingredients they use, then by overall pantry coverage.
- The AI planner fills empty weekly meal slots using the current inventory and recipe library. It prioritizes expiring food, favors saved or imported recipes, preserves manually selected meals, encourages variety, and flags likely quantity shortages across the week.
Users can accept the generated plan or choose recipes manually for any breakfast, lunch, or dinner slot.
5. Close the cooking and shopping loop
Every planned recipe is compared with current inventory. Missing ingredients can be added to the shopping list for one meal or the entire week. When those items are marked as bought, they are added to the pantry.
After a meal is marked as eaten, PantryAgent deducts matching ingredient quantities from inventory, removes depleted items, records the meal and calories in the diet log, and marks the plan entry as complete. The updated pantry then drives the next recommendation cycle.
System Overview
- Next.js and React provide the user interface and server-side workflow endpoints.
- Supabase stores inventory, recipes, meal plans, shopping items, diet logs, and web-extraction records.
- Claude handles receipt understanding, meal-plan generation, and nutrition reconciliation.
- Browserbase Fetch provides the fast path for structured web extraction and nutrition research.
- Stagehand on Browserbase handles recipe pages that require a real, interactive browser.
The current implementation is a single-user demo built around the demo user ID. AI-generated shelf-life, meal-planning, and nutrition outputs are assistive estimates and should be reviewed rather than treated as medical guidance.
Local Development
Install dependencies and create a local environment file from .env.example:
npm install
cp .env.example .env.local
npm run dev
Configure Supabase, Anthropic, and Browserbase credentials in .env.local. The app expects the core Supabase tables represented by its shared data types; the included nutrition-verification migration extends recipes with evidence metadata and adds web-import logging. The seed SQL is optional demo data.
Analysis
View
Metric
- 17
- 13
- 9
- 4
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- HTMLIn code
- Next.jsIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
- Node.jsClaimed
- PostgreSQLClaimed
- VercelClaimed
9 of 12 appear in the indexed code. 3 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeConfig · Commits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
1.1 MB
Source files
88
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
cerealhugger/Pantry-Agent
103 files · 2.2 MB · @ cab328d
Structure
Interface
29 files · 28%Screens, components and styles rendered to the user.
API & routing
6 files · 6%Request entry points: routes, handlers and controllers.
Application logic
9 files · 9%Domain rules, services and shared utilities.
Data & schema
2 files · 2%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Markdown76%
- TypeScript17%
- HTML6%
- SQL1%
- CSS0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 18- @anthropic-ai/sdk
- @browserbasehq/sdk
- @browserbasehq/stagehand
- @supabase/supabase-js
- @tailwindcss/postcss
- next
- react
- react-dom
- zod
- +9 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.