HTS MCP
Skip to Content
GuidesData Model

Data Model

The HTS hierarchy, data structures, and enrichment fields.

HTS Hierarchy

Section (Roman numeral I–XXII) └─ Chapter (2 digits, 01–99) └─ Heading / HTS4 (4 digits) └─ Subheading / HTS6 (6 digits) └─ Tariff Line / HTS8 (8 digits)

Sections

22 sections grouping chapters by broad commodity type. Each section has:

  • Roman numeral identifier (I–XXII)
  • Title (e.g., “Live Animals; Animal Products”)
  • Chapter range (e.g., chapters 01–05)
  • Interpretive notes

Chapters

98 chapters, each with:

  • 2-digit code
  • Description
  • Section assignment
  • Chapter notes (legal classification rules)

Headings (HTS4)

4-digit headings subdivide chapters. Each heading has:

  • 4-digit code
  • Description extracted from the hierarchical section data

Subheadings (HTS6)

6-digit subheadings are the international standard level (Harmonized System). With AI enrichment, each HTS6 code gains:

  • Enriched description: Concise AI-generated summary (max 100 chars)
  • Keywords: 5-7 product-specific terms
  • Exclusionary terms: Attributes that don’t apply to this category
  • Common attributes: Attributes shared by all child HTS8 codes

Tariff Lines (HTS8)

8-digit tariff lines are the most specific level. Each has:

  • HTS8 code
  • Brief description
  • MFN rates (text rate, ad valorem percentage, specific rate)
  • 50+ FTA rate columns (USMCA, CAFTA-DR, AGOA, GSP, etc.)
  • Effective date range

FTA Rate Structure

The tariffs table includes columns for every major FTA program. Key rate columns:

Column PatternExampleDescription
mfn_text_rate"6.4%"MFN rate as text
mfn_ad_val_rate6.4MFN ad valorem as number
mfn_specific_rate0.26MFN specific rate
*_text_rateVariousFTA rate as text
*_ad_val_rateVariousFTA ad valorem as number
*_specific_rateVariousFTA specific rate

Embeddings

Multi-level embeddings enable search at every hierarchy level:

LevelVariantEmbedding Text Format
chapterfull"section {roman}: {title}; chapter {num}: {title}"
hts4full"section ...; chapter ...; category: {heading_desc}"
hts6full"section ...; chapter ...; category: {hts4_desc}; hts 6-digit: {code} - {enriched_desc}; keywords: {kw}"
hts6short"hts 6-digit: {code} - {enriched_desc}; keywords: {kw}"
hts8full"category: {hts4_desc}; hts 6-digit: {hts6}; keywords: {kw}; hts 8-digit: {code} - {desc}"
hts8short"hts 8-digit: {code} - {desc}"

All embeddings use OpenAI text-embedding-3-small (1536 dimensions).

Knowledge Graph

Semantic edges connect related tariff codes with classified relationships:

FieldTypeDescription
source_codestringSource HTS code
target_codestringTarget HTS code
relationship_typeenumOne of 10 types (see below)
confidencefloat0-1 classification confidence
reasoningstringLLM reasoning (25-30 words)
key_differentiatorstringWhat distinguishes the codes (max 8 words)
bidirectionalbooleanWhether the relationship is symmetric
similarityfloatOriginal cosine similarity from KNN

Relationship Types

TypeDefinition
material_affinitySame material, different forms or processing
functional_similaritySame purpose, different materials or construction
manufacturing_processSimilar production methods
end_useComplementary products used together
substitutionBorderline products straddling categories
component_assemblyPart-to-whole relationships
cross_category_bridgeUnexpected connection across taxonomy
abstractionHierarchical parent-child relationship
weak_associationTangentially related
no_meaningful_relationshipFalse positive from KNN

Code References

The tariff_code_references table maps cross-references found in tariff descriptions:

FieldDescription
source_hts8The tariff whose description contains the reference
referenced_codeThe code as it appears in the text (may include dots)
referenced_code_cleanNormalized code (digits only)
code_lengthLength of the referenced code (4, 6, or 8 digits)