A Pinata / OpenClaw template for building a voice-first cooking companion.
This template is designed for agents that need to help people cook in real time:
- save and search recipes
- maintain lightweight cooking session state in SQLite
- accept spoken cooking queries
- answer with structured JSON plus optional generated audio
- support embedded clients such as ESP32-based kitchen devices
- expose a hosted
/approute for recipe browsing and debugging
- Next.js App Router project
- SQLite-backed recipe, food-event, and voice-session persistence
/queryfor JSON text / next-step requests/query-audiofor multipart spoken queries and JSON next-step requests- generated MP3 serving via
/app/api/audio/[name] - generated-audio cleanup script under
workspace/scripts/prune-generated-audio.sh
The cooking flow uses a narrow persistent session model, not a general chat transcript.
Session state tracks:
- active recipe
- current ingredient / step index
- phase (
ingredientsvssteps) - pending follow-up prompt state
That makes the template a good fit for:
- hands-free cooking
- speaker-first interfaces
- mobile companion flows
- embedded kitchen devices
The template includes a hosted /app route that works as a:
- read-only recipe explorer
- debugging surface for saved recipes and events
- lightweight companion UI for the voice backend
The current implementation uses OpenAI for:
- speech-to-text
- text-to-speech
Required secret for voice features:
OPENAI_API_KEY
If OPENAI_API_KEY is absent, the intended behavior is to fall back to text-oriented guidance where possible rather than pretending voice is available.
Generated audio files are treated as temporary artifacts, not durable user data.
They are written under:
workspace/generated-audio
And cleaned up by:
workspace/scripts/prune-generated-audio.sh
Clients should treat returned audio URLs as temporary fetch targets.
npm installnpm run devOpen:
http://localhost:3000/app
npm run build
npm run start:webOr with PM2 runtime:
npm run startIf you're modifying the voice flow, start here:
app/query/route.tsapp/query-audio/route.tsapp/api/audio/[name]/route.tslib/audio-query.tslib/recipes.tsworkspace/AUDIO_QUERY_ARCHITECTURE.mdworkspace/scripts/prune-generated-audio.sh
The template's behavior is intentionally shaped by the workspace files:
workspace/AGENTS.md— session-start and workspace operating rulesworkspace/BOOTSTRAP.md— first-run cooking profile collectionworkspace/SOUL.md— tone and voice-first behavior contractworkspace/USER.md— durable user cooking + delivery preferencesworkspace/TOOLS.md— environment-specific notesworkspace/IDENTITY.md— editable template identity
This repo is meant to be a clean template for a voice-first cooking companion — not a generic recipe scrapbook and not a broad food chatbot.
The intended product shape is:
- practical while cooking
- good at step progression
- good at short spoken responses
- grounded in saved recipes
- usable from web, phone, or embedded clients
For a detailed implementation handoff, see:
workspace/AUDIO_QUERY_ARCHITECTURE.md