Introduction To Property Graphs
Key Takeaways
This video introduces property graphs, their differences from knowledge graphs, and implementations in LlamaIndex, covering graph extractors and retrievers, and demonstrating how to construct a property graph using Neo4J and LlamaIndex.
Full Transcript
hello everyone Ravi here from Lama index welcome to this video series on property graphs in this series we'll explore property graphs their differences from knowledge graphs and implementations in Lama index we'll also discuss how you can Implement property graphs using Neo 4J and llama index and we'll Implement everything U the property graphs in Lama index and with neo4j with uh M AI AMA and open source embeddings so uh this is first video uh in this series which introduces property graphs uh different extractors and how to construct a property graph and use retriever within the Lama index framework so let's get started with it let's first start uh by comparing knowledge graphs and uh property graphs and understanding its differences so as seen here knowledge graphs use a Triplex structure subject predicate and object to represent a relationship uh for example uh John is a subject and leaves in predicate SF is uh object or city right and then uh information about JN and SF is emed in these node labels right so however this structure lacks details about uh these entities like John's age or sf's population or any other properties so that's where property graphs uh will help you property graphs as a structure has nodes labels uh relationships and property is attached to each of these uh nodes or entities and for example a person and uh city are the labels here with the relationship leaves in and there are uh properties attached to each of these uh person and City for example person has a name uh John and age 30 and then city has a name SF and population 8.5 million right so uh this is uh the difference between how a property graph and knowledge graphs looks like on a broader level now let's discuss property graph construction and then quiring so there are two stages construction and quering uh the upper one is uh property graph construction and the lower one is quering stage so during uh construction uh this begins with documents and to uh graph extractors to build property graphs so there are three types of uh extractors uh implicit path extractor simple LM extractor and schema llm uh extractor so uh once property graph is constructed during wiring stage we'll use this property graph and uh graph retrievers uh there are uh four different graph retrievers llm CM retriever vctor context retriever text to cyer Retriever and uh Cipher template Retriever and uh and then pass whatever information uh we retrieved using these graph retriever for the given query to llm and generate an answer for the given query so these are the uh two stages uh the construction and quiring where we use extractors and retrievers uh to get a final answer for the Q query we'll discuss in detail about these extractors and uh Retrievers in upcoming slides so we'll start with uh graph extractors first right so I said there are three different graph extractors implicit path extractor simple llm extractor schema llm extractor we'll start with the implicit path extractor so there's a lot text Chunk e and uh it for example it divides uh uh we divided this large text into three different chunks ABC right so and then the relationship between these different chunks right B comes after a c comes after B and then a comes before b b comes before c and even um all these three chunks U have we got it from so Source text E right so all these relationships have been here so so this is how with implicit path extractor by just creating chunks and their node relationships we'll just create uh a property graph so let's look into an example on how uh it gets created so we have a large sentence let's say large text Chunk the SAT the cat sat on the M mat it was very comfortable and then the sun shown through the uh window warming the cat's for right so so uh and this Big Tex chunk is the source and we divided this big text Chunk into three different uh chunks here the cats sat on the mat and it was very comfortable and the sun Shone through the window warming the cats four right so uh the relationship it was very comfortable uh uh is coming after the cats out on the mate and even the third chunk comes after the second chunk and the first chunk come before the second chunk second chunk comes before the third chunk and these are uh belonging to the bigger uh text Chunk right so these relationships are embedded here and then a property graph is constructed accordingly then the next one is uh simple LM extractor so here given a text Chunk uh we'll use llm to extract entities and relationships so for example we have extracted three entities and there are some relationships between uh these three entities and these three entities are taken from uh Tex chunk right so they have uh mentions from uh the text Chunk so as a same example the sun shown through the window warming the cats for as it sat on the mat so we have extracted uh four entities here Sun cat window and mat right and there are relationships between these two uh four entities as well and then U these entities have been extracted from Tex Chun so those were also mentioned here right so uh that's how we'll use an llm to extract the entities and the relationships between them uh using uh uh simple LM extractor now next look into scheme LM extractor it is similar to uh simple LM extractor but it uses a predefined schema so it restricts uh what kind of entities are available what kind of relationships are available between the entities right so this is provid uh in a predefined schema and uh so LM is restricted to use this predefined schema on labels and relationships and then uh create this property graphs so since we have restricted on the mat entity and relationship so it is excluded from this property graphs so other entities and the relationships are present here unlike uh previous uh property graph so if you just examine previous one a simple LM extractor it has mat and then relationship between them right uh but in schemm extractor we have restricted that so U The Entity and the relationship is totally gone here right so uh this is how you can create schema uh property graph using schema LM extractor so you can use a single uh extractor or multiple combination of extractors to build a property graph which we'll uh look into uh during uh the implementation in further videos and after uh creating a property graph now you have to use graph retrievers uh to quy it and get an answer right so like let's look into uh different graph retrievers so the first one is llm synonym retriever so given a user query it generates synonyms for uh query terms and then um find relevant notes using exact keyword match whatever uh synonyms are created and then uh see if these synonyms are present in the property graph do extract uh exact keyword match and then uh return direct liary hood of adjacent nodes the next one is Vector context retri here we use embeddings uh to find the relevant nodes through Vector search and then uh return direct neighborhood of adjacent nodes this is simple uh Vector search uh but we create emings for the text noes and well as notes and then uh for the query and do as um cosine similarity to get the relevant nodes right the next one is uh text to Cipher so this generates Cipher statements using llm for the given query and um based on this Cipher statement you uh return the corresponding data using uh this generated Cipher and then um get an answer accordingly in Cipher template retriever uh from the user query we extract lant parameters uh based on the template already available and then run the cipher uh template which then gives uh an answer for the given query so that's all I have in the further videos we'll uh cover implementing property graphs in llama index with various extractors retrievers and neo4j using Mr LM for demonstration see you in the next video thank you
Original Description
In this video we will give an introduction to property graphs.
OUTLINE:
00:49 - Difference between knowledge graphs and property graphs
02:06 - PropertyGraph Construction
03:15 - Graph Extractors
03:27 - ImplicitPathExtractor
05:15 - SimpleLLMExtractor
06:14 - SchemaLLMExtractor
07:30 - Graph Retrievers
07:42 - LLMSynonymRetriever
08:09 - VectorContextRetriever
08:35 - Text2CypherRetriever
08:54 - CypherTemplateRetriever
Slide deck: https://docs.google.com/presentation/d/15qKwdOVoobnIuGDVN0qNl7hDO3nPwLAdETpCoBAKqfQ/edit?usp=sharing
#llms #propertygraph #knowledgegraph #mistralai #llamaindex #ai #retrieval
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from LlamaIndex · LlamaIndex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
LlamaIndex Virtual Meetup (May 4th, 2023)
LlamaIndex
LlamaIndex + MongoDB Workshop/Fireside Chat
LlamaIndex
Discover LlamaIndex: Ask Complex Queries over Multiple Documents
LlamaIndex
Discover LlamaIndex: Document Management
LlamaIndex
Discover LlamaIndex: Joint Text to SQL and Semantic Search
LlamaIndex
Discover LlamaIndex: JSON Query Engine
LlamaIndex
LlamaIndex Webinar: Active Retrieval Augmented Generation
LlamaIndex
LlamaIndex Webinar: Demonstrate-Search-Predict (DSP) with Omar Khattab
LlamaIndex
LlamaIndex Sessions: Practical challenges of building a Legal Chatbot over your PDFs
LlamaIndex
LlamaIndex Webinar: Graph Databases, Knowledge Graphs, and RAG with Wey (NebulaGraph)
LlamaIndex
LlamaIndex Webinar: Community Project Showcase (07/07/2023)
LlamaIndex
LlamaIndex Webinar: LLMs for Investment Research (with Didier Lopes, co-founder/CEO at OpenBB)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 1, LLMs and Prompts)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 2, Documents and Metadata)
LlamaIndex
Discover LlamaIndex: Key Components to build QA Systems
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 3, Evaluation)
LlamaIndex
LlamaIndex Webinar: From Prompt to Schema Engineering with Pydantic (with @jxnlco)
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 4, Embeddings)
LlamaIndex
Discover LlamaIndex: Custom Retrievers + Hybrid Search
LlamaIndex
LlamaIndex Webinar: Document Metadata and Local Models for Better, Faster Retrieval
LlamaIndex
LlamaIndex Webinar: Build Personalized AI Characters with RealChar
LlamaIndex
LlamaIndex Webinar: Make RAG Production-Ready
LlamaIndex
LlamaIndex Workshop: Building RAG with Knowledge Graphs
LlamaIndex
Discover LlamaIndex: Introduction to Data Agents for Developers
LlamaIndex
LlamaIndex Webinar: Finetuning + RAG
LlamaIndex
Discover LlamaIndex: SEC Insights, End-to-End Guide
LlamaIndex
Discover LlamaIndex: Custom Tools for Data Agents
LlamaIndex
LlamaIndex Sessions: Building a Lending Criteria Chatbot in Production
LlamaIndex
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 5, Retrievers + Node Postprocessors)
LlamaIndex
LlamaIndex Webinar: How to Win a LLM Hackathon
LlamaIndex
LlamaIndex Webinar: LLM Challenges in Production (w/ Mayo Oshin, AI Jason, Dylan from Starmorph)
LlamaIndex
LlamaIndex Webinar: Agents Showcase!
LlamaIndex
LlamaIndex Webinar: Learn about DSPy
LlamaIndex
LlamaIndex Webinar: Time-based retrieval for RAG (with Timescale)
LlamaIndex
LlamaIndex Webinar: Build/Break/Test LLM Apps Showcase (co-hosted with TrueEra, Pinecone)
LlamaIndex
LlamaIndex Workshop: Evaluation-Driven Development (EDD)
LlamaIndex
LlamaIndex Webinar: Building LLM Apps for Production, Part 1 (co-hosted with Anyscale)
LlamaIndex
LlamaIndex Webinar: Learn about Fine-tuning + RAG (w/ Victoria Lin, author of RA-DIT)
LlamaIndex
LlamaIndex Webinar: What's next for AI after OpenAI Dev Day?
LlamaIndex
Introducing create-llama
LlamaIndex
LlamaIndex Webinar: PrivateGPT - Production RAG with Local Models
LlamaIndex
Multi-modal Retrieval Augmented Generation with LlamaIndex
LlamaIndex
LlamaIndex Webinar: LLaVa Deep Dive
LlamaIndex
A deep dive into Retrieval-Augmented Generation with Llamaindex
LlamaIndex
LlamaIndex Workshop: Multimodal + Advanced RAG Workhop with Gemini
LlamaIndex
LlamaIndex Webinar: Efficient Parallel Function Calling Agents with LLMCompiler
LlamaIndex
Introduction to Query Pipelines (Building Advanced RAG, Part 1)
LlamaIndex
LLMs for Advanced Question-Answering over Tabular/CSV/SQL Data (Building Advanced RAG, Part 2)
LlamaIndex
LlamaIndex Webinar: Advanced Tabular Data Understanding with LLMs
LlamaIndex
Ollama X LlamaIndex Multi-Modal
LlamaIndex
Build Agents from Scratch (Building Advanced RAG, Part 3)
LlamaIndex
LlamaIndex Webinar: Build No-Code RAG with Flowise
LlamaIndex
LlamaIndex Sessions: Practical Tips and Tricks for Productionizing RAG (feat. Sisil @ Jasper)
LlamaIndex
Introduction to LlamaIndex v0.10
LlamaIndex
Build SELF-DISCOVER from Scratch with LlamaIndex
LlamaIndex
Introducing LlamaCloud (and LlamaParse)
LlamaIndex
LlamaIndex Sessions: 12 RAG Pain Points and Solutions
LlamaIndex
LlamaIndex Webinar: RAG Beyond Basic Chatbots
LlamaIndex
A Comprehensive Cookbook for Claude 3
LlamaIndex
LlamaIndex Webinar: RAPTOR - Tree-Structured Indexing and Retrieval
LlamaIndex
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
Google Is Winning the AI Race and Losing Its Business Model at the Same Time
Medium · AI
China Just Overtook America on the Only Metric That Predicts Who Builds the Future
Medium · AI
AI Will Not Save You from Thinking: Why Polymathy Is Becoming the Real Career Advantage
Medium · AI
The Apple Intelligence Compromise: Why China is Forcing Apple to Use Local AI Models
Medium · AI
Chapters (11)
0:49
Difference between knowledge graphs and property graphs
2:06
PropertyGraph Construction
3:15
Graph Extractors
3:27
ImplicitPathExtractor
5:15
SimpleLLMExtractor
6:14
SchemaLLMExtractor
7:30
Graph Retrievers
7:42
LLMSynonymRetriever
8:09
VectorContextRetriever
8:35
Text2CypherRetriever
8:54
CypherTemplateRetriever
🎓
Tutor Explanation
DeepCamp AI