Building Property Graphs With LlamaIndex

LlamaIndex · Beginner ·🧠 Large Language Models ·1y ago

Key Takeaways

This video demonstrates building Property Graphs with LlamaIndex, including setup, construction, visualization, querying, and storage using Chroma VectorStore. It covers the use of LLMs, embeddings, and default extractors and retrievers.

Full Transcript

hello Ravi here from llama index welcome to another video in this tutorial series on uh property graphs so in this video we'll demonstrate the property graph uh index uh in Lama index uh so we'll start with implementing property graph using uh default extractors and retrievers and then on your given document and then once the construction is done we'll uh start quering with default retrievers so we'll use M uh llm and embeddings for this uh notebook so let's get started with it so before going forward you need to install these packages Lama index core package and then for llm Mr llm you need to install Lama index llm Mr and then Lama index Tings Mr uh I have already installed it so you don't so I'll not be running through this cell um and then next you need to set up the API key M AP key right and we'll use Mr Large latest llm and then embedding model as well and then you need to download the data right so yeah um once you download the data you load it using simple directory reader and then we'll start creating the property graph index so we pass the documents llm embedding model and create it so this uses the default implicit path extractor and then uh simple LM extractor to uh build a property graph if you don't customize it we'll see in the next video or notebook how you can customize the extractor as well as retriever but for this part we'll go with the simple implementation of using the default ones so uh this creates the index and then uh basically it passes the documents into noes and once you have the notes you send it to llm with a prompt which we'll uh see in the next video how the prompts look like and how you can customize it to generate uh these parts like these part parts are like um knowledge graphs triplets right so once uh you have the triplets you have uh implicit you can extract the implicit Parts as well uh which is by using node relationships which you have seen in the previous video on the introduction to property graphs and then generate the embeddings so here we create embeddings for both text nodes as well as uh nodes that's the reason you see uh the generating embeddings two times okay okay yeah and then once uh this is done you can save the index and you can actually view it so let me open it so this will take I think yeah it's getting loaded so this is the graph Total Property graph and then you can actually look into it like your different noes right the speaker author then right you can actually polygram so you can explore uh the YC explore this uh uh graph um once you save it right so once you have it you basically set the llm and embedding model here and uh during uh once uh uh property graph is constructed you get into quering Stage right so the default one uh uses two uh types of retrieval which is synonym or keyword extraction from uh from the query using llm and then Vector retrieval once these notes are retrieved yeah um you can actually just use the tripat retrieved or you can use both tripletes and the source text as well uh for to the to send it to M and get an answer from it so you can actually include this parameter include text equal to false or true based on um whether you want to just retrieve the text or whether you just want to retrieve triplets sorry just retrieve triplets or whether you want to retrieve both triplets and text Source text so let's uh run through an example here what happened at inter leaf and web web so these are the triplets that have been uh retrieved for the the given uh query right so you can experiment different queries and then uh for the query engine uh you can have uh create this Square engine index. as Square engine that used we used to do with rack pipeline as well so and as an experiment we'll include the text along with the source text along with the uh triplets so then we can get a response accordingly and yeah so interl Pam has done some things and uh here we have received response for other stuff as well so yeah so this is how you build uh uh property graph and then start querying as a retriever as a query engine and get uh answers accordingly and then uh we can save the uh what our index we have created and load the index and uh uh create a query engine and run the same query again so here is it so it uh saves loads and then uh creates a query engine on top of it yeah uh we got the same answer again right so this is how we can build index and save load and uh create the same index again right so then we'll see how you can use use a vector store for uh storing these embeddings right so here uh we are using chroma Vector store you need to install Alex Vector stores chroma and then um yeah create a collection out of it and so while building property graph you s documents llm embedding model what is a property graph store which is simple property graph store and then chroma Vector store right and then say purchase it locally so this will create a extract the parts implicit parts and then generate embeddings right and then create the uh index property graph index once you have the index created and saved you can load it back and uh create uh air engine and get a response for it yeah it's almost done uh embedding generation is the last part so yeah this is done so let's uh load the index create query engine and what did other do at YC is the query yeah so the other was heavily involved in YC and where other tasks he did at YC so this is how uh you can create a property graph uh construct a property graph and uh retrieve and Quire it and then store it and load it again and quy it again and even you can use a vector store as well to uh while creating property graph index and load it back again and start querying so that's all I have for this video uh see you in the next video with different tutorial thank you

