Match
Find duplicate records and link the same real-world entity across tables with probabilistic matching
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/match/index.md to help me query Match with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Find records that belong to the same person
Example output · captured
- Connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT first_name, last_name, email, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name
| first_name | last_name | cluster_id | |
|---|---|---|---|
| John | Smith | [email protected] | 0 |
| Jon | Smith | [email protected] | 0 |
| Jane | Doe | [email protected] | 1 |
Quick start
Choose where to run Match, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'match' AS match (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-match'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'match' AS match (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-match:0.5.0'
);
3. Run a query
SELECT first_name, last_name, email, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'match' AS match
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT first_name, last_name, email, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name
Query Farm operates Match for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use match as the catalog alias for the query below.
4. Run a query
SELECT first_name, last_name, email, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'match' AS match (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-match'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'match' AS match (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-match:0.5.0'
);
Overview
Probabilistic entity resolution / record linkage / dedup (Splink) for SQL.

Match brings fuzzy entity resolution, record linkage, and deduplication directly into DuckDB SQL -- point it at a messy relation, name the columns to compare, and get back clusters of rows that refer to the same real-world person, customer, contact, or product.
What it does and who it's for
Real-world data is full of duplicates that exact GROUP BY and JOIN can never catch: John Smith vs Jon Smith, [email protected] vs [email protected], typos, nicknames, and transpositions. Match solves this probabilistic matching problem in plain SQL. It is built for data engineers, analysts, and data-quality teams who need to deduplicate customer master data, consolidate CRM contacts, link records across systems, or clean a product catalog -- without exporting to a separate Python pipeline. You stay in DuckDB; Match does the fuzzy matching and clustering and hands you back the same rows plus an entity label.
How it works and the engine behind it
Match is powered by Splink, the open-source probabilistic record-linkage library from the UK Ministry of Justice. Under the hood it uses the Fellegi-Sunter statistical model with fuzzy string comparisons (Jaro-Winkler for name-like columns, Levenshtein edit distance for the rest) to estimate, for every candidate pair of records, the probability that they describe the same entity. Pairs scoring above a threshold are linked, and connected components of linked records collapse into entity clusters. The default model is deterministic and robust on relations of any size, while train := true opts into Splink's unsupervised EM estimation for larger datasets. See the Splink documentation and this introduction to probabilistic linkage for the theory.
SQL use cases and the function surface
Match exposes a single, focused table function, match_resolve(relation, columns := '...', threshold := 0.5, train := false). Pass a relation as a subquery and the comparison columns; it returns every input row unchanged plus two appended columns: cluster_id (rows sharing it are the same entity) and match_probability (confidence per row). Use it to deduplicate a customer or contact list, link records that refer to the same organization, or detect duplicate products before a migration.
A typical call passes your rows as a parenthesised subquery and names the comparison columns -- match_resolve(relation, columns := 'first_name,last_name,email') -- then orders or groups the result by cluster_id to inspect each resolved entity or to count how many records collapsed into it. Fully runnable, coverage-checked queries live in the function's own example set (see match.main.match_resolve) and in the main schema examples.
Notes
- The default model is deterministic and robust on relations of any size;
train := trueopts into Splink's unsupervised EM (weak on tiny inputs). - This is a buffer-all-then-compute operator (entity resolution is an all-pairs problem), so block tightly for very large inputs.
Catalog
Everything match exposes once attached — read straight from the worker's
released build.
main 1 view · 1 function
Probabilistic entity resolution / record linkage / dedup (Splink) for SQL
Schema examples (5)
Resolve three records on name + email and inspect the entity each row was assigned to, grouped by cluster.
SELECT first_name, last_name, email, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name;
| first_name | last_name | cluster_id | |
|---|---|---|---|
| John | Smith | [email protected] | 0 |
| Jon | Smith | [email protected] | 0 |
| Jane | Doe | [email protected] | 1 |
Count how many records collapsed into each resolved entity, largest duplicate group first.
SELECT cluster_id, count(*) AS n
FROM match.main.match_resolve((SELECT * FROM (VALUES ('Ann','Lee'),('Anne','Lee'),('Bob','Ng')) AS t(first_name,last_name)), columns := 'first_name,last_name')
GROUP BY cluster_id
ORDER BY n DESC;
Build a golden record per entity: resolve the built-in sample_customers demo on name + email and collapse each cluster to one row (lowest record_id, the first-name spellings seen, email, city, and how many source records merged) -- the three Smith variants and two Doe variants each become one row, the two Jones stay separate.
SELECT min(record_id) AS golden_record_id,
string_agg(DISTINCT first_name, ' / ' ORDER BY first_name) AS name_variants,
any_value(last_name) AS last_name, any_value(email) AS email,
any_value(city) AS city, count(*) AS source_records
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, city FROM match.main.sample_customers), columns := 'first_name,last_name,email')
GROUP BY cluster_id
ORDER BY golden_record_id;
Score the resolver against sample_customers' ground-truth expected_entity label: self-join the resolved rows into record pairs and count true/false positive and false negative links, with pairwise precision and recall (4 true links, no false ones: precision = recall = 1.0).
WITH resolved AS (SELECT record_id, expected_entity, cluster_id FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name,email')), pairs AS (SELECT a.cluster_id = b.cluster_id AS predicted_same, a.expected_entity = b.expected_entity AS actually_same FROM resolved AS a JOIN resolved AS b ON a.record_id < b.record_id) SELECT count(*) FILTER (WHERE predicted_same AND actually_same) AS true_pos, count(*) FILTER (WHERE predicted_same AND NOT actually_same) AS false_pos, count(*) FILTER (WHERE NOT predicted_same AND actually_same) AS false_neg, round(true_pos / nullif(true_pos + false_pos, 0), 3) AS precision, round(true_pos / nullif(true_pos + false_neg, 0), 3) AS recall
FROM pairs;
1 more example
Check what dropping email costs: resolve sample_customers on first + last name only at threshold 0.7 and count clusters per ground-truth entity -- Jane/Janet Doe still link, but the John/Jon/Johnny Smith variants split into three clusters (under-merging).
SELECT expected_entity, count(*) AS records,
count(DISTINCT cluster_id) AS clusters
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name', threshold := 0.7)
GROUP BY expected_entity
ORDER BY expected_entity;
sample_customers
A small, browsable demo relation of customer records with planted duplicates (and a ground-truth expected_entity label) to try match_resolve against.
Count the sample records that belong to each ground-truth entity -- the planted duplicate groups match_resolve should reproduce.
SELECT expected_entity, count(*) AS records
FROM match.main.sample_customers
GROUP BY expected_entity
ORDER BY records DESC, expected_entity;
Inspect just the messy Smith records (three spelling variants of one real person) to see the kind of duplication entity resolution targets.
SELECT record_id, first_name, last_name, email
FROM match.main.sample_customers
WHERE last_name = 'Smith'
ORDER BY record_id;
match_resolve (data TABLE, columns := VARCHAR, threshold := DOUBLE, train := BOOLEAN)
Probabilistic entity resolution / record linkage / dedup (Splink, MIT). Buffers the whole input relation, runs Splink's Fellegi-Sunter model with fuzzy (Jaro-Winkler / Levenshtein) comparisons over the chosen columns, links record pairs above a match-probability threshold, and returns the input rows unchanged plus an appended cluster_id (rows sharing one are the same real-world entity) and match_probability. Use it to deduplicate or link customer, contact, or product records that exact GROUP BY / JOIN miss.
Dedup on name + email; the John/Jon Smith rows share a cluster_id, Jane Doe is separate.
SELECT first_name, last_name, email, cluster_id, match_probability
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name;
Build a golden record per entity: resolve the built-in sample_customers demo on name + email and collapse each cluster to one row (lowest record_id, the first-name spellings seen, email, city, and how many source records merged) -- the three Smith variants and two Doe variants each become one row, the two Jones stay separate.
SELECT min(record_id) AS golden_record_id,
string_agg(DISTINCT first_name, ' / ' ORDER BY first_name) AS name_variants,
any_value(last_name) AS last_name, any_value(email) AS email,
any_value(city) AS city, count(*) AS source_records
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, city FROM match.main.sample_customers), columns := 'first_name,last_name,email')
GROUP BY cluster_id
ORDER BY golden_record_id;
Score the resolver against sample_customers' ground-truth expected_entity label: self-join the resolved rows into record pairs and count true/false positive and false negative links, with pairwise precision and recall (4 true links, no false ones: precision = recall = 1.0).
WITH resolved AS (SELECT record_id, expected_entity, cluster_id FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name,email')), pairs AS (SELECT a.cluster_id = b.cluster_id AS predicted_same, a.expected_entity = b.expected_entity AS actually_same FROM resolved AS a JOIN resolved AS b ON a.record_id < b.record_id) SELECT count(*) FILTER (WHERE predicted_same AND actually_same) AS true_pos, count(*) FILTER (WHERE predicted_same AND NOT actually_same) AS false_pos, count(*) FILTER (WHERE NOT predicted_same AND actually_same) AS false_neg, round(true_pos / nullif(true_pos + false_pos, 0), 3) AS precision, round(true_pos / nullif(true_pos + false_neg, 0), 3) AS recall
FROM pairs;
5 more examples
Check what dropping email costs: resolve sample_customers on first + last name only at threshold 0.7 and count clusters per ground-truth entity -- Jane/Janet Doe still link, but the John/Jon/Johnny Smith variants split into three clusters (under-merging).
SELECT expected_entity, count(*) AS records,
count(DISTINCT cluster_id) AS clusters
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name', threshold := 0.7)
GROUP BY expected_entity
ORDER BY expected_entity;
Surface only duplicate groups by clustering and keeping entities with more than one record.
SELECT cluster_id, count(*) AS rows_in_entity
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]'),('Jayne','Doe','[email protected]'),('Bob','Ng','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
GROUP BY cluster_id
HAVING count(*) > 1
ORDER BY rows_in_entity DESC;
Stricter resolution: raise the link threshold and keep only the more-confident matches.
SELECT first_name, last_name, cluster_id, match_probability
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email', threshold := 0.9)
WHERE match_probability >= 0.5
ORDER BY cluster_id, first_name;
SELECT first_name, last_name, cluster_id
FROM match.main.match_resolve((SELECT * FROM (VALUES ('John','Smith','[email protected]'),('Jon','Smith','[email protected]'),('Jane','Doe','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email')
ORDER BY cluster_id, first_name;
SELECT count(DISTINCT cluster_id) AS entities
FROM match.main.match_resolve((SELECT * FROM (VALUES ('Ann','Lee','[email protected]'),('Anne','Lee','[email protected]'),('Bob','Ng','[email protected]')) AS t(first_name,last_name,email)), columns := 'first_name,last_name,email');
Try these queries
Count how many records collapsed into each resolved entity, largest duplicate group first.
SELECT cluster_id, count(*) AS n
FROM match.main.match_resolve((SELECT * FROM (VALUES ('Ann','Lee'),('Anne','Lee'),('Bob','Ng')) AS t(first_name,last_name)), columns := 'first_name,last_name')
GROUP BY cluster_id
ORDER BY n DESC
Uses match_resolve
Build a golden record per entity: resolve the built-in sample_customers demo on name + email and collapse each cluster to one row (lowest record_id, the first-name spellings seen, email, city, and how many source records merged) -- the three Smith variants and two Doe variants each become one row, the two Jones stay separate.
SELECT min(record_id) AS golden_record_id,
string_agg(DISTINCT first_name, ' / ' ORDER BY first_name) AS name_variants,
any_value(last_name) AS last_name, any_value(email) AS email,
any_value(city) AS city, count(*) AS source_records
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, city FROM match.main.sample_customers), columns := 'first_name,last_name,email')
GROUP BY cluster_id
ORDER BY golden_record_id
Score the resolver against sample_customers' ground-truth expected_entity label: self-join the resolved rows into record pairs and count true/false positive and false negative links, with pairwise precision and recall (4 true links, no false ones: precision = recall = 1.0).
WITH resolved AS (SELECT record_id, expected_entity, cluster_id FROM match.main.match_resolve((SELECT record_id, first_name, last_name, email, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name,email')), pairs AS (SELECT a.cluster_id = b.cluster_id AS predicted_same, a.expected_entity = b.expected_entity AS actually_same FROM resolved AS a JOIN resolved AS b ON a.record_id < b.record_id) SELECT count(*) FILTER (WHERE predicted_same AND actually_same) AS true_pos, count(*) FILTER (WHERE predicted_same AND NOT actually_same) AS false_pos, count(*) FILTER (WHERE NOT predicted_same AND actually_same) AS false_neg, round(true_pos / nullif(true_pos + false_pos, 0), 3) AS precision, round(true_pos / nullif(true_pos + false_neg, 0), 3) AS recall
FROM pairs
Check what dropping email costs: resolve sample_customers on first + last name only at threshold 0.7 and count clusters per ground-truth entity -- Jane/Janet Doe still link, but the John/Jon/Johnny Smith variants split into three clusters (under-merging).
SELECT expected_entity, count(*) AS records,
count(DISTINCT cluster_id) AS clusters
FROM match.main.match_resolve((SELECT record_id, first_name, last_name, expected_entity FROM match.main.sample_customers), columns := 'first_name,last_name', threshold := 0.7)
GROUP BY expected_entity
ORDER BY expected_entity
Count the sample records that belong to each ground-truth entity -- the planted duplicate groups match_resolve should reproduce.
SELECT expected_entity, count(*) AS records
FROM match.main.sample_customers
GROUP BY expected_entity
ORDER BY records DESC, expected_entity
Uses sample_customers
Inspect just the messy Smith records (three spelling variants of one real person) to see the kind of duplication entity resolution targets.
SELECT record_id, first_name, last_name, email
FROM match.main.sample_customers
WHERE last_name = 'Smith'
ORDER BY record_id
Uses sample_customers
5 more examples in the Catalog, each listed under the table or function it uses.
Match is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
scikit-learn
Statistics & ML
scikit-learn — datasets, metrics, transforms and a train/predict model registry
Anomaly
Statistics & ML
Find outliers, discords, repeated motifs and change points in numeric series from SQL
Causal
Statistics & ML
Estimate treatment effects (ATE, ATT) and propensity scores from observational data with IPW, regression adjustment, and AIPW