A retrieval-grounded, cross-checked pipeline that turns a business name into a ranked, verified NAICS code — with a deterministic guardrail against invented codes and a human-review path when the evidence is thin.
Classification flow
name → evidence → code
Rendering diagram…
Input / output
Deterministic step
External source
Vector store
AI model
Human review
How it works
Normalize the name.Strip suffixes (Inc, LLC, Corp) and punctuation so lookups match.
Check the verified store.If this business was confirmed before, return that answer and skip the model calls — most repeat lookups cost a fraction of a full run.
Gather evidence in parallel.Structured registries pinpoint the high-priority facilities — NPPES (healthcare providers) and CMS Care Compare (nursing homes and dialysis centers) — alongside SEC EDGAR for public companies and a grounded web search for everything else, with federal-contractor registries (SAM, USASpending) available for added coverage.
Retrieve allowed codes.A vector search over the official NAICS taxonomy returns the candidate codes the classifier is allowed to choose from.
Classify.A reasoning model ranks up to three candidates from the evidence and the allowed codes, and returns strict JSON.
Filter deterministically.Drop any code that isn't in the validity table and attach its official title — the guardrail against hallucinated codes.
Cross-check with a second model.An independent reviewer judges only whether the evidence supports the top pick; a "no" flags the result for a human.
Overlay priority, return, and learn.Attach any restoration-priority designation, return the ranked result, and write confirmations back to the verified store so the next lookup is instant.
Stack-agnostic by design. The shape doesn't change with the infrastructure. Run it as serverless edge functions or as a container behind a model gateway; swap the search, model, and vector-store providers without touching the flow.