Blog Case StudiesAIHPC

Billion-Scale Molecule Search Without Fingerprints or Embeddings

Frontier bio labs settle for proxy representations of biological and chemical compounds, but why not search their shapes directly?

By
Ash Vardanian
Published
Dec 1, 2026

Every search engine we know of is built for one form of data. Product search indexes embeddings and text, bioinformatics keeps its own aligners and FM-indexes, and structural biology keeps its own structure search, each rebuilt for its modality with its own formats, its own approximations and rarely the engineering rigor production search demands. USearch v3 is our attempt at the opposite: one rigorously designed engine, with the same graph, the same refinements and the same model-checked concurrency, for any data whose entries can be compared two at a time. That makes navigating the space of molecules naturally multimodal, across three levels of rising expressivity and complexity, where each representation is harder to obtain and costlier to compare than the last:

  • Fingerprints and embeddings: vectors compared in linear time, the obvious case.
  • Alignments: sequences searched by an exact alignment score, quadratic in their lengths, instead of an embedding or a seed.
  • Shapes: 3D point clouds compared by solving an optimal transport problem at every comparison, cubic in their sizes, which to our knowledge no search engine has shown before.

All three run over USearchMolecules, an open atlas with one permanent key per entity, built with the tools of Unum Science and free to download from AWS Open Data, and here is what each modality compares in one real pair of its entries:

Fingerprints & embeddingsHamming · Jaccard · cosine

  • Ligands
  • Proteins
  • Antibodies

SequencesNeedleman-Wunsch alignment

  • Ligands
  • Proteins
  • Antibodies

ShapesChamfer · Wasserstein-Procrustes

  • Ligands
  • Proteins
  • Antibodies
  • Indexed in the atlas
  • Stored, not yet indexed
  • Derived by other models
Real pairs from the atlas, scored the way each modality is: two ligands from the example subset by their MACCS keys and by their conformers, superposed by Wasserstein-Procrustes, and two human heavy-chain CDR3 loops from Observed Antibody Space by Needleman-Wunsch. Marks show where each modality applies: proteins and antibodies get vectors from language models, and antibody shapes from structure predictors.

§ Chemistry Had Vectors Long Before Embeddings

Vector search indexes became popular for storing the embeddings of neural networks, and chemistry has used vectors for far longer. A molecular fingerprint is a one-hot encoding of a molecule graph’s features: ECFP4 hashes the circular neighborhood of every atom into one of 2048 bits, while MACCS and PubChem keys give each bit a named chemical pattern. Proteins and antibodies get their vectors as embeddings from protein language models like ESM-2, but searching either is the same operation: one pass over two vectors, linear in their length. The published graphs rank ECFP4 neighbors by Hamming distance, and the same index takes Jaccard, the Tanimoto coefficient chemists know, under a permanent key per entity that decodes back to a standard InChIKey.

We started there a while ago: the first release of USearchMolecules in 2023 fingerprinted every drug-like molecule we could redistribute and put it on AWS Open Data, as a stress test for USearch. We have wanted to keep contributing to the life sciences ever since, and this release is our next step, taken one modality at a time while protein structure prediction went from a research result to a Nobel Prize:

  1. June 2023 Fingerprints USearchMolecules starts as a stress test for USearch: drug-like molecules, fingerprinted and published on AWS Open Data.
  2. May 2024 Alignments AffineGaps brings exact alignment with traceback to GPUs, and SmallField generates 3D conformers on them.
  3. October 2024 AlphaFold The Nobel Prize in Chemistry goes to protein structure prediction and computational protein design.
  4. October 2026 Shapes USearch v3 indexes sequences and 3D shapes, and the atlas adds AlphaFold structures and antibody repertoires.

§ Index Protein Strings with Sketches & Compare by Exact Alignments

Biology, more often, is an alignment problem, and Needleman-Wunsch scores one by dynamic programming, quadratic in length, which is why large-scale sequence search has always avoided running it on everything. BLAST seeds candidates with short exact words, MMseqs2 prefilters by k-mer matches, read mappers like BWA look up exact substrings in an FM-index, and protein language models trade the alignment for a learned approximation of it.