Original Description

In this video, we will explore building Property Graphs with LlamaIndex. OUTLINE: 00:00 - Introduction 00:32 - Setup 01:15 - PropertyGraphIndex Construction 02:45 - Visualize PropertyGraph 03:33 - Querying Stage 04:02 - Retriever 04:35 - QueryEngine 05:21 - Storage 05:59 - Using Chroma VectorStore cookbook - https://github.com/mistralai/cookbook/blob/main/third_party/LlamaIndex/propertygraphs/property_graph.ipynb #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 LlamaIndex Virtual Meetup (May 4th, 2023)
LlamaIndex Virtual Meetup (May 4th, 2023)
LlamaIndex
2 LlamaIndex + MongoDB Workshop/Fireside Chat
LlamaIndex + MongoDB Workshop/Fireside Chat
LlamaIndex
3 Discover LlamaIndex: Ask Complex Queries over Multiple Documents
Discover LlamaIndex: Ask Complex Queries over Multiple Documents
LlamaIndex
4 Discover LlamaIndex: Document Management
Discover LlamaIndex: Document Management
LlamaIndex
5 Discover LlamaIndex: Joint Text to SQL and Semantic Search
Discover LlamaIndex: Joint Text to SQL and Semantic Search
LlamaIndex
6 Discover LlamaIndex: JSON Query Engine
Discover LlamaIndex: JSON Query Engine
LlamaIndex
7 LlamaIndex Webinar: Active Retrieval Augmented Generation
LlamaIndex Webinar: Active Retrieval Augmented Generation
LlamaIndex
8 LlamaIndex Webinar: Demonstrate-Search-Predict (DSP) with Omar Khattab
LlamaIndex Webinar: Demonstrate-Search-Predict (DSP) with Omar Khattab
LlamaIndex
9 LlamaIndex Sessions: Practical challenges of building a Legal Chatbot over your PDFs
LlamaIndex Sessions: Practical challenges of building a Legal Chatbot over your PDFs
LlamaIndex
10 LlamaIndex Webinar: Graph Databases, Knowledge Graphs, and RAG with Wey (NebulaGraph)
LlamaIndex Webinar: Graph Databases, Knowledge Graphs, and RAG with Wey (NebulaGraph)
LlamaIndex
11 LlamaIndex Webinar: Community Project Showcase (07/07/2023)
LlamaIndex Webinar: Community Project Showcase (07/07/2023)
LlamaIndex
12 LlamaIndex Webinar: LLMs for Investment Research (with Didier Lopes, co-founder/CEO at OpenBB)
LlamaIndex Webinar: LLMs for Investment Research (with Didier Lopes, co-founder/CEO at OpenBB)
LlamaIndex
13 Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 1, LLMs and Prompts)
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 1, LLMs and Prompts)
LlamaIndex
14 Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 2, Documents and Metadata)
Discover LlamaIndex: Bottoms-Up Development With LLMs (Part 2, Documents and Metadata)
LlamaIndex
15 Discover LlamaIndex: Key Components to build QA Systems
Discover LlamaIndex: Key Components to build QA Systems
LlamaIndex
16 Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 3, Evaluation)
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 3, Evaluation)
LlamaIndex
17 LlamaIndex Webinar: From Prompt to Schema Engineering with Pydantic  (with @jxnlco)
LlamaIndex Webinar: From Prompt to Schema Engineering with Pydantic (with @jxnlco)
LlamaIndex
18 Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 4, Embeddings)
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 4, Embeddings)
LlamaIndex
19 Discover LlamaIndex: Custom Retrievers + Hybrid Search
Discover LlamaIndex: Custom Retrievers + Hybrid Search
LlamaIndex
20 LlamaIndex Webinar: Document Metadata and Local Models for Better, Faster Retrieval
LlamaIndex Webinar: Document Metadata and Local Models for Better, Faster Retrieval
LlamaIndex
21 LlamaIndex Webinar: Build Personalized AI Characters with RealChar
LlamaIndex Webinar: Build Personalized AI Characters with RealChar
LlamaIndex
22 LlamaIndex Webinar: Make RAG Production-Ready
LlamaIndex Webinar: Make RAG Production-Ready
LlamaIndex
23 LlamaIndex Workshop: Building RAG with Knowledge Graphs
LlamaIndex Workshop: Building RAG with Knowledge Graphs
LlamaIndex
24 Discover LlamaIndex: Introduction to Data Agents for Developers
Discover LlamaIndex: Introduction to Data Agents for Developers
LlamaIndex
25 LlamaIndex Webinar: Finetuning + RAG
LlamaIndex Webinar: Finetuning + RAG
LlamaIndex
26 Discover LlamaIndex: SEC Insights, End-to-End Guide
Discover LlamaIndex: SEC Insights, End-to-End Guide
LlamaIndex
27 Discover LlamaIndex: Custom Tools for Data Agents
Discover LlamaIndex: Custom Tools for Data Agents
LlamaIndex
28 LlamaIndex Sessions: Building a Lending Criteria Chatbot in Production
LlamaIndex Sessions: Building a Lending Criteria Chatbot in Production
LlamaIndex
29 Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 5, Retrievers + Node Postprocessors)
Discover LlamaIndex: Bottoms-Up Development with LLMs (Part 5, Retrievers + Node Postprocessors)
LlamaIndex
30 LlamaIndex Webinar: How to Win a LLM Hackathon
LlamaIndex Webinar: How to Win a LLM Hackathon
LlamaIndex
31 LlamaIndex Webinar: LLM Challenges in Production (w/ Mayo Oshin, AI Jason, Dylan from Starmorph)
LlamaIndex Webinar: LLM Challenges in Production (w/ Mayo Oshin, AI Jason, Dylan from Starmorph)
LlamaIndex
32 LlamaIndex Webinar: Agents Showcase!
LlamaIndex Webinar: Agents Showcase!
LlamaIndex
33 LlamaIndex Webinar: Learn about DSPy
LlamaIndex Webinar: Learn about DSPy
LlamaIndex
34 LlamaIndex Webinar: Time-based retrieval for RAG (with Timescale)
LlamaIndex Webinar: Time-based retrieval for RAG (with Timescale)
LlamaIndex
35 LlamaIndex Webinar: Build/Break/Test LLM Apps Showcase (co-hosted with TrueEra, Pinecone)
LlamaIndex Webinar: Build/Break/Test LLM Apps Showcase (co-hosted with TrueEra, Pinecone)
LlamaIndex
36 LlamaIndex Workshop: Evaluation-Driven Development (EDD)
LlamaIndex Workshop: Evaluation-Driven Development (EDD)
LlamaIndex
37 LlamaIndex Webinar: Building LLM Apps for Production, Part 1 (co-hosted with Anyscale)
LlamaIndex Webinar: Building LLM Apps for Production, Part 1 (co-hosted with Anyscale)
LlamaIndex
38 LlamaIndex Webinar: Learn about Fine-tuning + RAG (w/ Victoria Lin, author of RA-DIT)
LlamaIndex Webinar: Learn about Fine-tuning + RAG (w/ Victoria Lin, author of RA-DIT)
LlamaIndex
39 LlamaIndex Webinar: What's next for AI after OpenAI Dev Day?
LlamaIndex Webinar: What's next for AI after OpenAI Dev Day?
LlamaIndex
40 Introducing create-llama
Introducing create-llama
LlamaIndex
41 LlamaIndex Webinar: PrivateGPT - Production RAG with Local Models
LlamaIndex Webinar: PrivateGPT - Production RAG with Local Models
LlamaIndex
42 Multi-modal Retrieval Augmented Generation with LlamaIndex
Multi-modal Retrieval Augmented Generation with LlamaIndex
LlamaIndex
43 LlamaIndex Webinar: LLaVa Deep Dive
LlamaIndex Webinar: LLaVa Deep Dive
LlamaIndex
44 A deep dive into Retrieval-Augmented Generation with Llamaindex
A deep dive into Retrieval-Augmented Generation with Llamaindex
LlamaIndex
45 LlamaIndex Workshop: Multimodal + Advanced RAG Workhop with Gemini
LlamaIndex Workshop: Multimodal + Advanced RAG Workhop with Gemini
LlamaIndex
46 LlamaIndex Webinar: Efficient Parallel Function Calling Agents with LLMCompiler
LlamaIndex Webinar: Efficient Parallel Function Calling Agents with LLMCompiler
LlamaIndex
47 Introduction to Query Pipelines (Building Advanced RAG, Part 1)
Introduction to Query Pipelines (Building Advanced RAG, Part 1)
LlamaIndex
48 LLMs for Advanced Question-Answering over Tabular/CSV/SQL Data (Building Advanced RAG, Part 2)
LLMs for Advanced Question-Answering over Tabular/CSV/SQL Data (Building Advanced RAG, Part 2)
LlamaIndex
49 LlamaIndex Webinar: Advanced Tabular Data Understanding with LLMs
LlamaIndex Webinar: Advanced Tabular Data Understanding with LLMs
LlamaIndex
50 Ollama X LlamaIndex Multi-Modal
Ollama X LlamaIndex Multi-Modal
LlamaIndex
51 Build Agents from Scratch (Building Advanced RAG, Part 3)
Build Agents from Scratch (Building Advanced RAG, Part 3)
LlamaIndex
52 LlamaIndex Webinar: Build No-Code RAG with Flowise
LlamaIndex Webinar: Build No-Code RAG with Flowise
LlamaIndex
53 LlamaIndex Sessions: Practical Tips and Tricks for Productionizing RAG (feat. Sisil @ Jasper)
LlamaIndex Sessions: Practical Tips and Tricks for Productionizing RAG (feat. Sisil @ Jasper)
LlamaIndex
54 Introduction to LlamaIndex v0.10
Introduction to LlamaIndex v0.10
LlamaIndex
55 Build SELF-DISCOVER from Scratch with LlamaIndex
Build SELF-DISCOVER from Scratch with LlamaIndex
LlamaIndex
56 Introducing LlamaCloud (and LlamaParse)
Introducing LlamaCloud (and LlamaParse)
LlamaIndex
57 LlamaIndex Sessions: 12 RAG Pain Points and Solutions
LlamaIndex Sessions: 12 RAG Pain Points and Solutions
LlamaIndex
58 LlamaIndex Webinar: RAG Beyond Basic Chatbots
LlamaIndex Webinar: RAG Beyond Basic Chatbots
LlamaIndex
59 A Comprehensive Cookbook for Claude 3
A Comprehensive Cookbook for Claude 3
LlamaIndex
60 LlamaIndex Webinar: RAPTOR - Tree-Structured Indexing and Retrieval
LlamaIndex Webinar: RAPTOR - Tree-Structured Indexing and Retrieval
LlamaIndex

This video teaches how to build Property Graphs with LlamaIndex, including setup, construction, visualization, querying, and storage. It covers the use of LLMs, embeddings, and default extractors and retrievers, and demonstrates how to use Chroma VectorStore for storing embeddings.

Key Takeaways
  1. Install LlamaIndex core package and LLM package
  2. Set up API key and download data
  3. Create Property Graph index using default extractors and retrievers
  4. Visualize Property Graph
  5. Query Property Graph using default retriever and query engine
  6. Store embeddings using Chroma VectorStore
  7. Load saved index and create query engine
💡 Using Chroma VectorStore for storing embeddings can improve the efficiency of querying Property Graphs

Related Reads

Chapters (9)

Introduction
0:32 Setup
1:15 PropertyGraphIndex Construction
2:45 Visualize PropertyGraph
3:33 Querying Stage
4:02 Retriever
4:35 QueryEngine
5:21 Storage
5:59 Using Chroma VectorStore
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →