Loading video...

Video Failed to Load

Go Home

New package + paper drop 📄 - Introducing KGGen – a simple library to transform unstructured text into knowledge graphs. Text is abundant, but good knowledge graphs are scarce. Feed it raw text, and KGGen generates a structured network of entities and relationships. (1/7)

11,121 views • 1 year ago •via X (Twitter)

16 Comments

Belinda's profile picture
Belinda1 year ago

We tried several existing text-to-knowledge graph generation tools and found they didn’t perform very well. So we built KGGen and a new benchmark, Measure of Information in Nodes & Edges (MINE). Paper: Install: `pip install kg-gen` (2/7)

Belinda's profile picture
Belinda1 year ago

KGGen uses an LLM-driven, multi-stage pipeline to improve graph sparsity issues: 1. Extract entities & relations 2. Aggregate info across multiple docs 3. Cluster entities and relations based on semantic similarity (e.g. "Supplier A LLC" and "Supplier-A" are 1 node) (3/7)

Belinda's profile picture
Belinda1 year ago

We compare KGGen to OpenIE and GraphRAG on MINE, a benchmark to evaluate how well a text-to-KG extractor captures information. We use 100 documents with ~15 key facts each, and check if those facts appear in the generated KGs. On the MINE benchmark, KGGen captured ~66% of the key facts on average, while GraphRAG managed ~48% and OpenIE only ~30%​. (there is still a ways to go!) (4/7)

Belinda's profile picture
Belinda1 year ago

Why is this important? Well, knowledge graphs may be used: - To assist with RAG (Retrieval-Augmented Generation) - For multi-hop question answering - As data for model training and testing - To visualize the relationships between concepts in your source text In particular, graph RAG is an increasingly useful way to retrieve contextually relevant information. It is however limited by the completeness of the knowledge graph. If you look at human-curated datasets like WikiGraphs, you may see that they take a long time to craft and are usually are missing relations. (5/7)

Belinda's profile picture
Belinda1 year ago

You can see in the video that we cluster similar nodes and edges respectively, which helps with curating a denser, richer graph. e.g. “strength”, “strong”, “strengths” are treated as one node. This compression is contextual! You may pass in a context string to `kg-gen` to describe your clustering criteria (6/7)

Belinda's profile picture
Belinda1 year ago

with @JoshuaK92829 @KyssenYu @proudmpala @sanmikoyejo and others! Github: tl;dr, KGGen turns text dumps into useful knowledge! The result is richer, cleaner KGs for powering tasks like question answering, knowledge base completion, or retrieval-augmented generation. (7/7)

Belinda's profile picture
Belinda1 year ago

@KyssenYu @proudmpala @sanmikoyejo and special thanks to Lisa Yu for making the video!

Alex Graveley's profile picture
Alex Graveley1 year ago

Thoughts on KG normalization across many entities, beyond what can fit in a context window?

Belinda's profile picture
Belinda1 year ago

I think a hierarchical approach could work! So it is localized step by step

Esther is a confused human being's profile picture
Esther is a confused human being1 year ago

so cute omg! but I want your voice

Julian Alvarez's profile picture
Julian Alvarez1 year ago

this is super cool, congrats on shipping this, excited to try it out!

darin's profile picture
darin1 year ago

hey, did you guys happen to compile the dspy program by any chance?

Tilman Bayer's profile picture
Tilman Bayer1 year ago

@threadreaderapp compile if you don't mind

Petr Glaser's profile picture
Petr Glaser1 year ago

What about comparison with Graphiti from Zep AI?

Reshef's profile picture
Reshef1 year ago

Super cool use of LLM-as-an-engine. Is this enabled by growing context windows, that weren't possible before?

Belinda's profile picture
Belinda1 year ago

that helps for sure

Related Videos

Build better RAG by letting a team of agents extract and connect your reference materials into a knowledge graph. Our new short course, “Agentic Knowledge Graph Construction,” taught by Neo4j Innovation Lead Andreas Kollegger, shows you how. Knowledge graphs are an important way to store information accurately but they are a lot of work to build manually. In this course you’ll learn how to build a team of agents that turn data– in this case product reviews and invoices from suppliers–into structured graphs of entities and relationships for RAG. Learn how agents can automatically handle the time-consuming work of building graphs — extracting entities and relationships (e.g., Product "contains" Assembly, Part "supplied_by" Supplier, Customer review "mentions" Product), deduplicating them, fact-checking them, and committing them to a graph database — so your retrieval system can find right information to generate accurate output. For example, you can use agents to help trace customer complaints directly to specific suppliers, manufacturing processes, and product hierarchies, thus turning fragmented information into queryable business intelligence. Skills you’ll gain: - Build, store, and access knowledge graphs using the Neo4j graph database - Build multi-agent systems using Google’s Agent Development Kit (ADK) - Set up a loop of agentic workflows to propose and refine a graph schema through fact-checking - Connect agent-generated graphs of unstructured and structured data into a unified knowledge graph This course gets into the practicum of why knowledge graphs give more accurate information retrieval than vector search alone, especially for high-stakes applications where precision matters more than fuzzy similarity matching. Sign up here:

Andrew Ng

169,184 views • 1 year ago