> ## Documentation Index
> Fetch the complete documentation index at: https://docs.introlink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Identity resolution

> Why six rows become one human, how the union-find works, and what mergeConfidence is telling you.

> [!NOTE]
>
> Source: `app/src/lib/identity.ts`, `app/src/lib/people-table.ts`.

`connections` records what each source said — one row per (connector, identity).
Nothing in it claims two rows are the same person. That judgement lives in the
resolver, and it is the single most consequential piece of logic in IntroLink.

## Why two lookup maps aren't enough

The obvious fold is two maps: one keyed on LinkedIn URL, one on email. It works
only when sources share a key, and in practice they don't. Measured on a real
account:

| Observation | Count |
| - | - |
| Rows carrying a LinkedIn URL that also carried an email | **0** of 87 |
| Google contacts carrying a phone number | **0** of 10,233 |
| WhatsApp JIDs in `@lid` form (no phone number inside) | **all of them** |

Three sources describing the same person, sharing no key at all. Under a
map-based fold that person stays three rows forever.

## The identity graph

So the resolver is a **union-find over an identity graph** instead. Nodes are
identities (`email:dana@acme.com`, `linkedin:/in/dana`) and rows. Edges come
from three places, in descending order of trust:

**1. Co-occurrence — certain**

One row carrying both an email and a URL says those two identities belong to
the same person. Certain, because a single source observed them together.

**2. Hints — trusted**

Rows in `identity_hints`: a LinkedIn CSV pairing a connection's email with
their profile URL (confidence 100 — LinkedIn is stating it outright), a URL
mined from an email signature, a manual merge. Applied at or above the
confidence floor.

**3. Name similarity — inferred**

The fallback for people who share no identifier at all, which is the common
case across LinkedIn/Google/WhatsApp. Never certain, and deliberately hedged.

### Block hints veto inference, not observation

A `block` hint says "these two are not the same person." It vetoes edges from
hints and name similarity, but **not** from co-occurrence. If one source observed
both identities on the same record, that's an observation rather than an
inference — "unmerge them" is a claim that the source itself is wrong, which
this layer isn't in a position to act on.

## The identity ladder

Each cluster is keyed on the strongest identity available:

```
linkedin  ▶  email  ▶  whatsapp  ▶  phone  ▶  google
```

LinkedIn leads because it is the one identifier that is one-per-human, public,
and stable across jobs. An email dies with the employer; a phone number gets
recycled. Everything below LinkedIn is a fallback for someone LinkedIn hasn't
reached yet, and `person.identityKind` tells you which rung supplied the key
(or `"row"` when no identity did).

That ranking is also why the Gmail signature scan
matters out of proportion to its size. It writes no people and no connections —
it writes email↔LinkedIn pairs. Each pair promotes an email-keyed person onto
the LinkedIn rung, and with it merges whatever LinkedIn row already existed for
them.

## Reading `mergeConfidence`

**mergeConfidence: 100**

Every row folded into this person shared an identifier with the others. The
merge is backed by observation.

**mergeConfidence: \< 100**

Something was inferred — a matching name with no shared key. The merge is
probably right and is worth a second look. The People page surfaces exactly
these rows for review.

> [!WARNING]
>
> Treat a sub-100 `mergeConfidence` as a hypothesis, not a fact, in anything that
> sends email. Merging two people wrongly means addressing an intro to the wrong
> human — which is why the ask composer flags any claim not tied to a profile
> field rather than asserting it.

## Identity hints

`identity_hints` is the durable record of "this identifier belongs to that
identifier." It is written by three paths:

| Source | Confidence | Written by |
| - | - | - |
| `linkedin_csv` | 100 | the LinkedIn CSV upload, or [an import over the API](https://docs.introlink.ai/public-api/import.md) — the row states the pair outright |
| `gmail_signature` | computed per match | the Gmail signature scan — corroborated across messages |
| manual merge | — | the app's merge UI |

Hints are stored rather than merely inferred through the connection row because
**a hint outlives the row**. Re-running the extension scrape, or deleting and
re-importing, must not lose the one join between the LinkedIn and Google halves
of the graph.

Rows are keyed on `(owner_id, kind, a_kind, a_value, b_kind, b_value)` with the
pair ordered canonically, so re-recording the same hint updates rather than
duplicates.

## When the fold runs

Automatically after every import, so nothing outside the app needs to start
it. Each fold concludes:

```json theme={null}
{ "ok": true, "people": 8412, "pruned": 1122, "identities": 11890 }
```

**people** `number`

Distinct humans after the fold.

**pruned** `number`

Rows that turned out to be the same human as another row.

**identities** `number`

Total identifiers across every cluster.

**inferredMerges** `number`

Returned by the CSV import — merges that rested on name similarity alone.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.