Back to all posts

Why we built the citation graph

A bidirectional graph beats a one-way citation index, every time. Here is what changed when we stopped treating references as a list and started treating them as edges in a graph the way they actually are in the literature.

Kelvin Tay Soon Chieh@drkelvintaysc··5 min read

Why we built the citation graph

A citation is not a footnote. It is an edge. The first version of NextOnyx treated the reference list of every paper as a JSON column, which is fine for a flat "papers citing this paper" view and miserable for anything that involves following chains, finding common ancestors, or doing the kind of literature exploration that researchers actually do in their day-to-day work.

So we rebuilt it as a graph.

The problem with a list#

A reference list answers one question: "who cites this paper?" It does not answer:

  • What two papers share in their bibliographies? A surprisingly common workflow in literature review: paste in two papers, see what they both cite, and you've just found the canonical prior art.
  • Which papers are cited together? Co-citation analysis is a 50-year-old technique in scientometrics. It is a great signal for "papers in the same intellectual neighborhood."
  • What is the bibliographic coupling of two papers? Two papers that cite the same set of sources are likely about the same topic, even if neither cites the other. That is the inverse of co-citation, and equally useful.

None of these are computable from a flat list. You need the graph.

The schema#

Two tables, two kinds of edges.

  • citation_edges(from_paper, to_paper, kind) — the "this paper cites that paper" edge. We model forward and backward citation as the same row, indexed both ways.
  • paper_cocite(paper, cocited, weight) — pre-computed co-citation counts. Updated on every edge write, not on every read. The co-cite weight is jaccard(citations(paper), citations(cocited)) so that two papers with a small shared bibliography score higher than two papers with a large shared one.

The rest is just SQL.

What changed for users#

Three things:

  1. The citation chain view on every article page now shows the chain of "cited by → cites → cited by → cites" in either direction, three levels deep, and it loads in a single round trip because the edges are precomputed.
  2. The explore page lets you paste in two DOIs and asks "what is the bibliographic coupling?" which is a fancy way of saying "show me what they have in common." Researchers have been asking this question at library reference desks for decades; we made it a button.
  3. OpenAlex backfill is now a recurring job, not a one-time import. Every paper in our index gets its citation graph synced weekly, with a debounce on the post-change events so we don't re-fetch the same DOI twice in a row.

What is next#

The graph is the substrate for the next phase: paper recommendations, reviewer suggestions ("who has cited this paper before?"), and the ability to ask questions like "who are the three people whose citation overlap with mine is highest?" None of these are computable from a list.

Citation graphs are not a new idea. Treating them as the foundation of the product, rather than a feature bolted on after the search index, is.

All posts