Graphs, Biology, and Knowledge Graphs¶
…and what a KG does for biot¶
Friday intro talk
Agenda¶
- What is a graph? (5 min)
- Why biology is secretly all graphs (5 min)
- Knowledge graphs: adding meaning to edges (10 min)
- A KG for biot: what we built and what it enables (10 min)
Part 1 — What is a graph?¶
The simplest useful data structure¶
A graph is just things and relationships:
- Nodes (vertices): the things — a protein, a paper, a person
- Edges: the relationships — binds, cites, knows
That's it. Everything else is detail.
Why not just use tables?¶
Tables answer: "what are the properties of X?" Graphs answer: "what is X connected to, and through what?"
| Question | SQL | Graph |
|---|---|---|
| Properties of protein X | easy | easy |
| Direct interactions of X | one JOIN | one hop |
| Everything within 3 hops of X | 3 nested JOINs, painful | traverse(X, depth=3) |
| Shortest path X → Y | don't | built-in |
The deeper the relationship chain, the more a graph wins.
A few concepts you'll hear today¶
- Directed vs undirected —
A inhibits Bhas a direction - Labeled/typed — nodes and edges have types (Protein, Disease;
treats,causes) - Path — a chain of hops: gene → protein → pathway → disease
- Neighborhood — everything N hops from a node
- Community — a cluster of nodes more connected to each other than to the rest
- Hub — a node with many edges (IL-6, TNF-α… the usual suspects)
Part 2 — Graphs in biology¶
Biology is natively graph-shaped¶
| Biological system | Nodes | Edges |
|---|---|---|
| Protein–protein interaction (STRING) | proteins | binds / complexes |
| Metabolic pathways (KEGG, Reactome) | metabolites, enzymes | reactions |
| Gene regulation | TFs, genes | activates / represses |
| Disease genetics | variants, genes, diseases | associated_with |
| Microbiome | taxa, metabolites | produces / consumes |
| Drug action | compounds, targets | inhibits / agonizes |
None of these fit cleanly in a table. All of them are literally drawn as graphs in every textbook.
The payoff: inference by connection¶
Classic examples of graph reasoning in biology:
- Guilt by association — unknown protein interacts with 5 DNA-repair proteins → probably DNA repair
- Drug repurposing — drug D targets protein P; P sits in pathway of disease X → candidate for X
- Pathway gaps — two metabolites, no known enzyme between them → there's probably an enzyme to find
The common pattern: missing edges are hypotheses.
Part 3 — Knowledge graphs¶
A knowledge graph = graph + meaning¶
A KG is a graph where every edge is a typed, sourced claim:
Three things distinguish a KG from "just a graph":
- Ontology — controlled types (Protein, Disease, Chemical…)
- Provenance — every edge cites where it came from
- Entity resolution — "IL-6", "interleukin-6", "IL6" → one node
Where do the edges come from?¶
Curated databases: UniProt, MONDO, PubChem, Reactome — high precision, slow, generic.
Literature extraction (what we do): LLM reads papers → extracts
(entity) ─[relation]─> (entity) triples → resolved and merged into the graph.
One paper ≈ dozens of structured claims. One corpus ≈ a queryable map of a research field.
Entity resolution — the hard part¶
Same concept, many names. If you don't merge them, your graph is confetti.
Our approach (battle-tested on real corpora):
- Normalize names →
norm:<name>canonical keys (primary connector) - Public ontologies (UniProt, MONDO) as supplement — only ~42% coverage on ag-bio text
- Name-agreement guard (fuzzy match ≥ 0.85) — a wrong merge is worse than a missed one
Real catch: resolver wanted to merge Mucin-1 into pleckstrin. Guard rejected it.
Communities: structure for free¶
Run Leiden clustering on the graph → densely connected clusters emerge.
In practice these clusters are topics: a mastitis-immunity cluster, a gut-microbiome cluster — nobody labeled them, the edge structure did.
Used for: summarization ("what's in this graph?"), search routing, and spotting which topics two programs share.
Part 4 — A KG for biot¶
What biot has today¶
- Research programs, each producing papers, experiments, data
- Literature search with embeddings (pgvector)
biot kgCLI — thin read client over the graph
The problem KGs solve for biot: knowledge is siloed per program. Program A's findings never meet Program B's — except inside someone's head.
What we built (real numbers)¶
Per-program KGs from literature, then merged into one connected graph:
| Programs merged | 5 |
| Nodes | 16,304 |
| Edges | 52,857 |
| Entities shared across ≥2 programs | 5,171 |
| Entities in all 5 programs | 23 |
Those 5,171 shared entities are the bridges — where one program's knowledge flows into another's.
Gap inference: the killer demo¶
Question: what does the combined graph know that one program alone doesn't?
IL-6, viewed from one program alone: 2 neighbors. IL-6 in the connected 5-program graph: 20 neighbors.
→ 18 relationships relevant to your program that your program's own literature never surfaced. Each one is a lead: a mechanism, a biomarker, an intervention someone else already studied.
1-v-1 becomes 5-v-5.
How it plugs into biot¶
papers ──> graffold-ingest ──> Parquet (source of truth)
│
┌────────────────────┴──────────────┐
▼ ▼
pgGraph (Postgres) Spanner Graph (GCP)
self-hosted serving managed serving
▲ ▲
└──────── graffold-api / biot kg ───┘
embeddings ──> pgvector (biot literature search, joins on entity id)
- Graph DBs are swappable projections — one env flip between them
- Vector search stays in pgvector; graph carries entity IDs for joins
What this enables for biot users¶
- "What connects X and Y?" — path queries across all programs
- "What do we already know about Z?" — one query instead of five literature reviews
- Cross-program leads — gap inference as a standing report, not a lucky hallway conversation
- Grounded AI answers — agent cites graph edges with paper provenance, not vibes
Takeaways¶
- Graphs = things + relationships; the model fits whenever connections carry the knowledge
- Biology is graph-shaped — pathways, interactions, regulation
- A KG adds types, provenance, and entity resolution — that's what makes it trustworthy
- For biot: merged program KGs already surface 10× more context around shared entities
- Missing edges are hypotheses — the graph is a lead-generation machine
Questions?
Appendix: try it¶
Docs: wiki.graffold.com — benchmarks, architecture, SDK reference.