← Back to Blog
MAY 30, 2026 · 4 MIN READ

What building an AI Sommelier taught me about prompts

A picture of Thomas Béchu
Thomas Béchu
Article4 MIN READ

What building an AI Sommelier taught me about prompts

MAY 30, 2026

Thomas Béchu© 2026

A few months ago, I built Victor AI—a simple web app that recommends the perfect wine for whatever food you are eating.

On paper, the logic sounds simple: the user types in their dish, we send it to an LLM, and it replies with a wine. But as I quickly learned, pairing food with wine is a highly subjective, cultural, and context-dependent process.

If you ask a lazy question, you get a generic, boring answer. Here is how I went from "AI-hallucinated Cabernet" to a truly smart sommelier by refining my prompts.


The Trap of Lazy Prompting

When I first started, my prompt was essentially: "You are a sommelier. Suggest a wine to go with: [DISH]."

If the user typed in "steak," the AI would inevitably respond with something like: "You should drink a Cabernet Sauvignon because it has tannins that cut through the fat of the steak."

It's not technically wrong, but it’s incredibly basic. It’s the kind of advice you’d find on the back of a grocery store bottle. What if the steak is seasoned with sweet teriyaki? What if the user prefers white wines? What if their budget is $15, and the recommended bottle is $80?


Rule 1: The Model is Only as Good as the Context

To get high-quality recommendations, you need to feed the AI structured, multi-dimensional context. Instead of just passing a text string of the dish, we structured the input to collect:

  1. The Dish: The core food item.
  2. Preparation: How is it cooked? (Grilled, braised, raw, fried).
  3. Key Flavors: Is it spicy, sweet, acidic, heavy, or light?
  4. User Preferences: Red/White/Sparkling, dry/sweet, or open.
  5. Budget: Under $20, $20-$50, or special occasion.

We packed this info into a clean JSON structure to pass to the model:

{
  "dish": "Ribeye Steak",
  "preparation": "Grilled with rosemary garlic butter",
  "flavors": ["savory", "herby", "fatty"],
  "budget": "under $50",
  "preferences": {
    "preferred_types": ["red", "sparkling"],
    "avoid_regions": ["Bordeaux"]
  }
}

Now, the model isn't guessing. It has exact bounds to make an intelligent, tailored suggestion.


Rule 2: Constrain the Output Format (Structured Output)

At first, the model would write long paragraphs of text. That's fine for reading, but terrible for rendering a beautiful UI. I needed the name of the wine, the region, the price range, and a brief description as separate fields.

Using structured output constraints (or libraries like Zod/Pydantic) makes integration seamless. Here is how we call the model using TypeScript to guarantee we get clean JSON back:

import { OpenAI } from 'openai';

const openai = new OpenAI();

async function getWineRecommendation(foodContext: any) {
  const response = await openai.chat.completions.create({
    model: "gpt-4o-mini",
    messages: [
      {
        role: "system",
        content: `You are an expert sommelier. You recommend exactly ONE specific wine style or bottle for a meal. 
        Your response must be a JSON object with these keys: 
        - 'wineName': the name/style of the wine.
        - 'reason': a single, compelling sentence explaining why it pairs with the dish.
        - 'servingTemp': ideal temperature to serve.
        - 'alternativeStyle': a backup choice of a different color (e.g. if main is red, suggest a white).`
      },
      {
        role: "user",
        content: JSON.stringify(foodContext)
      }
    ],
    response_format: { type: "json_object" }
  });

  return JSON.parse(response.choices[0].message.content || '{}');
}

By requesting structured JSON, the backend can confidently display the data in custom UI elements (like cards, badges, and progress bars) without doing string manipulation hacks.


Rule 3: Single Confidence beats Option Paralysis

In my early designs, I asked the AI to give the user three options. It felt like I was giving them more value.

In practice, users hated it. They didn't want to make more decisions—they came to the app to have the decision made for them. Asking for a single, highly confident recommendation accompanied by a short, punchy explanation felt much more like a premium sommelier experience.

If you are building an AI tool, don't throw options at your users to cover your bases. Do the prompt-tuning work to make sure your first answer is the best answer. 🍷

What building an AI Sommelier taught me about prompts - Thomas Béchu