Inspiration

Cooking several dishes at once is much harder than following a single recipe.

Each dish has its own preparation time, waiting periods, equipment requirements, and serving instructions. When those timelines overlap, the cook must constantly switch between recipe tabs, timers, and handwritten notes.

I built PEAR Cook to turn scattered recipes and kitchen constraints into one clear, coordinated cooking session. The goal is not to replace the cook’s judgment, but to reduce cognitive load while keeping the cook fully in control.

What It Does

PEAR Cook helps users plan and execute an entire meal from start to finish.

Users can:

  • Sign in securely with GitHub
  • Create a meal containing multiple dishes
  • Import recipes from public recipe URLs
  • Paste recipe text or describe a dish in natural language
  • Provide available ingredients, dietary restrictions, equipment constraints, a target serving time, and notes from photos
  • Review and edit extracted ingredients and instructions
  • Ask AI to modify recipes, such as changing serving sizes or removing ingredients
  • Generate a synchronized cooking plan designed to finish every dish at the same time
  • Review start times, dependencies, waiting periods, equipment usage, and parallel tasks
  • Explicitly approve the plan before an execution session begins
  • Follow a focused “Do this now” cooking interface
  • Start, complete, and track individual cooking steps
  • Use Gemini Live for hands-free, context-aware voice guidance
  • Switch between Japanese and English

The saved HTTP state remains authoritative throughout the session. Voice and realtime connections provide guidance and update signals, but disconnecting from voice never stops or invalidates the durable cooking session.

How I Built It

PEAR Cook is built on PEAR Agent’s Plan → Execute → Assess → Replan architecture.

The application is divided into several clear layers:

  • React and shadcn/ui provide the user interface
  • PEAR Agent Core defines typed cooking inputs, normalized recipes, plan steps, world-state facts, and runtime events
  • PEAR Agent AI handles structured recipe interpretation, transformation, and plan generation
  • Cloudflare Workers host the authenticated API and AI integration
  • Cloudflare D1 stores recipes, plans, sessions, runtime events, and materialized state
  • Cloudflare R2 stores imported source material
  • Durable Objects and PEAR execution sessions serialize updates during active cooking sessions
  • Gemini interprets recipes and produces structured cooking plans
  • Gemini Live provides conversational, hands-free assistance
  • GitHub OAuth with PKCE handles authentication

Every AI-generated recipe and cooking plan is validated against Zod schemas and deterministic domain rules.

I treat AI output as a proposal rather than trusted application state. Runtime changes occur only through typed PEAR events.

The scheduling system is designed around a shared finish line. PEAR Cook calculates when each dish should begin, inserts explicit waiting periods where necessary, and joins every recipe path at a final serving step.

Challenges I Ran Into

Coordinating Multiple Recipes

The largest challenge was coordinating several recipes as one meal rather than treating each recipe independently.

A useful plan must account for:

  • Preparation and cooking duration
  • Dependencies between steps
  • Passive waiting periods
  • Equipment and burner conflicts
  • Parallel tasks
  • The fact that one person cannot safely perform every task at once

The system therefore needs to distinguish between tasks that require active attention and tasks that can continue in the background.

Importing Recipes Reliably

Public recipe pages vary significantly in structure, completeness, and quality.

Because extracted recipe data may be incomplete or incorrect, PEAR Cook keeps all imported ingredients and instructions reviewable and editable before they can affect the final cooking plan.

Separating Durable Execution from Voice Connectivity

Voice assistance is useful in the kitchen, but it cannot be the source of truth.

A microphone disconnect, page refresh, network interruption, or temporary Gemini Live failure must not erase progress or stop the active session.

For this reason, the execution session is stored durably, while Gemini Live reads the current state and provides guidance on top of it.

Authentication and Authorization

Authentication and authorization required strict handling.

PEAR Cook uses a fail-closed authorization model. Every recipe, plan, source, and execution session is scoped to the authenticated GitHub user.

Unauthorized requests are rejected before database, storage, or AI operations are performed.

During self-review, I also discovered and fixed an open redirect vulnerability in the OAuth return path.

Supporting Japanese and English

Supporting two languages required more than translating navigation labels.

I localized:

  • Loading states
  • Empty states
  • Error messages
  • Approval flows
  • Execution states
  • Accessibility labels
  • Voice interface states

At the same time, user-authored and AI-generated recipe content is intentionally preserved in its original language.

Accomplishments That I’m Proud Of

I am especially proud that PEAR Cook provides a complete, approval-gated workflow rather than stopping at AI-generated text:

Sources → Interpret → Review and Edit → Compile → Approve → Execute

The user can inspect and edit both the extracted recipe and the generated cooking timeline before anything becomes an active cooking session.

Other accomplishments include:

  • Coordinating multiple dishes around a single target serving time
  • Making human approval a hard requirement before execution
  • Building a live cooking interface centered on the current task
  • Clearly separating current, upcoming, waiting, and parallel work
  • Supporting hands-free Gemini Live guidance without making voice authoritative
  • Preserving cooking progress across page refreshes and voice disconnects
  • Enforcing ownership across recipes, sources, plans, and execution sessions
  • Supporting Japanese and English throughout the complete workflow
  • Building a simple, responsive interface for desktop and mobile
  • Completing multiple independent self-review rounds with no remaining blocking findings

What I Learned

I learned that the most valuable role for AI in cooking is not simply generating recipes.

Its real value is converting incomplete and inconsistent source material into a structured proposal that a person can inspect, correct, and approve.

I also learned that orchestration must distinguish active work from passive waiting. A 30-minute resting period should not dominate the interface or prevent the cook from starting another dish.

Durable execution and conversational assistance are separate responsibilities.

The execution session must remain authoritative, while Gemini Live should:

  • Read the current state
  • Explain the next action
  • Answer contextual questions
  • Use typed tools when progress needs to be updated

Finally, I learned that human approval is not merely a confirmation button.

It is a meaningful boundary between an editable AI-generated proposal and durable execution. Making that transition explicit produced a safer, clearer, and more understandable product.

What’s Next

Future improvements include:

  • Partial replanning when ingredients, timing, or equipment change during cooking
  • Better detection of equipment and burner conflicts
  • Automatic scaling of quantities and cooking durations
  • Nutrition and allergen summaries
  • Photo-assisted ingredient inventory
  • Smarter substitutions based on available ingredients
  • Collaborative cooking sessions for multiple people
  • More advanced timer management through Gemini Live
  • Improved source provenance and extraction-confidence indicators
  • Support for additional languages
  • Production deployment using managed Cloudflare D1 and R2 resources

My long-term goal is for PEAR Cook to become a calm, reliable kitchen coordinator—one that understands the entire meal, preserves the cook’s decisions, and always makes the next action clear.

Share this project:

Updates