USearch takes a third road: it builds the graph on cheap k-mer sketches of each protein or antibody chain, and every search hop scores the exact global alignment, so answers are ranked by the alignment itself, not by a stand-in for it. USearchMolecules links the antibody chains of the Observed Antibody Space that way, in graphs split into parts where a collection outgrows one, and the 241 million proteins of AlphaFold DB are next. Our 2024 prototypes built these graphs without sketches and were too slow for production. Sketches took most of the cost out of building them, and searching them is quick enough to feed a real-time pipeline, such as retrieving neighbors for every sequence a structure-prediction model trains on, and AffineGaps reconstructs each hit’s alignment exactly, with traceback, on GPUs.

Insert & refine: compare sketches

Sketch distance

  1. 1

    A new protein or antibody chain arrives.

  2. 2

    Its k-mers fold into a fixed-size sketch, cheap to compare at any length.

  3. 3

    Sketch distances choose the neighbors it links to in the graph.

Search: score alignments

Exact alignment

  1. 1

    A query enters the same graph.

  2. 2

    Every hop scores the exact global alignment against the query.

  3. 3

    Answers come back ranked by that alignment.

One graph, two metrics. Each new protein or antibody chain is linked by comparing k-mer sketches, which cost the same at any length, and every query walks those links scoring the exact global alignment, so its answers are ranked by the alignment. Sketches are derived when chains are inserted or loaded and never saved.

We compared against MMseqs2 and DIAMOND, the tools most labs run for homolog search, on 10 million AlphaFold proteins and 10 million antibody chains. On held-out queries, whose truth is the exact global alignment, USearch puts the nearest row in its top 10 for up to 96% of AlphaFold proteins and over 99% of antibodies, where MMseqs2 manages 78% and 63%, and DIAMOND 78% on AlphaFold. On antibodies it also recovers more of the 30%-mutated copies, 97% against 61%, and on AlphaFold it matches MMseqs2’s 99% at expansion 8192. It answers 2 to 6 times more queries per second than MMseqs2 counting database load, and 4 to 410 times more once its index sits in GPU memory:

Search queries/s30% mutants top-10 recallHeld-out top-10 recall AlphaFold DB 10M proteins USearch3.0.0-rc.1 · expansion 256 822 0.793 0.848 USearch3.0.0-rc.1 · expansion 1024 285 0.930 0.902 USearch3.0.0-rc.1 · expansion 4096 92.0 0.980 0.938 USearch3.0.0-rc.1 · expansion 8192 49.0 0.992 0.957 MMseqs2 GPU20-ae60e · max-seqs 4000 12.8 0.992 0.777 DIAMOND2.2.9 · sensitive 6.60 0.988 0.777 Observed Antibody Space 10M chains USearch3.0.0-rc.1 · expansion 256 11.5K 0.898 0.984 USearch3.0.0-rc.1 · expansion 1024 3.68K 0.957 0.996 USearch3.0.0-rc.1 · expansion 4096 1.20K 0.973 0.996 MMseqs2 GPU20-ae60e · max-seqs 4000 28.1 0.609 0.629 DIAMOND2.2.9 · sensitive stopped after 45 min
One RTX PRO 6000 Blackwell Server with 24 cores, shared with other jobs, so times are upper bounds · DIAMOND has no GPU mode, so its row runs on the 24 cores for reference · one batch of 1,024 queries: 768 copies mutated at 10, 20 and 30% that must find their source row, and 256 held-out queries whose truth is the exact global-alignment nearest row · USearch 3.0.0-rc.1 at 64 links and the expansion shown · DIAMOND on 12 of the 24 cores · USearch counts in-search seconds while the others include database load: on the wall clock, AlphaFold at expansion 256 serves 75.3 queries/s against 12.8 for MMseqs2 · MMseqs2 and DIAMOND rank by local bit score, which caps their held-out column

§ Compare 3D Shapes Directly, Point Cloud to Point Cloud

Geometry is where it gets hard. Two conformers of different molecules have different numbers of atoms in no particular order, so there is no correspondence to superpose by Kabsch, and the usual workarounds reduce a shape to something easier: USRCAT reduces a conformer to 60 numbers, and Foldseek turns protein structures into strings over a structural alphabet, so that sequence search applies.

