ai-knowledge-graph turns rule-based inference off because it swamped the real edges
AI Powered Knowledge Graph Generator
At a glance
- What is it?
- A Python tool that asks a language model to extract subject-predicate-object triples from a document and renders them as one self-contained HTML page, with every extracted relationship keeping its source sentence. Its two dependency declarations disagree, its configuration file is committed with a placeholder key, and its own project plan sits in the root.
- Who is it for?
- This suits someone with a folder of documents who wants an explorable graph this afternoon and a local model endpoint, and who cares that every edge can be traced back to a sentence. It does not suit someone building a production ontology, since the triples are model-extracted rather than curated and the inference layer is deliberately conservative.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 70 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- robert-mcdermott/ai-knowledge-graph3,143 ★ · +68
| Repository | 2026-09-13 | 2026-11-22 |
|---|---|---|
| robert-mcdermott/ai-knowledge-graph | 3.1k | 3.1k |
68 Stars in the last 70 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Inference is off by default, with a number attached
The configuration section contains the single most useful piece of engineering judgement in this readme, and it is a negative result.
Two rule-based inference passes, one transitive and one lexical, are switched off by default. The reason given is that in testing they generated roughly seventy percent of all edges in the graph, which hid the relationships actually found in the text.
That is a specific failure mode rather than a vague one. An inference layer that adds most of the graph is indistinguishable, to a reader, from an extraction layer that worked. So the tool's default is to show you only what the model extracted, with the enrichment available if you ask for it.
What survives by default is the part that is constrained. The readme says every inferred edge carries the method that produced it, and that inferred edges are capped relative to the extracted ones. So even when you enable the passes, the two kinds of edge are distinguishable in the output and the balance is bounded.
The deterministic half is separate and narrower: a taxonomy rule links specific terms to more general ones. That is the kind of inference that does not multiply, which is presumably why it is not in the same switch.
The two dependency lists do not describe the same packages
The project metadata declares three runtime dependencies: a graph library, a template engine, and an HTTP client, all with lower bounds.
The requirements file at the root declares about thirty, all pinned to exact versions, and it carries a header saying it was generated by an export command. The annotations in it attribute packages to their parents, and following those attributions leads somewhere unexpected: a Jupyter interactive shell and its whole dependency tree are listed, attributed to a graph-visualisation library, which in turn is attributed to this project.
So the exported file says the project depends on a notebook stack that the project metadata does not mention.
There is an innocent explanation. An export command walks the full resolution graph, and if a visualisation library pulls an interactive shell in its extras, the export can include it whether or not the project asked for it. The generated header is honest about being generated.
The practical consequence is for anyone installing by hand. If you follow the requirements file you get a large install; if you follow the metadata you get three packages; and the readme's own install instruction uses the modern tool with a lock file rather than either list, which sidesteps the question.
Every extracted relationship keeps the sentence it came from
The design decision that makes this tool different from a graph demo is one clause in the feature list.
It says every extracted relationship keeps the sentence it came from. That single field is what turns a generated graph from a picture into something you can check, because for any edge on screen you can ask what in the document supports it.
Two related decisions follow from the same instinct. Entity standardisation merges case, stop-word and plural variants deterministically first, and only offers an optional model pass for what is left, so the cheap and reversible normalisation happens before the expensive and irreversible one. And the explorer ships a relationships panel that shows sources, alongside named communities, entity-type filters, and a shortest-path finder.
Entity typing is asked for explicitly rather than inferred from the predicate. The types are person, organization, place, event, technology, product, work, date, and concept, which is a short, usable list and produces a filter bar rather than an ontology.
The exports follow the same principle of getting you out: JSON, CSV, GraphML for three specific graph tools, and a Cypher script for one graph database. So the output is not trapped in the HTML page.
Two releases on one day, and the metadata is a minor behind
The version numbers in this repository are in a slightly odd state, and it takes thirty seconds to see it.
Two releases were published on the same day in September 2026, a minor apart. Before them, a patch from the previous December. And the project metadata, which is the file every installer reads, declares the older of the two September versions rather than the newer.
So the version your installer resolves is not the newest tag. If you pin from the metadata you are one release behind the repository's own history, and the readme's development instructions do not mention regenerating or bumping it.
That is minor, but it is the kind of thing that makes a support question hard to answer, because two people reporting the same bug will report different versions depending on how they installed.
The other detail in the same area is the test count. The development section names a hundred and seventy tests and says they need no language model, which is the same commitment as the samples: the deterministic half of the test suite runs offline.
uv sync --extra dev --extra web
uv run pytest -q
uv run ruff check .The configuration file you are told to edit is committed
The configuration is a single TOML file, which is the right shape. Two details about where it lives are worth knowing.
First, only two keys are required. Everything else has a default, and the readme prints the defaults, including a placeholder key value and a local endpoint pointing at a port on your own machine. Two optional keys are shown commented out.
Second, the file at the root of the repository is the one the commands read by default, and it is tracked by version control. The readme tells you to keep your personal settings in a file that git ignores, gives two naming patterns for it, and says you pass it with a configuration flag.
So the file you are being asked to put an endpoint and a key into is the same file that ships in the repository. Following the instruction literally means creating a second file with a different name and remembering the flag every time, rather than editing the default.
The key can also be read from an environment variable by putting an environment variable name in that field instead of a literal, which is the safer of the two options and is what all three provider examples do.
Five sample graphs, explorable with no model reachable
The quick start asks you to explore before you generate, and that ordering is deliberate.
Step two is running the local web interface against a directory of samples with a flag that opens a browser. It presents a library of five graphs, and clicking one explores it. The readme is explicit that browsing works without a reachable model; only the question panel and the new-graph form need one.
The five samples are chosen to show range rather than a single case: the industrial revolutions, one scientist, one space programme, a supply chain from farm to cup, and a building in another language. That last one is doing quiet work, because the extraction is asked for text in any language and a Spanish-language sample is the evidence.
There is also a path for people who do not want a server at all: a flag that renders a stored sample straight to a static page, one file, no local interface.
And the generated artefacts are named explicitly, which matters more than it sounds. Three files come out of one run: a self-contained interactive page, a JSON file of the triples, and a metadata file holding the community names. The middle one is the real output; the first is a viewer for it.
Three commands, three modules, and a viewer that ships as one file
The project installs three commands, and the mapping to modules is clean enough to state outright.
One generates the graph, one answers questions against it, and one serves the local web interface. Each is a separate module in the package with its own entry point, which is why the readme can describe them independently rather than as modes of one program.
The generation step accepts a document or a whole directory, and handles plain text, Markdown, reStructuredText, PDF and Word formats. The PDF and Word formats are optional extras rather than included dependencies, so the core install stays small. Large documents are split on sentence boundaries with overlap and extracted in parallel, which is the detail that decides whether this works on a book.
The viewer is the other end of the design. It is described as a single self-contained HTML file with search, click-to-highlight, a relationships panel that shows sources, named communities, entity-type filters, a shortest-path finder, exports and light and dark themes. One file, no network, no build step to view the result, which is also why the same file is what the live examples on the project's pages are.
The documentation site is rebuilt from the samples directory by a script, which means the published examples and the repository cannot drift apart.
Editorial conclusion
This suits someone with a folder of documents who wants an explorable graph this afternoon and a local model endpoint, and who cares that every edge can be traced back to a sentence. It does not suit someone building a production ontology, since the triples are model-extracted rather than curated and the inference layer is deliberately conservative. Before you use it, check three things: which model you will point it at, since the configuration needs a large token budget if that model reasons before answering and the key is read from an environment variable; whether you want the extra passes at all, given they are off by default for a stated reason; and which of the two dependency lists you install from, because the exported requirements file and the project metadata do not describe the same set of packages.
Frequently asked questions
What is a knowledge graph in AI?
In this repository, one built from unstructured text rather than loaded from an existing ontology. It takes a document, asks a language model of your choice to extract subject-predicate-object triples with entity types attached, and renders the relationships as an interactive graph. The entity types it asks the model for are person, organization, place, event, technology, product, work, date and concept.
how to build ai knowledge graph
The documented route has four steps. Install with the web extra, explore the five bundled sample graphs without a model, edit the configuration file with a model name, endpoint and key, then run the generation command against your own text. One run writes three files: a self-contained interactive HTML page, a JSON file of the extracted triples, and a metadata file of community names. The JSON file is the reusable output.
Is knowledge graph symbolic AI?
The repository does not address that framing. What it describes is a pipeline over extracted triples: deterministic merging of case, stop-word and plural variants, an optional second pass by the model for what is left, two inference passes that are off by default because they generated roughly seventy percent of all edges and hid what the text actually contained, and a chat command that answers from the generated graph with citations. Every inferred edge carries the method that produced it.
Is the knowledge graph still relevant?
The repository makes no claim about the field. It positions itself as a way to get an explorable graph out of documents you already have, with two properties it emphasises: every extracted relationship keeps the sentence it came from, and every inferred edge records its method and is capped relative to the extracted edges. It also ships five sample graphs that can be explored with no model reachable, and a viewer that is a single self-contained HTML file.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/robert-mcdermott-ai-knowledge-graph)Star history chart for your README
[](https://hysenlabs.com/projects/robert-mcdermott-ai-knowledge-graph)Was this useful?