Paperfuldocs

Core Concepts

Paper Graph

The Paper Graph is the structured representation of a paper.

Instead of exposing a document as one large block of extracted text, Paperful breaks its contents into ordered nodes that preserve information about what each part of the document represents and where it came from.

Title Paragraph Section Title Image Table ...

The graph becomes the foundation for retrieving content, navigating documents, search, and AI applications.

Why a graph?

Documents contain more structure than plain text.

A PDF might visually contain:

  • A document title
  • Headings and sections
  • Paragraphs
  • Multiple columns
  • Tables
  • Images
  • Charts
  • Footnotes
  • References

Flattening everything into text loses much of that information.

For example:

2026 Annual Report
Revenue increased by 24%.
Regional Performance
North America
$12.4M
Europe
$8.7M

It's difficult to tell which content represents a heading, paragraph, or table.

The Paper Graph preserves that structure:

Document Title2026 Annual Report ParagraphRevenue increased by 24%. Section TitleRegional Performance TableRegional revenue

This allows applications to reason about the document as a document rather than just a sequence of characters.

Nodes

A graph consists of Paper Nodes.

Each node represents an element discovered in the document.

For example:

{
  "id": "node_...",
  "type": "paragraph",
  "position": 12,
  "page": 3,
  "data": {
    "content": "Revenue increased by 24% compared with the previous year."
  },
  "bbox": {
    "x": 82,
    "y": 316,
    "w": 421,
    "h": 52
  },
}

Nodes can represent text, titles, tables, images, charts, formulas, and other document elements.

See Paper Nodes for the complete node model.

Document order

Nodes have a stable position within the paper.

1Title 2Paragraph 3Paragraph 4Section Title 5Table ...

This makes it possible to move through a document without depending only on page boundaries.

For example, given a search result pointing to node 42, an application can retrieve nearby nodes to build additional context.

const nodes = await paperful.papers.nodes.list(paperId, {
  around: "node_...",
  before: 2,
  after: 3,
});

This is particularly useful for RAG and agent workflows where the surrounding document context matters.

Pages and position

Pages describe the physical organization of the original document.

Positions describe the logical order of its content.

A graph can therefore preserve both:

Page 1
  position 1 → Document Title
  position 2 → Paragraph
  position 3 → Paragraph

Page 2
  position 4 → Section Title
  position 5 → Paragraph
  position 6 → Table

A node's position remains useful even when content crosses page boundaries.

Page numbers describe where content appeared in the source document. Position describes where that content belongs in the document's reading order.

Bounding boxes

When applicable, nodes retain their location on the original page.

{
  "page": 3,
  "bbox": {
    "x": 0.1,
    "y": 0.1,
    "w": 0.1,
    "h": 0.1
  }
}

Bounding boxes are normalized to the page size, so x and y are between 0 and 1, and w and h are the width and height of the box as a fraction of the page size.

Bounding boxes make it possible to connect structured content back to its visual source.

For example, an application can use them to:

  • Highlight a search result in a document viewer
  • Show where an extracted value originated
  • Associate AI responses with their source regions
  • Build custom document interfaces

Not every node is required to have a bounding box.

Graph vs. Markdown

Paperful can expose documents as Markdown, but Markdown is a representation generated from the graph rather than the source of truth.

Document Paper Graph Markdown Search Embeddings AI / RAG

Markdown is useful when you want a simple, portable representation of the document.

The Paper Graph is useful when you need richer information such as node types, positions, pages, bounding boxes, and references.

Search results can point directly to nodes in the graph.

For example, a result might contain:

{
  "paperId": "paper_...",
  "nodeId": "node_...",
  "page": 3,
  "content": "Revenue increased by 24% compared with the previous year.",
  "score": 0.91
}

Your application can then retrieve the matching node and navigate its surrounding content.

Search Query Search Result Matching Node Previous Nodes Next Nodes

This provides a natural way to construct context without loading the entire document.

Graph and AI

The graph is especially useful when building AI applications.

Instead of giving a model the entire paper, applications can:

  1. Search for relevant content.
  2. Locate the matching nodes.
  3. Retrieve nearby nodes.
  4. Provide that structured context to the model.
Question Search Relevant Nodes Graph Context Model

Because nodes retain their source information, responses can also be connected back to pages and regions in the original document.

Retrieving the graph

You can retrieve nodes from a paper through the SDK:

const nodes = await paperful.papers.nodes.list("paper_...");

Or retrieve a specific node:

const node = await paperful.papers.nodes.get(
  "paper_...",
  "node_...",
);

Graph APIs can also support navigation and filtering so applications only retrieve the content they need.

A foundation, not a format

The Paper Graph isn't intended to replace formats such as PDF, Markdown, or JSON.

It is the structured layer connecting the original document with the different ways applications use it.

Original Document Paper Graph Markdown Search RAG Extraction Document Viewer

This lets Paperful process a document once and build multiple capabilities on top of the same underlying structure.

On this page