Building a structural-biology RAG system: the data you actually need
The Protein Data Bank, AlphaFold, and UniProt are extraordinary open resources, but they are 3D structures and sequences, not prose. How to actually plug structural-biology data into a RAG or AI system, and the literature layer that makes it useful.
Structural biology is one of the most data-rich corners of open science. The catch, for anyone building a Retrieval-Augmented Generation (RAG) system, meaning an app that retrieves documents and uses a language model to answer from them, is that the headline data is not text. A protein structure is a set of 3D atomic coordinates, and a sequence is a string of amino-acid letters. Neither is something you retrieve a passage from and quote. So the useful question is not “how do I do RAG over protein structures” but “what text and structured metadata do these databases give me, and how do I connect it to everything else.” This guide walks through the core open sources and how they fit together.
The three core sources
Three resources form the backbone, and they complement rather than duplicate each other.
The RCSB Protein Data Bank is the canonical archive of experimentally determined 3D structures of proteins, nucleic acids, and their complexes, over 250,000 of them, alongside more than a million computed models. It has been running since 1971, and its records come in machine-readable mmCIF and JSON as well as legacy PDB format. Crucially for our purposes, each entry carries rich descriptive metadata: title, the molecules present, organism, experimental method and resolution, ligands, and links to the publications that reported it. That metadata is text, and it is what you actually index.
The AlphaFold Protein Structure Database, from EMBL-EBI and Google DeepMind, is the predicted counterpart: AI-computed structures covering over 200 million sequences, most of UniProt. Where the PDB is ground truth but sparse, AlphaFold is comprehensive but predicted, and each model ships with per-residue confidence scores you should surface rather than hide. It is queryable by API and available in bulk from Google Cloud.
UniProt is the connective tissue. It is the reference database of protein sequences and, more importantly here, functional annotation: what a protein does, where in the cell it acts, the pathways it belongs to, and cross-references out to almost everything else. UniProt annotations are largely prose and controlled vocabulary, so they are the most directly retrievable of the three, and their accession identifiers are the join key that links a sequence to its structures and its literature.
What retrieval actually looks like here
Once you see that the coordinates are not the retrieval target, the design falls into place. You index the text and structured fields these databases expose: PDB entry descriptions and experimental metadata, UniProt functional annotations, AlphaFold model summaries and confidence, and the identifiers that tie them together. A question like “what is known about the structure of this enzyme and how confident are we” is answered by retrieving the UniProt annotation, the linked PDB entries, and the AlphaFold model note, then letting the model summarise, with the structure viewer or the raw file available as a separate artefact for anyone who wants it.
Identifiers do the heavy lifting. UniProt accessions and PDB IDs are stable, unambiguous keys, so much of the value is in following cross-references rather than fuzzy semantic search. A robust system mixes both: a structured lookup by identifier where you have one, and vector search over annotations and abstracts where you are exploring. This is a good reminder that not every retrieval problem is a vector-database problem, a theme we return to often.
The literature and annotation layer
Structures answer “what does it look like.” To answer “what does it do, in what disease, and with which drugs,” you pair them with the biomedical text layer.
PubMed is the obvious anchor: tens of millions of biomedical abstracts, and the natural corpus for grounding answers in the literature a structure links to. Open Targets adds systematically scored target-disease associations, turning “this protein” into “this protein matters in these conditions, with this evidence.” ChEMBL brings bioactivity data connecting compounds to targets, and DrugBank connects proteins to approved and investigational drugs. Together they let a system move from a structure to its biological and clinical context, which is usually the question a user actually has.
A licence note matters here, and it is the reason we track licences carefully. The PDB is released as public domain (CC0), so you can reuse its metadata freely, including commercially. AlphaFold and UniProt are CC BY, so attribution is required but commercial use is fine. DrugBank is the one to watch: its fuller data is free for academic use but requires a paid licence for commercial deployment, so check the terms before you build a product on it. Our guide to choosing a dataset licence covers how to think this through.
Practical build notes
A few things worth deciding early. Carry the source identifier and the confidence or experimental method through as metadata on every chunk, so the model can say “predicted, low confidence” rather than stating a guess as fact. Prefer the structured cross-reference to a fuzzy match when you have an identifier. Keep the raw structure files out of your text index and serve them as linked artefacts. And plan for freshness: the PDB grows weekly and UniProt updates on a schedule, so decide how often you re-index.
This is the same pattern as our legal RAG data guide: pick the authoritative primary sources, understand what each one is and is not, and connect them by their identifiers. For the full set of options, the biomedical category in the directory lists these alongside clinical, genomic, and chemical resources you can build on.