From wall of text to web of relationships
It turns unstructured text into an interactive knowledge graph by chunking documents, extracting Subject-Predicate-Object triplets with an LLM, and stitching the results together across chunks.

What it does
It takes a plain text file, splits it into overlapping chunks, and prompts an LLM to extract Subject-Predicate-Object triplets. After the first pass, it optionally runs entity standardization to merge aliases like “AI” and “artificial intelligence,” plus relationship inference to bridge disconnected graph communities. The result is a single interactive HTML file that colors communities, sizes nodes by centrality, and distinguishes original facts from inferred connections.
The interesting bit
The value is in the cleanup passes. Chunked extraction usually leaves you with a fragmented mess of duplicate names and isolated clusters; this tool explicitly uses the LLM a second and third time to resolve entities and knit communities together. You can also point it at a local Ollama instance and keep the entire pipeline offline.
Key highlights
- Works with any OpenAI-compatible endpoint, including local models via Ollama or LM Studio
- Optional LLM-assisted entity standardization merges duplicate entities across chunks
- Optional relationship inference adds connections between disconnected graph communities
- Outputs a self-contained interactive HTML visualization with light and dark modes
- Uses NetworkX under the hood for community detection and centrality metrics
Verdict
Researchers, journalists, or developers who need to quickly map themes in long documents without building a custom NLP pipeline will get the most use out of it. If you already have clean structured data and just need a graph renderer, this is overkill.
Frequently asked
- What is robert-mcdermott/ai-knowledge-graph?
- It turns unstructured text into an interactive knowledge graph by chunking documents, extracting Subject-Predicate-Object triplets with an LLM, and stitching the results together across chunks.
- Is ai-knowledge-graph open source?
- Yes — robert-mcdermott/ai-knowledge-graph is open source, released under the Apache-2.0 license.
- What language is ai-knowledge-graph written in?
- robert-mcdermott/ai-knowledge-graph is primarily written in Python.
- How popular is ai-knowledge-graph?
- robert-mcdermott/ai-knowledge-graph has 2.5k stars on GitHub and is currently holding steady.
- Where can I find ai-knowledge-graph?
- robert-mcdermott/ai-knowledge-graph is on GitHub at https://github.com/robert-mcdermott/ai-knowledge-graph.