CLI tool to create knowledge graphs from LLM-extracted world knowledge
Top 67.7% on sourcepulse
This project enables the creation of knowledge graphs from Wikipedia entities using Large Language Models (LLMs). It targets researchers and developers interested in visualizing and analyzing complex relationships, offering an automated way to extract and structure world knowledge into interactive graph formats.
How It Works
The tool leverages LLMs, configurable via LiteLLM, to extract entities and their relationships from a specified Wikipedia page. It uses customized prompts tailored to different entity types (e.g., movies, people, concepts) to guide the LLM in identifying relevant information. The extracted data is then structured into knowledge graphs, supporting formats like GraphML, GEXF, and interactive HTML visualizations via pyvis.
Quick Start & Requirements
pip install llmgraph
OPENAI_API_KEY
.llmgraph machine-learning "https://en.wikipedia.org/wiki/Artificial_intelligence" --levels 3
Highlighted Details
gpt-4o-mini
and local models via Ollama.Maintenance & Community
The project welcomes contributions via pull requests. LiteLLM updates were recently implemented.
Licensing & Compatibility
The project does not explicitly state a license in the README.
Limitations & Caveats
Prompt effectiveness is noted as best with OpenAI models; results with Llama2 are described as "ok, but not as good." Future improvements include parallelizing API calls and removing the dependency on Wikipedia as a sole source.
5 months ago
1 day