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.
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
Reference architecture
Keep the browser focused on presentation. The application server owns context interpretation, catalogue access, validation and response structure.

“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- 1Extract facts and corrections
- 2Ask the one question that separates the options
- 3Retrieve candidates from the approved catalogue
Asks again only when a deciding fact is missing
- Every product ID from the catalogue
- Every fact matched to its record
- 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.
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 --> AOne 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.
LangChain
Provides model adapters, tools, prompt composition and schema-validated structured output.
LangGraph
Runs the stateful workflow: update facts, retrieve candidates, choose a question, recommend and validate.
LangSmith
Adds traces, datasets, evaluations and regression checks without becoming the source of product truth.
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.
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"]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.
- 02.2 · Project structureIn the PDF
- 02.3 · SetupIn the PDF
- 03 · Catalogue modelIn the PDF
- 04 · Conversation stateIn the PDF
- 05 · Follow-up logicIn the PDF
- 06 · Retrieval & matchingIn the PDF
- 07 · Response contractIn the PDF
- 07.1 · TypeScript implementationIn the PDF
- 08 · Build sequenceIn the PDF
- 08.1 · Run locallyIn the PDF
- 09 · Safety boundariesIn the PDF
- 09.1 · EvaluationIn the PDF
- 10 · Production checklistIn the PDF
- 10.1 · DeploymentIn the PDF
- 11 · LimitsIn the PDF
