Research

3 Approaches to Business Similarity

Comparing attribute-based, embedding-based, and fuzzy matching on 6,218 real Boise businesses

Cam Fortin · Product Hacker · April 8, 2026
6,218
Businesses
3
Models Tested
~$50
Total Data Cost

The Problem

When you're building a local business intelligence layer, one of the first questions users ask about any company is: who else is like them?

"Similar businesses" sounds simple until you think about what "similar" actually means. A brewery in downtown Boise is similar to another brewery across town (same industry). But it's also similar to the taproom next door (same location, same foot traffic). And it's similar to a craft distillery in the same price range (same customer profile).

We needed a similarity engine that could surface meaningful matches across 6,218 businesses scraped from Google Maps and OpenStreetMap -- and we wanted to understand which approach would scale best as we expand city by city.

The Dataset

Google Maps
Places API
3,197
businesses · ~$50 API cost
OpenStreetMap
Overpass API
3,021
businesses · $0 (open data)

Each business record includes name, lat/lon, NAICS code, super category, business type, and B2B/B2C classification. The entire enrichment pipeline runs locally on a Mac Studio M4 Max -- no cloud compute, no API calls at inference time. The data playbook is designed to be replicable per city in a single night.

Three Approaches to Similarity

Each approach represents a different philosophy about what makes two businesses "similar." We ran all three against the full 6,218 business dataset to see how they compare.

A
Attribute-Based Scoring
Deterministic · Weighted multi-signal
Strongest Coverage

A hand-tuned scoring function that combines five structured signals. No machine learning at match time -- every score is explainable and deterministic.

NAICS Code Match 40 pts max
40 pts same 6-digit · 25 pts same 4-digit · 10 pts same 2-digit
Super Category 20 pts max
Business Type Match 15 pts max
Geo Proximity 15 pts max
Decays with distance
B2B/B2C Alignment 10 pts max
B
Embedding-Based (Ollama)
Semantic vectors · Cosine similarity
Did Not Produce Results

The idea: generate dense vector embeddings of each business profile, then find nearest neighbors via cosine similarity. This should capture latent semantic relationships that rule-based systems miss.

Model Limitation

gemma4:e4b via Ollama's /api/embed endpoint returned empty vectors. The model doesn't natively support embedding generation -- it's a text generation model, not a bi-encoder. This is a known gap: not every Ollama model exposes usable embeddings.

Next step: test with a dedicated embedding model like nomic-embed-text or mxbai-embed-large.

C
Fuzzy Name + Type Matching
String similarity · Token overlap
Best Diversity

Uses fuzzy string matching on business names and type labels. No structured data required beyond a name and a category tag. This is the simplest approach -- and it surfaces surprising cross-category connections that the attribute model misses.

Head-to-Head Results

Metric Model A
Attribute
Model B
Embedding
Model C
Fuzzy
Coverage
100%
0%
99.7%
Avg Top Score
89.5
--
77.6
Matches/Business
10
--
10
Category Diversity
1.0
--
1.14
LLM at Match Time? No Yes No

Each approach has a different strength. The attribute model produces the highest-confidence matches because it leverages structured NAICS codes. The fuzzy model finds connections across category boundaries. And embedding-based search, once running with a proper bi-encoder, should capture semantic nuance that neither rule-based approach can.

Coverage Across 6,218 Businesses

Model A: Attribute-Based
100% · 6,218 businesses
avg 89.5
Model B: Embedding (gemma4:e4b)
0% · empty vectors
Model C: Fuzzy Name + Type
99.7% · 6,199 businesses
avg 77.6

In Practice: 10 Barrel Brewing

Here's what the attribute model returns for 10 Barrel Brewing, a local brewery in downtown Boise:

10 Barrel Brewing
Brewery · Food & Drink · B2C
Boise Brewing Brewery
95
Sockeye Brewing Brewery
93
Woodland Empire Ale Craft Brewery
91

Same NAICS code (312120), same super category, same B2C classification, and all within a few miles of downtown. The attribute model nails this class of query.

Where Model C shines: the fuzzy matcher might also surface a craft distillery or a taproom with a similar name pattern -- cross-category matches that the attribute model won't find because the NAICS codes differ. For a user exploring a neighborhood, that kind of diversity is valuable.

Architecture: Why Deterministic Wins (For Now)

Attribute Model
  • + 100% explainable scores
  • + Zero inference cost
  • + Sub-millisecond per pair
  • - Needs structured data
  • - Misses semantic nuance
Embedding Model
  • + Captures latent patterns
  • + Works on unstructured text
  • + Improves with more data
  • - Needs right model choice
  • - Black-box similarity
Fuzzy Model
  • + Near-zero requirements
  • + Good cross-category matches
  • + Fast to implement
  • - Lower confidence scores
  • - Name-dependent (noisy)

Cost to Replicate

$0
OSM Data
Overpass API
~$50
Google Maps
Places API
$0
Similarity Compute
Local Ollama
~$50
Total Per City
One night of compute
Hardware: Mac Studio M4 Max
36 GB unified memory · Local Ollama inference · No cloud required

Takeaways

1

Structured attributes beat unstructured approaches when you have the data.

The attribute model's 89.5 avg score vs. fuzzy's 77.6 comes down to NAICS codes. If you've invested in enrichment, you should use it.

2

Not every LLM supports embeddings. Choose your model deliberately.

Text generation models and bi-encoder embedding models are fundamentally different architectures. Ollama's embed endpoint works with dedicated embedding models, not chat models.

3

Fuzzy matching is an underrated complement to structured search.

Model C's 1.14 category diversity means it surfaces matches the attribute model can't. The best similarity engine probably blends both.

4

$50 per city is a viable unit economics for local business intelligence.

Google Maps + OSM + local compute means you can build a business similarity layer for any metro area overnight. The playbook is replicable.

What's Next

Attribute
Current production
Embeddings
nomic-embed-text
Hybrid
Best of both worlds

The production system will use the attribute model as the primary ranker and blend in embedding-based and fuzzy signals for diversity. This feeds directly into OnlyData Club company profiles, where "similar businesses" is one of the core intelligence layers.

Building local business intelligence pipelines?

Follow on LinkedIn

Product Hacker · Boise, Idaho · 2026