AI
Human-in-the-Loop Lab
AI proposes an email draft; you edit it, then POST the approved payload to a webhook URL.
Run this experiment yourself
Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.
Local development
cd apps/experiments/human-in-the-loop-lab pnpm install pnpm dev
Then open http://localhost:3010.
This is an experimental demo. Use it as a starting point for your own projects.
Generate an email draft with AI, edit it in the UI, then approve a POST to your webhook. Missing AI keys return 503.
Features
- Standalone Next.js app under
apps/experiments/human-in-the-loop-lab/. - Honest degradation when optional services are missing.
- Unit-tested helpers in
logic.ts.
Server Reference
POST /api/propose · POST /api/send
{ "brief": "..." } / { "email": {...}, "webhookUrl": "..." }Implementation Details
Run the demo
Use the embedded playground or pnpm dev in the experiment app.
Inspect the handlers
Copy Route Handlers from apps/experiments/human-in-the-loop-lab/ into your project.
Limitations
- Educational demo — not a production-hardened product.
- Inputs are length-capped.
Use in your project
Copy the experiment folder or individual Route Handlers.
Deployment
Local Development
cd apps/experiments/human-in-the-loop-lab
pnpm install
pnpm devConfiguration
| Variable | Required | Purpose |
|---|---|---|
AI_GATEWAY_API_KEY | Yes | Lab configuration |
Vercel / Next.js Features Used
- AI SDK, AI Gateway, Zod