Problem
Etsy sells handcrafted and vintage items from millions of merchants to over 86 million buyers. Each listing is unique, so there is no fixed attribute schema, only noisy free-text descriptions, and key details sit in the photos. Gifting is fuzzy: the shopper may know the recipient but have no idea what to give. The team built a conversational gifting agent with three senior engineers and one designer, and had to make it reliable and measurable.
Example from the article: The agent repeatedly called the same listing search tool, returned truncated listing IDs, and once stored a t-shirt size in the recipient's interest field.
Solution in brief
A LangChain v1 ReAct agent with retrieval, memory and skill tools. Deterministic middleware in code catches loops and fixes hallucinated IDs. A CLI built on LangSmith simulates users, collects human relevance labels, and aligns an LLM judge to them by automated prompt optimization. The beta shipped in six weeks.
Questions this case answers
- How to build and launch a tool-calling agent over a catalog without a fixed attribute schema while keeping its behavior reliable
- How to align an LLM judge to human relevance labels so that open-ended agent outputs can be scored automatically
- How to ship a conversational search agent over a messy, unstructured catalog with a small team in weeks?
- How to stop an LLM agent from looping on the same tool call or returning corrupted listing IDs?
Tools and methods
- LangChain v1 ReAct agent — picks tools and returns a curated listing list
- LangGraph and LangSmith — agent runtime, tracing, datasets, splits and deployment
- PostgreSQL key-value store — long-term memory of recipient profiles
- Middleware — guards against repeated tool calls and wrong listing IDs
- Pass-K tests — check the tool-call trajectory of a non-deterministic agent
- LLM judge aligned to a golden dataset — scores fit to recipient and budget
Google or a one-time email code. No password.