FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
bgschiller
bgschillerpersonalShopper
Remix of geoffreylitt/stevensDemo
Public
Like
1
personalShopper
Home
Code
10
dailyBriefing
3
dashboard
4
dbUtils
4
importers
5
shared
1
.cursorrules
README.md
backstory.ts
memoryUtils.ts
populateDemo.ts
Branches
1
Pull requests
Remixes
1
History
Environment variables
4
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/29/2025
Viewing readonly version of main branch: v2
View latest version
README.md

Personal Shopper

Description

This is an AI-powered Grocery Shopping assistant that turns an imprecise list of items like "milk, bread, eggs" into a Kroger cart full of groceries. It relies on the Kroger API to search each item, then uses an LLM to decide which specific UPC to add to the cart (again, using the Kroger API). Once an item is selected, we store the UPC in the database so we can avoid consulting the LLM for that item again.

Households have preferences for which items to buy, and what priorities they have for each item. For example, we prefer to buy free range eggs and poultry, but don't particularly care whether they are organic or not. These details are stored in a database, which should also be consulted to add context to the LLM's decisions.

Logging in

The user can log in via Kroger's OAuth2 flow. This identifies the user and also delegates the ability to search the product catalog and add items to the cart.

Database

The database consists of the following tables:

  • guidance: This table stores textual preferences for each item. For example, "prefer free range eggs" or "always lactose-free".
  • selections: This table stores the UPCs of items that have been selected by the LLM, along with the user's free text name. That way, we can avoid consulting the LLM for that item again.
  • users: This table stores the user's Kroger access token, and their preferred Kroger location ID.

Process

  1. The user supplies a list of items they want to buy.
  2. We search the Kroger API, getting a list of products that match the free text name.
  3. For each item, we
    1. Try to find it in selections. If we can't find it there,
    2. Use full-text search to find the most relevant guidance. Then ask the LLM to decide which specific UPC to add to the cart. Store this in the selections table for next time.
  4. We use the Kroger API to add the item to the cart.
  5. Repeat for each item.

There is no need to check out the cart, as the user will review the cart in the app and make any necessary changes.

Secondary flows

  • The user can add new items to the guidance table.
  • The user can CRUD their selections.
  • The user can change their Kroger location ID.
  • The user can log out.

Tech Stack

  • TypeScript
  • val.town, including sqlite integration
  • Hono for the API

See .cursorrules for more details.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.