Build Guide 001 cover: a chat bubble asking the deciding question, whether the water carries scale, and an answer that matches the catalogue, with the OpenRouter, LangChain, LangGraph and LangSmith reference stack
Build Guide · 001

Build an AI Product Discovery Agent

A practical Build Guide for a catalogue-grounded agent that understands customer needs, asks contextual questions and returns validated product recommendations.

Difficulty
Intermediate
Reference build
2–4 days
Architecture type
Stateful catalogue retrieval
Updated
November 2026
Language
English

Production scope and quote come from an AI Solution Blueprint.

On this page

Need it on your systems? Start an AI Solution Blueprint

Before you start

What you’ll build and why

The problem

Most product journeys are organised around the catalogue, not the customer. The customer has to translate a real need into the exact names, categories and filters the business already uses. Many customers can describe the outcome they want without knowing which product, plan or service delivers it. Filters only help someone who already understands the differences inside the catalogue, and a large catalogue slows the decision when the trade-offs are not obvious. Keyword search can return pages with the right words and still miss what the customer is trying to achieve. Meanwhile, sales and support teams keep answering the same discovery questions to identify the right option.

What you’ll build

This Build Guide walks you through a reference AI Product Discovery Agent that starts from the need instead of the keyword. It understands a request written in plain language, keeps the useful facts from earlier messages and, when it cannot decide yet, asks for the single most useful missing fact. When the customer corrects something, the correction replaces the old fact instead of sitting beside it. The agent searches only an approved catalogue, explains why each option fits, compares suitable options and returns structured product cards with a clear next action: an enquiry, a booking, a purchase or a human conversation, with the customer’s consent. A need the catalogue cannot meet gets an honest no-match instead of an invented product. The application server owns context, catalogue access, validation and the response contract, while the browser only presents. The catalogue stays the only product authority: a model can help interpret language, but it cannot create products or claims.

Who it’s for

The guide is for developers, technical leads and product teams who want customers to find the right product by describing a need, grounded in their own catalogue rather than in a chat box that guesses. You should be comfortable with a current JavaScript or TypeScript server project. Every example uses a fictional plant-spares catalogue, so you can follow each decision before touching real data. The reference names one educational stack, OpenRouter, LangChain, LangGraph and LangSmith, with an approved catalogue or data store and a Web Hoster / Cloud Infrastructure, and you can replace any of them. It is a reference to learn from, not Ting’s production agent: Ting’s prompts, ranking, private integrations and customer data are not part of it.

01 · Reference scope

What this reference covers

The reference focuses on the public capability pattern: understand a need, preserve useful context, search an approved catalogue, explain matches and guide the next action.

Included

  • Conversation UI and turn contract
  • Fictional catalogue structure
  • Context correction rules
  • Contextual question selection
  • Catalogue-grounded matching
  • Structured product responses
  • Deterministic fallback
  • Isolation and validation boundaries

Not included

  • Ting’s real website agent
  • Production prompts or ranking
  • Private integrations
  • Real customer or CRM data
  • Ting’s production provider choices
  • Production security implementation details
02 · Architecture

Reference architecture

Keep the browser focused on presentation. The application server owns context interpretation, catalogue access, validation and response structure.

Reference map · 001Product discovery, end to end
Customer need

“Pump P-204 at our plant is leaking at the seal again. Which seal should we order?”

Arabic or English, in the customer’s own words
Discovery agent
  1. 1Extract facts and corrections
  2. 2Ask the one question that separates the options
  3. 3Retrieve candidates from the approved catalogue

Asks again only when a deciding fact is missing

Checked in code
  • Every product ID from the catalogue
  • Every fact matched to its record
Recommendation
  • 2–3 approved products
  • Why each one fits
  • Next step: quote or handoff

The catalogue is the only product authority. Prices and stock come from your systems; a handoff needs the customer’s consent.

Reference map. The component, stack and turn diagrams below define the executable behaviour.
Reference architecture
Conversation StateConversation UIApplication ServerIntent & RequirementsApproved Local CatalogueRetrieval & Match LayerValidation LayerStructured Response
Source
flowchart LR
    A["Conversation UI"] --> B["Application Server"]
    B --> C["Conversation State"]
    B --> D["Intent & Requirement Extraction"]
    D --> E["Approved Local Catalogue"]
    E --> F["Retrieval & Match Layer"]
    F --> G["Validation Layer"]
    G --> H["Structured Response"]
    H --> A
