The easiest way to chat with Knowledge Graph using LLMs (python tutorial)

preview_player
Показать описание
What is knowledge graph? How to integrate it with LLMs? If you have the same question, this video is for you! I will explain start from the basic theory until how to set up Neo4J database, build a graph chain using Langchain, Python, and Gemini ( open source model) , until how to do prompting strategies to enhance our model's performance

Chapter:
00:00:00 - Intro
00:00:31 - What is Knowledge Graph?
00:02:51 - Why is it important?
00:04:28 - Workflow
00:05:23 - Code
00:06:28 - Neo4J, Google Gemini, Hugging Face set up
00:07:51 - Data Overview
00:08:30 - Insert Data to Neo4J
00:10:21 - Building a Graph Chain
00:11:50 - Evaluation 1
00:14:00 - Prompting Strategies
00:16:03 - Evaluation 2
00:16:40 - Bonus ( How to Create a Dynamic Prompt? )
00:18:07 - Outro

Everything you'll need:

References:

#llm #knowledgegraph #langchain #neo4j #python
Рекомендации по теме
Комментарии
Автор

really underappreciated. This guy has the most easy and complete explanation of the process than others.

umeshkumarasamy
Автор

Hi Geraldus - great post! I understand the approach of 'learning by example' through question/query pairs. I have a graph that contains semantics about relationships and descriptions of node attributes and labels. Why not train the LLM on the graph meta model itself?

JohnConte-lw
Автор

Nice demonstration of how performance can improve with in-context learning by providing examples of cypher queries in the prompts to gemini.

Once we figure out how conversational digital agents can work well enough as interfaces to knowledge graphs and other open data resources, we can optimize it to work on personal devices such as smartphones. Some smartphones now have 16 GB of RAM.

johnkintree
Автор

Thanks for sharing! What Python version are you using in this demo?
EDIT: I asked this question because I had some issues with python 3.9, switching to python 3.10 did the trick! ✨

EngineerMustaphaSahli
Автор

in the people query load csv with header is giving me problem. what is in data1.csv

naveenpandey
Автор

Thanks again for making this video!
I have a question: Why the correct answer is in the full context and still, the model replies with "I don't know the answer." ?! 🤔

EngineerMustaphaSahli
Автор

Thank you!, I am curious in how to make neo4j show the graph, do I need to write it or it can auto generate from my data?

framefact
Автор

very nice tutorial! By the way how can we make sure we only extract the important and relevant text from our own documents (like txt files or PDFs) to create nodes and relationships in Neo4j? I mean, PDFs often have a lot of extra stuff we don't care about.

m.tayyabkhan
Автор

Hi ! Great stuff and explanations thanks ! Do you think it is possible to the LLM to understand a non-LLM-created neo4J ? Like take any neo4j and read through it and understand it to answer questions from user ? using the same workflow ? would be awesome !

lucasmorel
Автор

16:20 - Even though the cypher queries are giving correct context (answer) - the LLM is still responding with I don't know the answer. How do we fix that?

RitiGarg