OpenGraph Text
Turn a folder of notes, reports, and PDFs into entities, topics, and claims, each linked back to the document that states it.
- v0.1.0 on PyPI
- Python 3.11+
- Apache-2.0
- 5 MCP tools
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
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.
- 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.
- You
Which reports say Acme acquired Beta?
query_graph("Which reports say Acme acquired Beta?", "./reports")- Agent
board-notes-q3.pdfandmarket-scan.mdboth state it. get_document_entities("market-scan.md", "./reports")
Good to know
- PDFs need a text layerScanned pages without embedded text come through empty; run OCR first.
- General-purpose relationsDomain links such as
citesorcontradictsare 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.
Build your first graph
Open source under Apache-2.0. Runs locally with your own Anthropic API key.