02.1 · Reference stack

One practical stack for building the reference

This reference uses OpenRouter, LangChain, LangGraph and LangSmith to make the implementation concrete. These are educational reference choices, not a statement about Ting’s production stack.

OpenRouter

A model gateway for the reference model interface. Select a model that supports the language, latency and structured-output needs of your project.

Official documentation

LangChain

Provides model adapters, tools, prompt composition and schema-validated structured output.

Official documentation

LangGraph

Runs the stateful workflow: update facts, retrieve candidates, choose a question, recommend and validate.

Official documentation

LangSmith

Adds traces, datasets, evaluations and regression checks without becoming the source of product truth.

Official documentation

Approved catalogue / data store

A versioned JSON catalogue works locally. A production system can use an approved database or business data source behind the same validated repository interface.

Web Hoster / Cloud Infrastructure

Runs the server-side API, injects secrets securely, exposes health checks and supports logging, monitoring and rollback.

Reference stack flow
Web Hoster / Cloud InfrastructureConversation UIApplication APILangGraph WorkflowLangChain tools andstructured outputOpenRouterApproved Product CatalogueLangSmith tracingand evaluation
Source
flowchart LR
    UI["Conversation UI"] --> API["Application API"]
    API --> GRAPH["LangGraph Workflow"]
    GRAPH --> CHAIN["LangChain Tools and Structured Output"]
    CHAIN --> ROUTER["OpenRouter"]
    GRAPH --> CATALOG["Approved Product Catalogue"]
    GRAPH --> TRACE["LangSmith Tracing and Evaluation"]
    API --> HOST["Web Hoster / Cloud Infrastructure"]
In the full Build Guide

Setup, code, tests and deployment are in the PDF

This page shows the scope, the architecture and the reference stack with its official documentation. The implementation sections listed below are in the full Build Guide PDF: enter your name and mobile number once and it downloads. This device then stays unlocked for every free Ting resource.

  1. 02.2 · Project structureIn the PDF
  2. 02.3 · SetupIn the PDF
  3. 03 · Catalogue modelIn the PDF
  4. 04 · Conversation stateIn the PDF
  5. 05 · Follow-up logicIn the PDF
  6. 06 · Retrieval & matchingIn the PDF
  7. 07 · Response contractIn the PDF
  8. 07.1 · TypeScript implementationIn the PDF
  9. 08 · Build sequenceIn the PDF
  10. 08.1 · Run locallyIn the PDF
  11. 09 · Safety boundariesIn the PDF
  12. 09.1 · EvaluationIn the PDF
  13. 10 · Production checklistIn the PDF
  14. 10.1 · DeploymentIn the PDF
  15. 11 · LimitsIn the PDF
FAQ

Questions about this Build Guide

What does this Build Guide cover?
A reference AI Product Discovery Agent grounded in an approved catalogue: the conversation UI and turn contract, a fictional catalogue structure, context correction rules, contextual follow-up questions, catalogue-grounded matching, structured product responses, a deterministic fallback, and isolation and validation boundaries.
Who is it for, and what do I need before starting?
Developers, technical leads and product teams building product discovery around their own catalogue. You need a current JavaScript or TypeScript server project, an OpenRouter API key stored only on the server, and a fictional or approved catalogue to test against.
Which tools does the reference use?
OpenRouter as the model gateway through a LangChain adapter, LangGraph for the workflow, LangSmith for traces and evaluation, an approved catalogue or data store (a versioned JSON file works locally) and a Web Hoster / Cloud Infrastructure for the server-side API. They are educational choices, not a statement about Ting’s production stack.
Where are the code, setup and tests?
In the full Build Guide PDF. This page shows the scope, the architecture and the reference stack. The project structure, setup, catalogue model, TypeScript implementation, local run, evaluation, production checklist and deployment are in the PDF: enter your name and mobile number once and it downloads.
Is this Ting’s production system?
No. It is an educational reference architecture inspired by the capabilities demonstrated on the Ting website. It is not Ting’s production architecture, internal prompt system, or proprietary implementation. For your own catalogue, Ting specifies the production system in an AI Solution Blueprint, with a defined quote.