Knowledge Graph
Open-source Python notebook project that uses a local LLM to convert a text corpus into a visualized graph of concepts.
At a Glance
MIT-licensed self-hosted project that converts a text corpus into a knowledge graph; runs locally with no GPT API calls.
Engagement
Available On
Listed Oct 2026
About Knowledge Graph
Knowledge Graph is an open-source project by rahulnyk that turns a body of text, such as a PDF document, into a graph of concepts and relationships. It runs locally using Mistral 7B OpenOrca served through Ollama, so graph generation does not require calls to GPT. The output is an interactive graph visualization built with Pyvis.
What It Is
The project is a Jupyter notebook (extract_graph.ipynb) that implements a text-to-knowledge-graph pipeline. The README states it can be used for Graph Augmented Generation or knowledge-graph-based question answering. Its author chooses concepts rather than named entities as graph nodes, saying that in his experience concepts make more meaningful graphs.
How the Pipeline Works
- The text is split into chunks, each with a chunk_id.
- An LLM extracts concepts and their semantic relationships from every chunk, and each relation is given a weight (W1).
- Concepts that occur in the same chunk are treated as related by contextual proximity and given a second weight (W2).
- Duplicate pairs are grouped, their weights summed, and their relations concatenated, leaving one edge per distinct concept pair.
- Node degree is calculated to size nodes, and communities are calculated to color them.
Pandas dataframes hold the graph schema, NetworkX handles graph operations, and Pyvis renders the web-hostable JavaScript visualization.
Setup Path
The recommended install is via Docker: clone the repository, build the image, and run it exposing port 8888. Ollama must also be installed locally to host the model. The README also lists planned improvements, including embedding-based deduplication of similar concepts, filtering of redundant concepts, and a better frontend for exploring the graph.
Community Discussions
Be the first to start a conversation about Knowledge Graph
Share your experience with Knowledge Graph, ask questions, or help others learn from your insights.
Pricing
Open Source
MIT-licensed self-hosted project that converts a text corpus into a knowledge graph; runs locally with no GPT API calls.
- MIT License
- Runs locally via Docker (prerequisite: Docker)
- Uses local LLM via Ollama (Mistral 7B OpenOrca / zephyr), no calls to GPT
- Splits text into chunks and extracts concepts and relations with an LLM
- Graph building with Pandas and NetworkX
Capabilities
Key Features
- Converts a text corpus or PDF into a concept graph
- Local LLM concept and relation extraction with Mistral 7B OpenOrca via Ollama
- Text chunking with chunk IDs
- Weighted edges combining semantic relations and contextual proximity
- Node degree sizing and community coloring
- Interactive Pyvis graph visualization hostable on the web
- Docker-based local setup
