Repository navigation
v0.7.0
The biggest release since the project started: a hardened extraction pipeline, inference that adds knowledge instead of noise, and a completely new interactive graph explorer. The demo has been regenerated: https://robert-mcdermott.github.io/ai-knowledge-graph/
Upgrading from 0.6.x
- Install with
pip install -e .(oruv sync). The package is nowknowledge_graph; thegenerate-graphcommand is unchanged. - Python 3.11 or newer is required.
- Check your
config.tomlagainst the README:max_tokensnow defaults to 32768 (reasoning models need it),temperatureto 0.2, and rule-based transitive inference is off by default. New optional[extraction]section and[visualization]keys. - Old
.jsonoutputs still load with--from-json; new ones add entity types, source sentences and inference methods.
What's new
Extraction you can trust
- The LLM client detects truncated or empty answers, a common failure with reasoning models that spend their whole token budget thinking, and stops with an explanation instead of silently producing a near-empty graph. Retries with back-off, automatic
max_completion_tokensfallback for newer OpenAI models,env:VARAPI keys,reasoning_effort,json_modeandextra_bodypass-through. - Sentence-aware chunking, parallel chunk extraction, and an on-disk response cache: re-running the same document with the same settings makes no API calls.
- Every extracted relationship now carries entity types (person, organization, place, event, technology, product, work, date, concept) and the sentence it came from.
Inference that adds knowledge, not noise
- In testing, the old transitive and lexical rules generated about 70 % of all edges and hid the real ones. They are now opt-in and constrained.
- New LLM passes connect every isolated part of the graph to the main body and add well-known relationships between the most central entities ("internet enabled e-commerce"), plus a deterministic taxonomy rule ("quantum computing" is a "computing"). Inferred edges are capped relative to extracted ones and every one records its method.
- Communities are named by the LLM ("First Industrial Revolution Textiles", "Blockchain and Decentralized Finance").
A new explorer page
- One self-contained HTML file that works offline (PyVis is gone; vis-network is embedded).
- Click a node to highlight its neighbourhood and see every relationship with its source sentence; search with autocomplete; a shortest-path finder between any two entities; a communities panel with entity-type filters and a minimum-connections slider; edge labels for all edges, none, or only around the selection; stats, physics controls, PNG/JSON/CSV export, keyboard shortcuts, shareable
#node=links, light and dark themes, responsive layout. - Fixes the
network is not definederror, invalid vis.js options and dropped parallel edges of the old page; 20 community colours instead of 8.
More inputs and outputs
.txt,.md,.rst,.pdf(pip install "ai-knowledge-graph[pdf]") and.docx([docx]) inputs, multiple files or whole directories, andextraction.languagefor non-English documents.--export csv,graphml,cypher: GraphML for Gephi, yEd and Cytoscape, and an idempotent Neo4jMERGEscript.--from-jsonre-renders any saved graph without LLM calls;--continue-on-errorand--no-cachefor control over runs.
Under the hood
src/package layout, dependencies reduced tonetworkx,jinja2andrequests, 124 tests that need no LLM, ruff, and CI on Python 3.11–3.13.- README rewritten with a full configuration reference, provider examples and troubleshooting.
Resolved issues
#7 (non-English output), #9 (encoding errors and PDFs), #15 (gpt-5 max_completion_tokens), #17 (Gemini configuration), #18 (Neo4j export). #11 (readability) is addressed by the new explorer.
Thanks
To everyone who filed issues and opened pull requests since 0.6; most of the feedback in the tracker shaped this release.