LLM Knowledge Graph Builder
LLM Knowledge Graph Builder
11/02/25, 16:20
Search Write
160 2
Introduction
We built, open-sourced, and hosted the LLM Knowledge Graph Builder to
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 1 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
let you try out better ways of treating your unstructured data. We
preprocess documents, transcripts, web articles, and more sources into
chunks, compute text embeddings, and connect them (lexical graph).
But we don’t stop there. We also extract entities and their relationships,
which is especially relevant if you ingest multiple documents because you
can relate the pieces spread out over multiple sources (entity graph).
Since we launched the LLM Knowledge Graph Builder in June 2024, we’ve
had an impressive amount of usage and great feedback from users. It’s
now the fourth most popular source of user interaction on AuraDB Free,
which makes us really happy.
We did a release in fall 2024, but there were too many AI events, which
took most of my time to write a blog post. Over the past few months, the
team worked on really nice features — some of which we want to
introduce today in the first release of 2025.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 2 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
knowledge hidden inside those in a structured way and then use those
entities and their relationships to better chat with your data?
3. Generates text embeddings for vector search and connects the most
similar ones
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 3 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Neo4jconnection
@neo4j+s://91183536.databases.neo4.10:/68/
Drag&Drop
Orbrowse
InspectGeneratedGraphfromGoogle_DeepMin
•Wearevisualizing50chunksatatime
Documents,Images,Unstructured
•Document&Chunk Entities Communities
WebSources
Data Science).
GCS
IMModes
Openaigpt...
GenerateGraph Preview
LLMModelusedforExtraction&Chat
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 4 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
New Features
Let’s dive into the new features. The main ones are generating
Community Summaries and new local and global retrievers for it, as well
as the new ability of running multiple retrievers in parallel for your
questions and evaluating them. You can now also guide the extraction
with custom prompt instructions.
More Models
In development mode or in self-deployment, we tested and configured
the LLM Knowledge Graph Builder with a plethora of new models, which
we also hint at in the production version:
Qwen 2.5
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 5 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Groq
Llama 3.x
Ollama models
We also test the models internally for integration testing and to see how
well they work for extraction.
Test results for different LLM extractions with entity counts and runtimes
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 6 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Community Summaries
One way you can improve the richness of the graph representing your
documents is by running graph algorithms to extract additional
information hidden in the graph structure.
Microsoft did that last year with the “From local to global — Query
Focused Summarization GraphRAG” paper. They used a hierarchical
graph clustering algorithm (Leiden) on the extracted entity domain
graph. This algorithm identifies clusters of closely related entities. An
LLM then summarizes their content into community summary nodes,
which represent the information in that set of entities and relationships.
Due to the hierarchical results, this can be done on multiple levels going
from very fine-grained to the highest level.
A more detailed blog post on evaluation will be available later in the series.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 7 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
InspectGeneratedGraphfromGoogle_DeepMind.pdf
•Wearevisualizing50chunksatatime
Document&Chunk Entities VCommunities
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 8 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
TopicCluster
TopicCluster
TopicCluster
TopicCluster
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 9 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Since we can now run multiple retrievers in parallel, you can see the
difference for yourself. Check out the global and local entity retrievers
comparison.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 10 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Both retrievers, like all the others, allow showing the retrieved contextual
graph data (communities, entities, chunks) that went into generating the
answer, supporting explainability.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 11 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
The chunks and documents from where the entities were extracted
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 12 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
collect {
UNWIND nodes AS n
MATCH (n)<-[:HAS_ENTITY]->(c:Chunk)
WITH c, count(distinct n) AS freq
RETURN c
ORDER BY freq DESC
LIMIT 3
} AS chunks,
collect {
UNWIND nodes AS n
OPTIONAL MATCH (n)-[:IN_COMMUNITY]->(c:__Community__)
WITH c, c.community_rank AS rank, c.weight AS weight
RETURN c
ORDER BY rank, weight DESC
LIMIT 3
} AS communities,
collect {
UNWIND nodes AS n
UNWIND nodes AS m
MATCH (n)-[r]->(m)
RETURN DISTINCT r
} AS rels,
collect {
UNWIND nodes AS n
MATCH path = (n)-[r]-(m:__Entity__)
WHERE NOT m IN nodes
WITH m, collect(distinct r) AS rels, count(*) AS freq
ORDER BY freq DESC
LIMIT 10
WITH collect(m) AS outsideNodes, apoc.coll.flatten(collect(rels)) AS rels
RETURN { nodes: outsideNodes, rels: rels }
} AS outside
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 13 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
For the entity retriever, we can show not only text chunks but also the
entities and their retrieved relationships.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 14 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Multi-Retrievers
As shown in the previous section, you can now select one or more
retrievers run in parallel to generate an answer to your question and
switch between the answer results directly to compare.
completely
Vector
Utilizesvectorindexingontextchunksto
enablesemanticsimilaritysearch.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 15 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Fulltext
Employsafulltextindexontextchunksfor
rapidkeyword-basedsearch,efficiently
identifyingdocumentscontainingspecific
wordsorphrases.
Graph+Vector+Fulltext
Mergesvectorindexing,graphconnections,
andfulltextindexingforacomprehensive
searchapproach,combiningsemantic
similarity,contextualrelevance,andkeyword-
basedsearchforoptimalresults.
Entitysearch+Vector
Combinesentitynodevectorindexingwith
graphconnectionsforaccurateentity-based
search,providingthemostrelevantresponse.
•Selected
Globalsearch+Vector+Fulltext
Usevectorandfull-textindexingon
communitynodestoprovideaccurate,
context-awareanswersglobally.
•Selected
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 16 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
In the Details link after each answer, the retriever also provides the
contextual facts retrieved from the database, which are then sent to the
LLM, as well as additional information about the model, runtime, and
token counts.
Retriever Evaluation
One reason for the parallel retriever evaluation was adding the ability to
generate evaluation metrics.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 17 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Retriever evaluation
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 18 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
There will be a more detailed blog post on evaluation later in the series.
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 19 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Graph Consolidation
An experimental feature is automatic graph consolidation, intended for
users who just quickly want to see an extracted knowledge graph from
their data but don’t want to specify a graph schema upfront.
In those cases, the LLM often generates a load of entity types and
relationships — counting into the thousands if you give it free rein. Our
retrievers don’t mind because they use the graph topology, not the actual
type, to traverse the graph (although they collect them together with the
textual information).
Summary
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 20 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
If you haven’t yet, please try it out and let us know what you think in the
comments. We’d also be excited if you wrote about your experiences
using the tool for different sets of documents of different domains.
Please share if you have questions or feedback. Also, please give us a star
if you like the project.
Happy building!
Developer Experience
Responses (2)
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 22 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Responses (2)
Vishwajeet
2 hours ago
Hi, Thanks for the great article. I have also seen a great article on
https://www.mraiengineer.com/2025/02/reinforce-simple-and-efficient-approach.html
Reply
Matt
17 hours ago
Reply
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 23 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
In Neo4j Developer Blog by Tomaz Bratanic In Neo4j Developer Blog by Michael Hunger
See all from Michael Hunger See all from Neo4j Developer Blog
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 24 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Lists
Productivity
244 stories · 674 saves
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 25 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 26 di 27
LLM Knowledge Graph Builder — First Release of 2025 | by Michael Hunger | Neo4j Developer Blog | Feb, 2025 | Medium 11/02/25, 16:20
Help Status About Careers Press Blog Privacy Terms Text to speech Teams
https://medium.com/neo4j/llm-knowledge-graph-builder-first-release-of-2025-532828c4ba76 Pagina 27 di 27