USearch compares the point clouds themselves. Its default for conformers and pockets is Wasserstein-Procrustes, after Grave et al.: an exact optimal transport plan pairs the points, the best rotation or reflection superposes them, and the two alternate until the cost stops falling. Gromov-Wasserstein, after Mémoli, never superposes at all, comparing each cloud’s internal distances, while Chamfer and Hausdorff sit at the cheap end. Every kind needs no atom mapping, so a 20-atom ligand scores against a 60-atom one without padding, and which tool to reach for depends on how many shapes there are:

Score every pair with NumKong

Thousands of clouds, every distance, exact

# From NumKong `python/README.md` at `bc02e9df`
import numpy as np
import numkong as nk

rng = np.random.default_rng(42)
clouds = [rng.random((n, 3)).astype(np.float16)
          for n in (20, 31, 60)]

# onto principal axes, once per cloud, in 16 bits
packs = nk.shapes_pack(clouds)
# every pair, exactly, with wider sums inside
scores = nk.wassersteinprocrustes_packed(
    packs, packs)

Search a graph with USearch

Billions of clouds, a few scored per query

# From USearch `python/README.md` at `d62c6f08`
import numpy as np
from usearch import Arena, Scalar
from usearch import ShapesIndex, ShapesMetric

rng = np.random.default_rng(42)
clouds = [rng.random((n, 3)).astype(np.float16)
          for n in (20, 31, 60)]

index = ShapesIndex.init_ram(
    ShapesMetric.WASSERSTEIN_PROCRUSTES, Scalar.F16)
index.insert([1, 2, 3], clouds)
matches = index.search(clouds[2], 1, Arena())

In USearchMolecules, the lowest-energy conformers of PubChem are linked by a Chamfer graph today, generated by SmallField one GPU warp per molecule, and the Cα traces of AlphaFold DB ship beside their sequences, ready for the same index, where one comparison of two proteins looks like this:

Human hemoglobin α as AlphaFold DB predicts it, AF-P69905 with 142 residues, against hemoglobin β from the 1.74 Å crystal structure 2HHB with 146: one fold, different sequences and lengths, so no residue numbering to pair by. Exact transport pairs the Cα atoms while the best rotation superposes them, settling at 2.64 Å, and the plan recovers 94% of the pairs a sequence alignment would give without ever seeing the sequences.

§ Cubic or Worse per Comparison, Logarithmic in Comparisons

The three modalities differ less in what they store than in what one comparison costs. Two fingerprints take one pass over their bits, and two CDR3 loops of 16 and 15 residues fill a dynamic-programming table of 240 cells. Two clouds of 32 atoms take 1,024 distances for Chamfer, but exact transport chooses among all 32! pairings, about 2.6 × 1035 of them, which a network simplex or a shortest-path solver narrows in roughly cubic time, for each of 8 starting flips and every round of the alternation. Gromov-Wasserstein compares every pair of distances inside one cloud with every pair inside the other, so its objective written out has a million terms at 32 atoms and four billion at 256, though each of its steps factors into two matrix products and an exact transport plan, so it stays cubic too.

FingerprintsO(D)

168 bits

21 bytes per key

Bit by bit, with no pairing or rotation to search for

AlignmentO(L·M)

240 cells

16 aligned columns

Residue order is kept, so only the gaps are placed

TransportO(n³)

225 distances

15! ≈ 1.3 × 10¹² pairings

Pairing and a 3 × 3 rotation alternate, from 8 axis flips

Gromov-WassersteinO(n³)

50,625 terms

2 matrix products per step

Distances inside each cloud, which no rotation changes

What one comparison of a real pair has to cover: the two ligands' MACCS keys, the two CDR3 loops' alignment table with its traceback, the two ligands' 15 × 15 atom distances with five rejected pairings before the optimal one, and the 50,625 terms Gromov-Wasserstein weighs, with the terms that one pairing sums in blue.

Rotation, the obvious worry, turns out to be nearly free: storing a cloud turns it onto its own principal axes once, so two clouds differ by at most a sign per axis, and the real cost is the pairing.

