OpenGraph Text

Turn a folder of notes, reports, and PDFs into entities, topics, and claims, each linked back to the document that states it.

opengraph-text build ./sample_documents

Reads

  • doc_anthropic.md
  • doc_openai.md
  • doc_competition.md

Writes edges like

  • doc_anthropic.md states "Anthropic was founded by Dario Amodei and Daniela Amodei in 2021."
  • Dario Amodei founded Anthropic
  • Sam Altman works_at OpenAI
  • Anthropic competitor_of OpenAI
sample_documents/opengraph-out/graph.json

Retrieval over documents usually means cutting text into chunks and hoping the right passage ranks first. OpenGraph Text reads each document in a folder and records what it says as a graph, with every node linked back to the documents it came from.

What goes in, what comes out

Notes, reports, and PDFs in. One graph out.

Point it at a folder of .txt, .md, and .pdf files. It records who and what each document mentions, the topics it covers, the claims it makes, and how the people, organizations, and places in it relate. Every node and edge carries a confidence score.

board-notes-q3.pdf

  • Acme RoboticsacquiredBeta Logistics0.91
  • Dana Ruizworks_atAcme Robotics0.88
  • Acme Roboticslocated_inAustin0.86

Fixed relations

Nine relations, spelled the same in every document.

Entities connect through a fixed set of relations. "Which reports say Acme acquired Beta?" means following an acquired edge, then pointing to the files that support it.

  • works_at
  • founded
  • invested_in
  • acquired
  • located_in
  • part_of
  • competitor_of
  • collaborates_with
  • mentions

One entity, many documents

"Acme Robotics Inc" and "Acme Robotics" are one node.

Entities with the same normalized name and type merge across documents into one node that records every document it was seen_in. Topics and attributes merge the same way.

Acme Roboticsseen_in
  • board-notes-q3.pdf
  • market-scan.md
  • partner-call.txt

Claims are kept apart

When documents disagree, both claims stay.

Claims are never merged. Each stays linked to the document that states it, so an agent can report the disagreement and cite both sources instead of quietly picking one.

  • board-notes-q3.pdfstates"Acme opened a second plant in 2025."
  • partner-call.txtstates"Acme's second plant opens in 2026."

For your agent

Five MCP tools.

Build, list, inspect, and query from Claude or any MCP client. Graphs resolve by folder: name the folder and the server finds the graph inside it. A sixth tool, build_graph_html, is on the main branch and ships with the next release.

  1. You

    Which reports say Acme acquired Beta?

  2. query_graph("Which reports say Acme acquired Beta?", "./reports")
  3. Agent

    board-notes-q3.pdf and market-scan.md both state it.

  4. get_document_entities("market-scan.md", "./reports")
  • PDFs need a text layerScanned pages without embedded text come through empty; run OCR first.
  • General-purpose relationsDomain links such as cites or contradicts are not in the set yet; use claims for findings.
  • Merging is by nameTwo different people who share a name and type will merge.
  • Alpha softwareExpect the schema to change between releases.

Every limit, with details

Build your first graph

Open source under Apache-2.0. Runs locally with your own Anthropic API key.