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
§ 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:
- June 2023 Fingerprints USearchMolecules starts as a stress test for USearch: drug-like molecules, fingerprinted and published on AWS Open Data.
- May 2024 Alignments AffineGaps brings exact alignment with traceback to GPUs, and SmallField generates 3D conformers on them.
- October 2024 AlphaFold The Nobel Prize in Chemistry goes to protein structure prediction and computational protein design.
- 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
A new protein or antibody chain arrives.
- 2
Its k-mers fold into a fixed-size sketch, cheap to compare at any length.
- 3
Sketch distances choose the neighbors it links to in the graph.
Search: score alignments
Exact alignment
- 1
A query enters the same graph.
- 2
Every hop scores the exact global alignment against the query.
- 3
Answers come back ranked by that alignment.
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:
§ 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:
§ 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
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:
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:
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:
| Collection | Source | Entities | Heavy atoms | With hydrogens |
|---|---|---|---|---|
example | Sampled from the three below | 2,000,000 | ≈ 22 | ≈ 42 |
pubchem | NCBI | 115,627,256 | ≈ 24 | ≈ 46 |
gdb13 | University of Bern | 977,468,267 | ≈ 13 | ≈ 27 |
real | Enamine | 6,039,411,650 | ≈ 27 | ≈ 52 |
alphafold | EMBL-EBI & Google DeepMind | 241,070,489 | ≈ 2,600 | ≈ 5,200 |
oas-unpaired | Oxford Protein Informatics Group | 2,427,646,880 | ≈ 950 | ≈ 1,900 |
oas-paired | Oxford Protein Informatics Group | 3,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}
}