The kernels come from NumKong, our numerics library, and follow the rule we hold across all of it: store narrow, compute wide. Coordinates sit on disk as Float16, so a conformer of 30 atoms fits in 180 bytes, while sums widen to Float32 and the transport solver keeps its dual potentials in Float64, or in 64-bit fixed point on Apple GPUs, which have no Float64, because a near-tie rounded differently lands the alternation in a different local optimum. Here is what those kernels sustain on one server core and on one GPU, by the number of atoms per cloud:

32 atoms pairs/s256 atoms pairs/s2048 atoms pairs/s RMSD known pairing Xeon 6776Pone core · Float32 1.14M 908K 263K Xeon 6776Pone core · Float16 3.43M 2.39M 588K RTX PRO 6000Float32 191M 74.4M 11.6M RTX PRO 6000Float16 2.51B 302M 36.5M Chamfer nearest points Xeon 6776Pone core · Float32 824K 18.5K 190 Xeon 6776Pone core · Float16 1.45M 36.2K 503 RTX PRO 6000Float32 9.04M 164K 2.57K RTX PRO 6000Float16 300M 7.20M 116K Wasserstein-Procrustes exact transport Xeon 6776Pone core · Float32 8.45K 48.5 6.71 s per pairXeon 6776Pone core · Float16 8.47K 37.6 7.94 s per pairRTX PRO 6000Float32 229K 469 over 10 min per tileRTX PRO 6000Float16 1.21M 1.30K over 10 min per tileGromov-Wasserstein distance matrices Xeon 6776Pone core · Float32 4.57K 23.2 63.3 s per pairXeon 6776Pone core · Float16 4.65K 19.8 74.1 s per pairRTX PRO 6000Float32 184K 256 over 10 min per tileRTX PRO 6000Float16 475K 479 over 10 min per tile
Pairs of uniformly random point clouds scored per second, every pair in full · one Xeon 6776P core with AVX-512 against one RTX PRO 6000 Blackwell, NumKong a33b701e · on the CPU, Float16 fills twice the vector lanes for the nearest-point kernels, while transport, solved in Float64, costs the same · on the GPU, no transport kernel finished a 16 × 16 tile of 2048-atom clouds within 10 minutes

Speed means little if the ranking is wrong, so we scored proteins on SCOPe40, the benchmark structure-search tools are judged on, where a method must rank a domain’s relatives before any domain of another fold. Our protein-superposition metric compares Cα traces in residue order and finds more fold-level relatives than Foldseek’s full-backbone search, by 0.0065 [0.0021, 0.0109] in a paired comparison, finds more close relatives than TM-align, and trails Foldseek by 0.037 at the family and superfamily levels. The graph walk on one GPU ranks the same as an exact scan, and answers 211 queries per second, where Foldseek’s GPU mode answers 29 on the same card:

Family closest relativesSuperfamily distant relativesFold most distantSearch queries/s SCOPe40 3,566 queries Dalipublished 0.888 0.575 0.166 TM-alignpublished 0.805 0.456 0.108 Foldseekrelease 10 · full backbone 0.861 0.487 0.106 FoldseekGPU mode · 2,000 targets 0.872 0.491 0.106 29.0 USearchgraph walk on one GPU · top 300 0.823 0.449 0.113 211 SCOPe40 among 1M AlphaFold 3,566 queries · 1,011,211 structures FoldseekGPU mode · 2,000 targets 0.595 0.200 0.0227 22.8 FoldseekGPU mode · 10,000 targets 0.707 0.314 0.0495 7.40 USearchgraph walk on one GPU · top 300 0.663 0.273 0.0407 187 USearchgraph walk on one GPU · top 2,000 0.776 0.413 0.100 47.0
SCOPe40: 11,211 protein domains at 40% sequence identity, 3,566 queries with a possible match at every level · sensitivity is the share of a query’s relatives at each level ranked before its first hit from another fold, scored by Foldseek’s own benchmark · Dali and TM-align are their authors’ published per-query results, rescored · Foldseek release 10 measured on the same box, with its full backbone on CPU cores and with Cα traces in its GPU mode, which prefilters on the RTX PRO 6000 and aligns on 12 CPU threads, as it ships · USearch 0ef15ebe with NumKong 331f0375 compares Cα traces with its protein-superposition metric, through its graph on one RTX PRO 6000 in Float16, keeping its top 300 or 2,000 per query, as shown · every 95% bootstrap interval lies within 0.01 of its value · queries per second are end-to-end wall time, shown for the GPU runs alone · the second group hides the same queries among 1,000,000 AlphaFold Cα chains, drops AlphaFold hits before scoring, and runs Foldseek’s GPU mode on the same RTX PRO 6000, keeping up to 2,000 or 10,000 targets per query · Foldseek builds its database faster than USearch builds its graph today, which upcoming releases address

