"Use the InChIKey as your join key" is correct advice and incomplete advice. The key settles the part of chemical identity that's algorithmic and hands the rest to a policy that is, in the general case, unsolved — and almost every real-world duplicate-versus-distinct error lives in the unsolved part.
What the algorithm settles
InChI canonicalizes a structure in layers — molecular formula, connectivity, hydrogens, charge, stereochemistry, isotopes — each computed by a deterministic algorithm. [1] The InChIKey then hashes that string into a fixed 27-character form: a 14-character first block for the molecular skeleton/connectivity (a 65-bit truncated SHA-256), an 8-character second block for the stereo, tautomer, protonation, and isotope layers (37 bits), and a version-and-flag character. [2]
For connectivity, this is genuinely solved: the same bonded structure yields the same first block every time, regardless of how the molecule was named, drawn, or atom-ordered. Truncation means two different structures can collide on a key, but the rate is astronomically low and not the practical concern. The practical concern is the opposite — the same compound producing different keys — and that lives entirely in the layers above connectivity.
Where the algorithm stops and policy begins
Standard InChI is deliberately tautomer-aware: it normalizes common mobile-hydrogen patterns so that, say, the two faces of a 1,3 keto–enol pair collapse to one identifier. But the normalization is incomplete by design — there are documented tautomer classes, including certain 1,5-tautomers, that standard InChI does not recognize as the same compound. [1] "Same molecule to a chemist, different InChIKey" is not a bug; it's the edge of what the standard covers.
Try to fix it yourself and you discover the deeper trouble: there is no robust canonical tautomer. RDKit's TautomerEnumerator is the field's workhorse, and even it is not reliably idempotent — applying canonicalization to an already-canonical tautomer can move a double bond and return a different structure, an issue the maintainers document openly. [3] Add explicit hydrogens and the canonicalization can fail differently; switch from the Python MolVS rules to the C++ implementation and you get different answers again. If the standard toolkit can't always return the same canonical tautomer for the same molecule, "tautomer-collapsed identity" is not a setting you turn on — it's an ongoing approximation you own.
And tautomers are only one layer. Salts, mixtures, solvates, and co-crystals are multi-component structures with their own keys; whether a hydrochloride salt and its free base are "the same product" is a question only your use case can answer. Undefined versus defined stereocenters hash differently. Isotopes, organometallics, and coordination compounds each carry caveats the key inherits.
This is why your databases disagree — and why the data is dirtier than you think
Because all of that sits above the deterministic core, every serious chemical database runs a standardization policy before it decides identity: strip salts to the parent, neutralize charges, pick a canonical tautomer, decide how to treat undefined stereo. RDKit's MolStandardize, the ChEMBL curation pipeline, and the FDA's UNII/GSRS each encode a different set of those choices. [4] Two datasets with different policies will legitimately disagree about which records are duplicates even when both computed the InChIKey flawlessly. The disagreement is not a software defect; it is two different, equally valid answers to "what counts as the same molecule."
This isn't a theoretical worry. The cheminformatics literature has been sounding the alarm on public-database structure quality for over a decade — Williams and colleagues' "quality alert" documented widespread structural errors and inconsistencies across public chemistry resources, the kind that arise exactly when many organizations re-curate the same structures under different (or no) standardization policies. [5] When you join two such sources on InChIKey, you inherit the union of their policy disagreements.
Where AI belongs — and where it must not
The reliable division of labor falls out of all this. Use machine learning to get to a structure from messy inputs — parsing names, reading drawn structures, extracting mentions from text. Those are pattern-recognition problems. Then use the deterministic InChI machinery to settle connectivity, and an explicit, version-pinned, auditable standardization policy to settle everything above it — tautomer model, salt handling, stereo treatment, all written down and reproducible. [6]
Asking a language model "are these the same compound?" inverts the entire design: it makes the deterministic part probabilistic and buries the policy decision inside a guess you can't audit. Acetaminophen and paracetamol collapse to one row because they hash identically, not because a model was clever. Your hard duplicates — the unrecognized tautomer pairs, the salt-versus-parent records, the flat-versus-resolved stereo — won't collapse until you've decided, on purpose and in writing, how you treat them, and pinned the toolkit version that enforces it. In chemistry, identity is a solved core wrapped in an unsolved problem, and pretending the wrapper is also solved is how the duplicates get in.
Does your "same compound" rule name a specific tautomer model, a salt policy, and a pinned toolkit version — or is it an InChIKey join inheriting every upstream database's private, undocumented standardization choices?