Project Info
Inspiration
We've all had that moment — you reach for the dish soap mid-wash, and it's empty. You're out of coffee filters on a Monday morning. The essentials we depend on daily always seem to run out at the worst possible time. We realized that the cameras and smart devices already in our homes could do more than just sit there. What if they could see what you're running low on and handle it before you even notice? That's the idea behind Foresight — turning passive home cameras into an intelligent, proactive shopping assistant that never lets you run out of the things that matter. What It Does Foresight is an AI-powered smart home commerce platform that uses your existing cameras to detect household items in use, predict when they're running low, and automatically purchase replacements through Amazon — all with a single tap of approval. Core Features Real-Time AI Vision Detection — A live camera feed powered by OpenAI's GPT-5 nano analyzes your environment in real time, identifying household products and their usage context (e.g., washing dishes → dish soap, cooking → olive oil). Complementary Item Recommendations — The AI doesn't just detect what's visible — it recommends complementary items you might need based on what it sees (see a mouse → recommend a keyboard, see a TV → recommend a streaming device). One-Tap Purchase Approval — Detected items appear as cards on your dashboard. Approve with a single tap, and Foresight's AI agent handles the rest. Autonomous Browser Shopping Agent — Powered by Browserbase and Playwright, an AI agent opens a real browser session, searches Amazon, selects the best product, and adds it to your cart — all autonomously. Live Shopping View — Watch the AI agent shop in real time through an embedded live browser view directly in the dashboard. A browser-style modal shows the agent navigating Amazon, searching, and adding items to cart. Smart Dashboard — An analytics dashboard with weekly spending charts, total savings, items tracked, and a live activity feed of all purchases and detections. Additional Features Items stack without duplicates, limited to 2 items per detection for quality recommendations Confidence scores randomized between 70-100% for realistic detection display Activity feed with timestamped entries for approvals, declines, and purchases Dynamic stats (total saved, items tracked, automation rate) update in real time Responsive design with dark theme optimized for home dashboard displays How We Built It Our tech stack combines cutting-edge AI with modern web technologies: Frontend: React 18 + TypeScript, built with Vite for instant hot module reloading. Tailwind CSS and shadcn/ui provide a sleek, dark-themed dashboard UI. Framer Motion powers smooth animations throughout. AI Vision: OpenAI's GPT-5 nano model processes camera frames via the Chat Completions API with vision capabilities. We chose GPT-5 nano for its speed — real-time detection needs sub-second responses. The model receives base64-encoded frames and returns structured JSON with item names, brands, confidence scores, and reasoning. Prompt Engineering: Carefully crafted prompts instruct the model to recommend complementary items rather than just identifying what's on screen. The AI thinks about what activities are happening and what related products would be useful. Browser Automation: Browserbase SDK creates cloud browser sessions, and Playwright-core connects via Chrome DevTools Protocol (CDP) to automate the full Amazon shopping flow — search, product selection, and add-to-cart. Live View: Browserbase's debug API provides a real-time fullscreen view URL that we embed as an iframe, letting users watch the AI agent shop in real time. Backend: A lightweight Express.js server handles Browserbase session management and Playwright automation. Runs on Node.js (required by Playwright — Bun is not supported). State Management: localStorage bridges the Camera component and Dashboard, with polling for real-time sync of pending purchases. Security: All API keys (OpenAI, Browserbase) stored in .env and loaded via dotenv — never exposed in client-side code or git history. Challenges We Ran Into Playwright + Bun Incompatibility — Discovered mid-build that Playwright doesn't support Bun's runtime. Had to set up a separate Node.js server process alongside the Bun-powered Vite frontend. GPT-5 Token Handling — GPT-5 requires max_completion_tokens instead of the older max_tokens parameter. Initial attempts with 500 tokens resulted in the model using all tokens for reasoning with no visible output — bumped to 2000. Browserbase CDP Connection — Getting Playwright to connect to Browserbase sessions via connectOverCDP required using the SDK's session.connectUrl rather than manually constructed WebSocket URLs. Amazon Selector Stability — Amazon's DOM structure varies across page loads. Went through multiple iterations of selectors, settling on broad patterns (.s-main-slot .s-result-item h2 a) with fallbacks and timeouts. Real-Time UX — Balancing the async nature of browser automation (takes 10-20 seconds) with a responsive UI. Solved by returning the live view URL immediately and running automation asynchronously. False Positive Reduction — Early prompts were too aggressive, detecting items in every frame. Refined to an evidence-based approach requiring clear visual evidence before recommendations. Accomplishments We're Proud Of Built a fully autonomous AI shopping agent that navigates real websites in under 36 hours Achieved real-time vision detection with GPT-5 nano at interactive speeds Created a live browser view that lets users watch AI agents work in real time Designed an intuitive dark-themed dashboard that feels like a premium smart home product Engineered complementary item recommendations that feel genuinely useful, not just pattern matching Seamlessly integrated 4 different APIs (OpenAI, Browserbase, Playwright, Amazon) into one cohesive flow What We Learned Advanced prompt engineering for vision models — the difference between "detect everything" and "recommend intelligently" is massive Real-time browser automation at scale with cloud browser infrastructure The nuances of connecting to remote browsers via CDP and managing session lifecycles Complex state management across independent React components using localStorage as a message bus How to build UX around async processes that take 10+ seconds without losing user engagement Web scraping resilience — Amazon's DOM is a moving target What's Next for Foresight 1. Smarter AI Usage tracking over time to predict depletion dates Multi-room camera support with unified inventory Price comparison across retailers before purchasing Learning user brand preferences from past approvals 2. Full Purchase Automation Saved payment methods for true one-click checkout Subscription detection — auto-set up Subscribe & Save for recurring items Budget limits and spending caps per category 3. Platform Expansion Integration with Walmart, Target, and Costco Smart home platform integration (HomeKit, Google Home, Alexa) Mobile app with push notifications for approval requests Voice approval — "Hey Foresight, approve the dish soap" 4. Privacy & Security On-device vision processing option (no cloud API calls) End-to-end encrypted camera feeds Granular privacy controls — exclude rooms, time windows, item categories Our vision is to make Foresight the invisible hand that keeps your home stocked so you never have to think about running out of anything again.
Foresight — AI-Powered Smart Home Commerce
Turn your existing home cameras into a proactive shopping assistant that restocks your home before you run out.
Inspiration
You're mid-wash and the dish soap runs out. It's Monday morning and there are no coffee filters. The essentials we depend on daily always seem to run out at the worst possible time.
The cameras and smart devices already in our homes sit idle — they watch but don't act. We asked: what if they could? Foresight turns passive home cameras into an intelligent commerce layer that sees what you're running low on and handles replenishment before you even notice.
What It Does
Foresight is an AI-powered smart home commerce platform. It uses your existing cameras to detect household items in use, predict when they're running low, and automatically purchase replacements through Amazon — all with a single tap of approval from you.
Core Features
Real-Time AI Vision Detection
A live camera feed powered by OpenAI GPT-4o analyzes your environment in real time, identifying household products and their usage context — washing dishes triggers dish soap detection, cooking triggers olive oil.
Complementary Item Recommendations
The AI doesn't just identify what's visible. It reasons about what activity is happening and surfaces related products you're likely to need next: see a mouse, get a keyboard recommendation; see a TV, get a streaming device suggestion.
One-Tap Purchase Approval
Detected items surface as cards on your dashboard. Approve with a single tap — Foresight handles everything else.
Autonomous Browser Shopping Agent
Powered by Browserbase and Playwright, an AI agent spins up a real cloud browser session, navigates Amazon, searches for the best match, and adds it to your cart — fully autonomously.
Live Shopping View
Watch the agent shop in real time through an embedded live browser view in the dashboard. A browser-style modal shows the agent navigating Amazon, searching, and checking out.
Smart Analytics Dashboard
Weekly spending charts, total savings, items tracked, and a live activity feed of every detection, approval, and purchase — all updating in real time.
Additional Details
- Items deduplicate automatically — capped at 2 per detection for quality over quantity
- Confidence scores displayed between 70–100% to reflect realistic detection variance
- Timestamped activity feed logs approvals, declines, and completed purchases
- Stats (total saved, items tracked, automation rate) update dynamically
- Responsive dark theme optimized for always-on home dashboard displays
How We Built It
Frontend
React 18 + TypeScript, built with Vite for instant hot module reloading. Tailwind CSS and shadcn/ui provide the dark dashboard UI. Framer Motion handles animations throughout.
AI Vision
OpenAI's GPT-4o processes camera frames via the Chat Completions API with vision capabilities. Frames are sent as base64-encoded images; the model returns structured JSON containing item names, brands, confidence scores, and reasoning. GPT-4o was chosen for its sub-second latency — real-time detection can't wait.
Prompt Engineering
Prompts are designed to make the model reason about activities, not just objects. Instead of "I see dish soap," the model thinks: "someone is washing dishes — what do they depend on?" That shift produces more actionable, contextually aware recommendations.
Browser Automation
Browserbase SDK provisions cloud browser sessions. Playwright-core connects via Chrome DevTools Protocol (CDP) to drive the full Amazon shopping flow: search, product selection, and add-to-cart — no human required.
Live View
Browserbase's debug API returns a real-time fullscreen URL that we embed as an iframe, letting users watch the agent shop as it happens.
Backend
Lightweight Express.js server handles Browserbase session management and Playwright automation. Runs on Node.js (Playwright requires Node — Bun is not supported).
State Management
localStorage bridges the Camera component and Dashboard with polling for real-time sync of pending purchase approvals.
Security
All API keys (OpenAI, Browserbase) are stored in .env and loaded via dotenv. No secrets are exposed in client-side code or committed to git history.
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui, Framer Motion |
| AI Vision | OpenAI GPT-4o (Chat Completions API w/ vision) |
| Browser Automation | Browserbase SDK, Playwright-core, CDP |
| Backend | Node.js, Express.js |
| State | localStorage + polling |
Analysis
View
Metric
No commits on this project resolved to a GitHub account.
Technology
- CSSIn code
- ExpressIn code
- HTMLIn code
- JavaScriptIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
- FastAPIClaimed
- PythonClaimed
7 of 9 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
270 KB
Source files
85
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
AkhilBod/Foresight-TreeHacks
96 files · 867 KB · @ 4d55af1
Structure
Interface
66 files · 69%Screens, components and styles rendered to the user.
API & routing
1 file · 1%Request entry points: routes, handlers and controllers.
Application logic
13 files · 14%Domain rules, services and shared utilities.
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
- TypeScript94%
- Markdown2%
- JavaScript2%
- CSS1%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 78- @browserbasehq/sdk
- @hookform/resolvers
- @radix-ui/react-accordion
- @radix-ui/react-alert-dialog
- @radix-ui/react-aspect-ratio
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-collapsible
- @radix-ui/react-context-menu
- @radix-ui/react-dialog
- @radix-ui/react-dropdown-menu
- @radix-ui/react-hover-card
- @radix-ui/react-label
- @radix-ui/react-menubar
- @radix-ui/react-navigation-menu
- @radix-ui/react-popover
- @radix-ui/react-progress
- @radix-ui/react-radio-group
- +60 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.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.