Enter a product or service and the search returns a commodity code and object code.
This page also provides some insight into how the semantic match and LLM are making their recommendations.
object code description and the LLM’s reasoning for selecting the commodity code.
Commodity Code Recommendation Shows the best-fit 8-digit UNSPSC commodity code and title, along with a brief explanation from the LLM to support its choice.
Semantic Search Matches Lists the ten commodity codes that rank highest by cosine similarity to the user’s prompt, plus each similarity score (labelled “Distance”).
Nearest-Neighbor Commodity Code Details Expands each of those ten neighbors into their full UNSPSC hierarchy (Segment → Family → Class → Commodity), so users see contextual definitions and notes.
Nearest-Neighbor t-SNE Visualization Plots the same ten neighbors in 2-D space using a pre-computed t-SNE array, giving a visual sense of how close they are to one another.
Closest Object Code Displays the recommended North Carolina object code and title and a table of the ten most semantically similar object codes with their similarity scores.
The data pipeline visualization below traces the movement from user prompt and raw data to on-screen report. Latency was trimmed by caching, parallel calls, and pre-computing heavy work, while costs were controlled with spot compute, right-sizing, static hosting, and token/egress limits.
Stage | What happens | Latency-reduction tactics | Cost-management tactics |
---|---|---|---|
Data Sources | UNSPSC and NC object-code CSVs are stored in Cloud Storage. | Keep files in a regional bucket near the Cloud Run service. |
|
Offline Pre-processing |
|
Heavy math done once, not per request. |
|
User Request (runtime) |
|
|
|
Cloud Run API | rag_pipeline.py merges everything and returns gzip-compressed JSON. |
Min instances = 1 keeps a warm container. |
|
Frontend (index.html + JS) | Renders tables, expandable hierarchy, and the t-SNE plot. | Lazy-load chart libraries only when the viz tab opens. |
|
On-screen Reports & Visuals | User sees results in ≈ 2 s. | Reuse cached JSON for instant tab switching. |
|
Commodity Codes: UNSPSC
Object Codes: NCCCS Chart of Accounts