robert-mcdermott/ai-knowledge-graph

AI Powered Knowledge Graph Generator

What it solves

This project automates the process of turning unstructured text documents into structured, interactive knowledge graphs. It eliminates the manual effort of identifying entities and their relationships within a text, allowing users to visualize complex connections and query the resulting data using an LLM.

How it works

The system follows a multi-phase pipeline:

  1. Extraction: It splits input text (PDF, DOCX, Markdown, etc.) into chunks and uses an LLM to extract Subject-Predicate-Object (SPO) triplets, including entity types (e.g., person, organization, technology).
  2. Standardization: It merges variants of the same entity (e.g., handling case or plurals) using deterministic rules and an optional LLM pass.
  3. Inference: It uses LLM-based bridging and hub enrichment, along with taxonomy rules, to connect isolated parts of the graph and add well-known relationships.
  4. Visualization & Querying: It generates a self-contained HTML file for interactive exploration. Users can also use a graph-chat command or a local web server (graph-serve) to ask questions that are answered using only the facts stored in the graph.

Who it’s for

  • Researchers and analysts who need to map out complex relationships in large sets of documents.
  • Users who want a visual, traceable way to explore knowledge extracted from text.
  • Developers looking for a tool to convert unstructured text into formats like JSON, CSV, GraphML, or Cypher for Neo4j.

Highlights

  • Broad Input Support: Handles .txt, .md, .rst, .pdf, and .docx files in any language.
  • Traceable Answers: The chat feature provides grounded answers with citations to the original source sentences or the inference method used.
  • Flexible LLM Integration: Works with any OpenAI-compatible endpoint, including local options like Ollama and LM Studio.
  • Interactive Explorer: Produces a standalone HTML file with search, community detection, and shortest-path finding.

Related

  • Project
  • Project
  • Project
  • Project