Transform unstructured text into an interactive knowledge graph using Large Language Models.
Knowledge Graph Generator is an AI-powered application that automatically extracts entities and relationships from natural language and visualizes them as an interactive graph.
Instead of manually creating graphs, users simply provide text. The application leverages LangChain's LLMGraphTransformer together with Groq's Llama 3.3 70B model to understand the document and generate a structured knowledge graph that can be explored visually.
The generated graph is fully interactive, allowing users to inspect nodes, relationships, filter entities, and understand the semantic structure hidden inside the text.
Replace
assets/demo.gifwith your own recording.
- Convert plain text into a knowledge graph
- Upload
.txtdocuments - Manual text input
- Automatic entity extraction
- Automatic relationship extraction
- Interactive graph visualization
- Relationship filtering
- Node highlighting
- Dark mode visualization
- Powered by Llama 3.3 70B
- Built with Streamlit
- Interactive PyVis network
User Input
β
ββββββββββββββββ΄βββββββββββββββ
β β
Upload TXT Paste Text
β β
ββββββββββββββββ¬βββββββββββββββ
β
Streamlit App
β
βΌ
LLMGraphTransformer
β
βΌ
Groq (Llama 3.3 70B)
β
βΌ
Entity & Relationship Extraction
β
βΌ
GraphDocument Objects
β
βΌ
PyVis Network
β
βΌ
Interactive Knowledge Graph
| Category | Technology |
|---|---|
| Language | Python |
| Frontend | Streamlit |
| LLM | Llama 3.3 70B Versatile |
| API | Groq |
| Framework | LangChain |
| Graph Extraction | LLMGraphTransformer |
| Visualization | PyVis |
| Environment | python-dotenv |
knowledge_graph_generator/
β
βββ app.py
βββ generate_knowledge_graph.py
βββ knowledge_graph.html
βββ requirements.txt
βββ .env
β
βββ README.md
The application accepts either:
- Uploaded
.txtdocument - Manual text input
β
The text is converted into a LangChain Document.
β
The document is sent to
LLMGraphTransformer
which asks
Llama 3.3 70B
to identify
- People
- Places
- Organizations
- Concepts
- Events
and the relationships connecting them.
β
The extracted nodes and edges are converted into
GraphDocument
objects.
β
PyVis generates an interactive HTML graph with
- zoom
- drag
- filters
- node selection
- relationship labels
- physics simulation
Clone the repository
git clone https://github.com/meddadaek/knowledge_graph-rag.gitGo inside
cd knowledge_graph-ragInstall dependencies
pip install -r requirements.txtCreate
.env
Add
GROQ_API_KEY=your_api_keystreamlit run app.pyThe application will open automatically in your browser.
Elon Musk founded SpaceX in 2002.
SpaceX develops reusable rockets.
NASA awarded SpaceX multiple contracts.
Elon Musk is also the CEO of Tesla.
Elon Musk
β
founded
β
SpaceX
β
develops
β
Reusable Rockets
NASA
β
awarded
β
SpaceX
Elon Musk
β
CEO
β
Tesla
Provides the interactive user interface for document upload and visualization.
Converts natural language into graph structures consisting of entities and relationships.
Executes the Llama 3.3 70B model with low latency.
Generates an interactive HTML network where users can
- zoom
- drag
- inspect nodes
- inspect edges
- filter graph components
- PDF support
- DOCX support
- Neo4j integration
- GraphRAG pipeline
- Multi-document graphs
- Export GraphML
- Export JSON
- Export Neo4j Cypher
- Search entities
- Chat with generated graph
- Multiple LLM providers
- Better node styling
- Automatic clustering
streamlit
langchain
langchain-experimental
langchain-core
langchain-groq
pyvis
python-dotenv
Machine Learning Engineer & AI Developer
GitHub
https://github.com/meddadaek
https://linkedin.com/in/aek-meddad-4967a43b4
This project is licensed under the MIT License.
β If you found this project useful, consider giving it a star.