Foldseek’s database builds faster than our graph today, as string indexes once did: their queries were competitive before their construction caught up, and today both are fast. The shape indexes already compete at search, and the next releases make them build as fast as they search.

A graph walk scores thousands of candidates per query, so a comparison a thousand times dearer than Chamfer would sink an index built the usual way. It stays tractable because refinement spends the expensive comparisons once, offline, in batches that keep every core and GPU busy, because a walk passes each kernel the distance a candidate must beat so it can stop early, and because the stored spreads of each cloud bound Wasserstein-Procrustes from below, which on real molecules skips most random candidates before any transport runs.

§ Nearly 10 Billion Small Molecules, Proteins, & Antibodies, Free on AWS

Every collection is on AWS Open Data and downloads without an account, each with its graphs beside its Parquet shards:

CollectionSourceEntitiesHeavy atomsWith hydrogens
exampleSampled from the three below2,000,000≈ 22≈ 42
pubchemNCBI115,627,256≈ 24≈ 46
gdb13University of Bern977,468,267≈ 13≈ 27
realEnamine6,039,411,650≈ 27≈ 52
alphafoldEMBL-EBI & Google DeepMind241,070,489≈ 2,600≈ 5,200
oas-unpairedOxford Protein Informatics Group2,427,646,880≈ 950≈ 1,900
oas-pairedOxford Protein Informatics Group3,087,576≈ 1,800≈ 3,600

Atom counts are medians for ligands and estimates for proteins and antibodies, from AlphaFold DB’s mean of 329 residues and about 120 residues per antibody variable domain. The upstream licenses travel with the rows, CC BY 4.0 for AlphaFold DB and the Observed Antibody Space.

§ Frontier-Scale Biology Atlas in Your Laptop

None of this is a scientific fork: sequences and shapes run on the same graphs, refinements and model-checked protocols as the dense vectors of the USearch v3 post. And the same engine scales down to one laptop, walking SafeGraphs in place on an SSD, so a lab without terabytes of RAM can still search the whole atlas:

# From USearchMolecules `README.md` at `25392a0`
$ tree data
data
├── example                       # 3.5 GB, start here
├── pubchem
│   ├── index-ecfp4.safegraphs    # 62 GB
│   ├── index-chamfer.safegraphs  # ~52 GB
│   └── parquet                   # 152 GB
├── gdb13                         # 823 GB
├── real
│   ├── index-ecfp4-*.safegraphs  # 6 × ~540 GB
│   └── parquet                   # 8.2 TB
├── alphafold                     # graph + Cα traces
└── oas-unpaired, oas-paired      # 164 GB
# From USearchMolecules `README.md` at `25392a0`
from usearchmolecules.dataset import (
    FingerprintedDataset, SequenceDataset)

# 6 billion ligands, a 3.2 TB graph off the SSD
ligands = FingerprintedDataset.open("data/real")
hits = ligands.search("CC(O)C(CN)=NNCC(C)(C)C",
                      100, residency="nvme")

# 241 million proteins, aligned exactly
proteins = SequenceDataset.open("data/alphafold")
query = proteins.row(0)["sequence"]
aligned = proteins.search([query], 10,
                          residency="nvme")

The sequence and shape engines are still experimental, so validate them on your data, and our next step is crowdsourced annotation: assay outcomes, binding and toxicity attached by any lab to the same permanent keys. Bring your results and ideas to our Discord.

To cite USearchMolecules:

@dataset{Vardanian_USearchMolecules,
  author = {Vardanian, Ash},
  title = {{USearchMolecules: An Open, Searchable Atlas of Chemical and Biological Entities}},
  doi = {10.5281/zenodo.21613663},
  url = {https://github.com/unum-science/USearchMolecules},
  license = {Apache-2.0}
}