Turn markdown into a knowledge graph with an ontology you write and a cutoff you own. Closed yes/no decisions, not free-form JSON.
Your code proposes names. Your ontology says which kinds and links are legal. A small local decision model answers one closed yes-or-no question at a time. Anything it is unsure about waits for a person instead of silently entering your graph.
Real output from a local tev1 run on 13_northwind.md: open the interactive page · full report · read the article (PDF). One of the five links in that graph is wrong (Acme ACQUIRED Northwind; the text says "invested in"). We left it in. That is what the review queue and your cutoff are for.
git clone https://github.com/raphaelmansuy/edgextract && cd edgextract uv sync --all-extras ollama pull tev1 # a local decision model (Ollama 0.35+) uv run edgextract --model tev1 report data/golden/docs/13_northwind.md \ --ontology company_news --out graph.html open graph.html No model yet? Everything below runs offline against a stand-in model:
make test examples Or from Python, in five lines:
from edgextract import extract_text, load_ontology_named, write_report text = open("note.md").read() ontology = load_ontology_named("company_news") # or "tech_docs", "conll04", or a YAML path result = extract_text(text, ontology, model="tev1") write_report("graph.html", text, result, ontology, title="My note") Why not just ask a chat model for JSON? A chat model writes the next token. A JSON schema makes the output well-formed. It does not make it true, and it does not tell you how sure the model was. You parse, repair, and hope.
edgextract asks a different question. For every candidate pair it sends a closed yes-or-no to Ollama's POST /v1/systemone and gets back a probability. Your cutoff then decides: keep, send to a person, or drop.
We measured it on CoNLL04, a standard news benchmark (288 test sentences, exact-span scoring, none of the names pre-listed). Same scorer for every row. The first run used a smaller name finder and scored slightly higher on links; we publish both and use the final, shipped configuration as the number of record.
Read this table honestly. A model trained on the benchmark's own training sentences still wins by a wide margin. The comparison that matters is the zero-shot rows. There, the closed decision keeps far fewer wrong links than the chat model (links precision 0.41 against 0.27; 218 wrong links kept against 504) and gives up some recall for it. Name scores on that test are close (0.690 against 0.643). On the twelve tech notes they are not: tev1 scores 0.97, mostly because the names are already on the list, and Mistral Small scored 0.68 on the saved run (0.80 on an earlier run the same day). See the full evaluation.
The model never finds a span and never invents a type.
uv run edgextract init-ontology my_domain.yaml # a commented starter uv run edgextract validate-ontology my_domain.yaml # prints kinds and legal links in plain words id: company_news types: - {id: PERSON, description: A named person (founder, executive, investor).} - {id: COMPANY, description: A named company, startup, or fund.} relations: - id: FOUNDED description: The person founded the company. domain: [PERSON] range: [COMPANY] gazetteer: # optional: names you already know Ada Lovelace: PERSON Learn by example Nine short scripts, each one idea. See examples/README.md.
EdgeQuake-shaped JSON: entities with canonical UPPER_SNAKE names and kinds, relationships with the evidence sentence, a review list for uncertain items, and a rejected list. edgextract export-cypher prints Cypher; edgextract graph writes the interactive page.
EdgeQuake was the inspiration for the output shape. edgextract is an independent Python library.
information-extraction knowledge-graph markdown named-entity-recognition ollama ontology relation-extraction
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




