Inspiration

There are roughly 60,000 food pantries in the United States, many operating with volunteers, clipboards, and limited inventory technology. A recall announced on Tuesday may affect food distributed the previous Saturday, yet most recall processes only protect products still inside the pantry. We imagined Maria, a parent who takes groceries home for her children and has no way to learn that one of those items was later recalled.

BackShelf rebuilds our earlier pantry-scanning prototype around this missing last mile. The first version checked products only at intake, treated past-date food too aggressively, and matched recalls by brand instead of lot code. BackShelf addresses those shortcomings by connecting recalls, individual products, pantry shelves, and anonymous household pickup codes in one graph.

What it does

BackShelf helps food pantries manage donations throughout the product lifecycle:

  • IntakeScan reads a photographed label, extracting the brand, product, ingredients, date type, lot code, packaging condition, and confidence.
  • Shelf-stable food past a “best by” date goes to human review with shelf-life guidance instead of being automatically discarded.
  • Recall matching uses brand, product description, and lot codes with CONFIRMED, POSSIBLE, and WEAK confidence levels.
  • ClearItem prevents volunteers from shelving products with confirmed recall matches.
  • MatchNeeds filters available products using requests such as “allergic to peanuts, vegetarian, diabetic” and explains the results in the client’s preferred language.
  • RecallSweep imports active FDA recalls, identifies affected pantry items, and traverses distribution records backward to the anonymous pickup codes of households that received them.

Household records contain no names, addresses, phone numbers, or email addresses. BackShelf tracks distribution through anonymous pickup codes and supports opt-in notification contact information.

How we built it

BackShelf is built end to end in Jac. The domain is represented as a graph containing Pantry, Shelf, Item, Allergen, Household, RecallFeed, and RecallRecord nodes connected by typed edges such as Stocks, Contains, FlaggedBy, Avoids, Received, and Lists.

All business logic runs through Jac walkers. Walkers automatically become API endpoints, so we did not create a separate REST layer. Persistence comes from graph reachability from Jac’s root node rather than SQL, an ORM, or a custom database layer.

We used byLLM functions with typed signatures and sem annotations for label extraction, shelf-life reasoning, constraint resolution, and multilingual explanations. The system integrates with the openFDA food-enforcement API and includes a cached recall snapshot so poor venue Wi-Fi cannot break the demonstration.

The central operation is RecallSweep. It traverses from an FDA recall to matching items and then walks backward across Received edges to find the pickup-coded households that took those items home.

Challenges we ran into

Jac is evolving quickly, and its graph, walker, client, and byLLM semantics differ substantially from Python or conventional web frameworks. We relied on the compiler’s version-matched guides and repeatedly validated the project instead of guessing syntax.

Recall matching also required careful domain reasoning. Matching only on brand creates damaging false positives, while treating date labels as safety deadlines can unnecessarily destroy usable food. We implemented lot-aware confidence tiers and separated quality dates from genuine discard conditions such as compromised packaging, expired infant formula, and past-date perishables.

Deployment introduced additional constraints. The client bundle requires Node, the service requires Python 3.12 or newer, and walker registration takes time after startup. We created reproducible setup, preflight, seeding, reset, and demo scripts to keep the presentation reliable.

We also designed the LLM integration to degrade safely. Missing keys or provider failures fall back to a clearly labeled MockLLM rather than crashing a volunteer’s workflow.

Accomplishments that we're proud of

We are most proud of the backward recall traversal. BackShelf can start with a newly announced FDA recall, identify the exact affected products, pull remaining items from pantry shelves, and name the anonymous pickup codes that should be notified. This closes a gap that intake-only scanners and conventional pantry inventory systems leave open.

We are also proud that the project corrects harmful assumptions from our original prototype:

  • Past-date shelf-stable food is reviewed instead of automatically discarded.
  • Brand-only matches do not condemn an entire product line.
  • Confirmed recalls are enforced inside the walker rather than only in the interface.
  • Household privacy is part of the graph design, not an afterthought.
  • Client explanations can be produced in multiple languages with minimal additional complexity.

Most importantly, the complete workflow runs through Jac nodes, edges, walkers, backward traversal, root-reachability persistence, and byLLM functions.

What we learned

We learned that graph structure can change what a product is capable of doing, not merely how its data is stored. The backward path from an item to the household that received it is natural and visible in Jac, while the same behavior would require significant coordination across inventory, distribution, and notification tables in a conventional system.

We also learned that “conservative” food-safety behavior is not automatically responsible. Excessive false positives and incorrect date handling can destroy scarce food and harm the same communities the system is intended to protect. Confidence levels, human review, and careful wording are essential.

Finally, we learned that AI works best here as a structured assistant rather than an authority. The LLM extracts and explains label information, while deterministic rules, graph relationships, and human clearance control consequential decisions.

What's next for BackShelf

The next step is evaluating label extraction against 20–30 real cans, boxes, and packages with recorded ground truth. This will give us measurable per-field accuracy for brands, products, dates, and lot codes.

Beyond the hackathon, we would:

  • Pilot the workflow with food-pantry volunteers.
  • Add authentication and role-based access.
  • Integrate opt-in SMS, email, or voice notifications.
  • Improve geographic filtering of FDA recalls.
  • Support barcode scanning when a barcode is available.
  • Add volunteer-friendly lot-code comparison tools.
  • Build privacy-preserving reporting for pantry networks.
  • Conduct accessibility and multilingual usability testing.

Our long-term goal is for food distributed by a pantry to receive the same recall protection as food purchased from a grocery store—without requiring pantries to operate like large retailers.

Built With

  • claude
  • jac
Share this project:

Updates

Submission history