Agent Bento is a privacy-first home safety demo for older adults who live independently. It uses ambient Wi-Fi movement signals to notice unusual silence, asks for a friendly human check-in through a bento delivery, and alerts family only when the situation remains unresolved.
The hackathon experience combines an interactive 3D Japanese home, a visible fall scenario, a family dashboard, privacy-safe CSI feature processing, and a deterministic escalation policy.
ESP32 / RuView bridge / demo CSI frames
↓
Local privacy-safe feature extraction
↓
Vercel Next.js server and API routes
├─ GMI Cloud: activity inference
└─ Qwen Cloud: floor-plan vision, care decisions, Japanese delivery copy
↓
Deterministic safety policy and fallbacks
↓
3D story, family dashboard, bento check-in, family escalation
| Service | Responsibility |
|---|---|
| Vercel | Hosts the Next.js application and server-side API routes. Secrets stay in Vercel environment variables. |
| GMI Cloud | Runs server-side inference over privacy-safe CSI feature summaries and returns activity classification and confidence. |
| Qwen Cloud | Detects rooms from floor-plan images, produces structured care decisions, and generates Japanese delivery instructions. |
Raw API keys are never sent to the browser. The safety policy remains deterministic: generated output can explain or enrich a decision, but it cannot bypass the escalation rules.
- Responsive landing experience that explains the product immediately.
- Interactive 3D cutaway Japanese house with normal, fall, and courier states.
- Visible fallen resident, Wi-Fi signal paths, bento courier, and family alert story.
- Floor-plan upload and room detection through Qwen Cloud.
- Privacy-safe local CSI preprocessing before GMI Cloud inference.
- GMI Cloud activity classification with deterministic fallback behavior.
- Qwen Cloud care decisions and Japanese delivery instructions.
- Vercel-compatible Next.js route handlers.
- Browser-only dashboard setup stored in
localStorage. - Unit, production-build, and server-render tests.
The CSI sensor stream, courier dispatch, and family notification are simulated for the hackathon. A real pilot still requires calibrated hardware, persistent incident storage, delivery/notification integrations, consent workflows, and field testing.
- Node.js 22.13 or newer
- npm
- A GMI Cloud account and API key for live activity inference
- A Qwen Cloud API key for floor-plan vision and live care reasoning
- A Vercel account for deployment
The landing page and deterministic care fallback work without cloud credentials. Qwen credentials are required to analyze a newly uploaded floor plan. The selected GMI model has a default, so GMI is considered configured when GMI_API_KEY is present.
-
Clone the repository and enter the project directory.
git clone <your-repository-url> cd AgentBento
-
Install the exact dependency versions from the lockfile.
npm ci
-
Create a local environment file.
cp .env.example .env.local
-
Add your server-side credentials to
.env.local.GMI_API_KEY=your_gmi_key GMI_BASE_URL=https://api.gmi-serving.com/v1 GMI_CSI_MODEL=Qwen/Qwen3.8-Max QWEN_API_KEY=your_qwen_key QWEN_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1 QWEN_MODEL=qwen3.7-max QWEN_VISION_MODEL=qwen3.7-plus
Never prefix these keys with
NEXT_PUBLIC_; that would expose them to the browser. Do not commit.env.local. -
Find a GMI model ID available to your account.
curl "$GMI_BASE_URL/models" \ -H "Authorization: Bearer $GMI_API_KEY"
Qwen/Qwen3.8-Maxwas selected from the live GMI catalog as the flagship reasoning, vision, and text model. Agent Bento currently sends privacy-safe CSI feature summaries to it and validates the returned activity JSON. You can replace it with another returned modelidwhen optimizing cost or latency. -
Start the development server.
npm run dev
-
Open http://localhost:3000.
- Open
/. - Start with Unusual silence detected to show the fall scenario.
- Select Home is moving normally to explain the camera-free baseline.
- Select A human checks in to show the bento courier response.
- Drag or zoom the house to demonstrate that it is a live 3D scene.
- Use Play the 30-second story for the automatic judge presentation.
- Open
/dashboardor select Open family dashboard. - Upload a Japanese floor-plan image.
- Qwen Cloud identifies the living room, kitchen, bedroom, and bathroom.
- Confirm the room model and place the Wi-Fi point.
- Replay the monitoring story and watch the resident marker move through the detected rooms.
- Open the service-status panel to confirm GMI Cloud and Qwen Cloud configuration.
Dashboard setup is stored only in the current browser under agent-bento.home-setup.v4. Clear that localStorage entry to repeat onboarding from the beginning.
All routes run on the Vercel-hosted Next.js server.
curl http://localhost:3000/api/service-statusThe response lists exactly GMI Cloud and Qwen Cloud and reports whether each service has the required environment variables.
curl -X POST http://localhost:3000/api/care-summary \
-H "Content-Type: application/json" \
-d '{"roomId":"bathroom","logEntries":["Unusual silence detected"]}'If no mockCsiFrames are supplied, the route creates demo frames. The response includes local edge screening, optional GMI inference, the Qwen or deterministic decision, and a pipeline array showing which path ran.
curl -X POST http://localhost:3000/api/incident/check-in \
-H "Content-Type: application/json" \
-d '{"incidentId":"demo-001","roomId":"bathroom","situation":"Unusual silence detected","timeOfDay":"lunch"}'POST /api/floor-plan/analyze expects JSON containing an imageDataUrl such as data:image/png;base64,.... This route requires QWEN_API_KEY; the dashboard prepares the data URL automatically.
GET /api/ruview checks the optional RUVIEW_API_URL. For local development it can point to a LAN bridge. On Vercel it must be a publicly reachable HTTPS endpoint—localhost and .local addresses refer to the serverless environment and will not reach your home device.
npm run lint # ESLint
npm run build # Native Next.js production build
npm test # Unit tests, production build, and rendered-page test
npm run test:floor-plan # Live Qwen regression; requires npm run dev and QWEN_API_KEYTo test the floor-plan route on a non-default local URL:
AGENT_BENTO_BASE_URL=http://localhost:3001 npm run test:floor-plan- Push the repository to your Git provider.
- In Vercel, select Add New → Project and import the repository.
- Keep the detected framework as Next.js.
- Add these environment variables in Project Settings → Environment Variables:
GMI_API_KEYGMI_BASE_URLGMI_CSI_MODELQWEN_API_KEYQWEN_BASE_URLQWEN_MODELQWEN_VISION_MODELRUVIEW_API_URLandRUVIEW_TIMEOUTonly when using a public hardware bridge
- Add the variables to Production, Preview, and Development as appropriate. Do not give preview deployments production-only credentials unless necessary.
- Select Deploy.
Future pushes to the production branch create production deployments; other branches and pull requests create preview deployments.
npm install --global vercel
vercel login
vercel link
vercel env add GMI_API_KEY
vercel env add GMI_CSI_MODEL
vercel env add QWEN_API_KEY
vercel env pull .env.local
vercel deployAfter verifying the preview deployment:
vercel --prodThe non-secret base URLs and model names can also be added through the Vercel dashboard. Re-run vercel env pull .env.local --yes after changing project environment variables.
- Confirm
GMI_API_KEYis set and the account has enough GMI inference credit. - Verify the model ID using
GET https://api.gmi-serving.com/v1/models. - Restart
npm run devafter editing.env.local. - On Vercel, redeploy after adding or changing environment variables.
- Set
QWEN_API_KEYon the server. - Confirm
QWEN_VISION_MODELis available to the account. - Check that the uploaded file is a supported image and small enough for a serverless request.
This is expected when cloud keys are absent or a provider request fails. Inspect the pipeline field returned by /api/care-summary or /api/incident/check-in to see whether GMI, Qwen, or deterministic fallback logic handled each step.
Vercel cannot connect to a laptop-only localhost or LAN .local address. Expose the bridge through an authenticated HTTPS endpoint, or leave RUVIEW_API_URL empty and use demo CSI frames.
- No cameras or audio recordings are required.
- Raw CSI is processed locally; cloud services receive derived feature summaries.
- API credentials remain server-side.
- Resident consent and configurable contacts are required for a real deployment.
- Generated recommendations never override deterministic safety rules.
- Agent Bento is an assistive safety concept, not a medical diagnosis device.
app/ Next.js pages, 3D landing, dashboard, and API routes
app/api/ Vercel-hosted server endpoints
lib/csi-edge.ts Local privacy-safe CSI feature extraction
lib/ai-router.ts GMI → Qwen → deterministic fallback orchestration
lib/adapters/gmi.ts GMI Cloud inference client
lib/adapters/qwen.ts Qwen Cloud vision and reasoning client
public/data/ Simulated monitoring story
public/fixtures/ Floor-plan regression fixture
scripts/ Live integration regression scripts
tests/ Unit and production-render tests
docs/ Presentation and FAQ source material
AGENT.md Product, architecture, and engineering worklog
vercel.json Vercel framework configuration
- Connect calibrated ESP32-S3 CSI input through an authenticated public event bridge.
- Deploy and validate a CSI-specific activity model through a dedicated GMI endpoint.
- Add persistent residents, consent, incidents, actions, and acknowledgements.
- Add idempotent delivery ordering and courier-response webhooks.
- Add family notification delivery, acknowledgement, retries, and audit logs.
- Complete privacy, accessibility, failure-mode, and care-professional field testing.