Read the full writeup →
strategize retrieve recommend critique weak pairing → re-strategize

A retrieval-tool-using LangGraph agent

Wine Pairing Agent

Describe your meal. The agent reasons from pairing principles to the right wine style, searches 130k real reviews for matching bottles, recommends with citations, and critiques its own pick, retrying if it's weak.

By Jeremy Lee · WSET Level 3 · built with LangGraph + Claude

RAG as a tool inside an agent

My Wine Sommelier RAG answers "find me a wine like X." This project puts that retrieval inside an agent that first has to work out what to search for. It reasons about the dish, body, fat, acidity, spice, forms a pairing strategy, calls retrieval as a tool, then checks whether the result is actually good before serving it.

• parse → ribeye (rich body), peppercorn sauce • strategize → bold tannic red · query: "structured Cabernet, firm tannins, black fruit" • retrieve → 6 candidate wines from the review index • recommend → drafted pairing with citations • critique → sound tannin + body match the fatty steak

Reasons, then searches

Works out the ideal wine style from pairing principles before it retrieves: not just keyword matching.

Retrieval as a tool

Calls semantic search over 130k real reviews, with your budget as a filter: real bottles, real scores, real prices.

Checks its own pairing

A critique node judges coherence and budget fit, and re-strategizes with feedback if the first idea is weak.

Every pick cited

Recommendations cite the exact review, with the tannin/acid/body logic spelled out.

The graph

parse ─▶ strategize ─▶ retrieve ─▶ recommend ─▶ critique ─┬─ clean ─▶ END ▲ (RAG tool) │ └───────────────── issues & budget ─────────┘

How to use it

  1. Tell it the dish and (optionally) a per-bottle budget and colour preference.
  2. It parses the dish, picks a target style, and searches real reviews for it.
  3. It recommends 1–2 bottles with the pairing logic, then critiques the choice.
  4. If the pairing is weak, it re-strategizes and tries again. You see the whole trace.
Under the hood: built with LangGraph; retrieval is local & free (sentence-transformers + Chroma); generation runs on the Claude CLI by default (your Claude subscription, no per-token cost) or the Anthropic API.
Get it on GitHub Read the setup guide