SlideShare a Scribd company logo
© 2022 Neo4j, Inc. All rights reserved.
1
Knowledge-graph-based chatbot
By Tomaž Bratanič
About me
Tomaž Bratanič - Graph & LLM enthusiast Author of:
● https://bratanic-tomaz.medium.com/
● https://twitter.com/tb_tomaz
● https://github.com/tomasonjo
● bratanic.tomaz@gmail.com
Special discount code for 40% off: ctwnodes40
http://mng.bz/vPnM
© 2022 Neo4j, Inc. All rights reserved.
3
LLMs are great, but:
• Knowledge
cutoff date
• Hallucinations
• Lack of
information
source
• Lack of
domain-specific
or private
information
© 2022 Neo4j, Inc. All rights reserved.
4
● Generating training
data is hard and
expensive
● Doesn’t solve
knowledge cutoff
issue, only pushed
it to a later date
● No data sources
● Hard to debug, is
the information
coming from
foundation training
set or from fine-
tuning set or is it
hallucinated?
Supervised fine-tuning an LLM
From Google documentations
© 2022 Neo4j, Inc. All rights reserved.
5
● Providing relevant
context in prompt
● Avoid relying on
facts provided by
LLMs
● Increased
transparency due to
provided sources
● The answer is as
good as the
provided context
Retrieval-augmented generation
(in-context passing)
Retrieval-augmented generation (in-context passing) flow
Chat with your PDF application
Vector similarity search
Given a question, find the most relevant documents based on a similarity metric (such as
Cosine Similarity) between vector of the question and vectors of contents.
Moving from keyword search to similarity (semantic) search.
Q: what is text
embedding?
abstractId similarity
456 0.923445
22 0.892114
… ...
Top K by similarity
Vector index in Neo4j - Added in 5.11
Define vector index Query vector index
Chat with your PDF - GenAI Stack
https://github.com/docker/genai-stack
PDF Input
User question
Generated answer
Chat with your PDF - GenAI Stack
https://github.com/docker/genai-stack
Neo4j LLM integrations with
LangChain and LlamaIndex can get
you started in less than 5 minutes
13
Knowledge graphs
Go beyond unstructured text in your LLM applications
© 2022 Neo4j, Inc. All rights reserved.
14
● Consists of nodes
and relationships
● Nodes are used to
represent entities,
concepts, and more
● Relationships
describe the
context and how it
is connected to
other nodes
Knowledge graph
Retrieval-augmented generation flow for structured
information using generated Cypher statements
https://towardsdatascience.com/langchain-has-added-cypher-search-cb9d821120d5
© 2022 Neo4j, Inc. All rights reserved.
16
● Pass the schema
information to LLM
along with the
question to
generate a
database query
● Can be enhanced
by providing
specific query
examples in the
prompt
Using LLMs to generate queries
Few-shot example for Cypher generation
Also useful for
translating domain-
specific lingo to
Cypher
Answer generating chain
Giving an LLM presentation
with a pop quiz at the end.
© 2022 Neo4j, Inc. All rights reserved.
19
● Using vector or full
text index to map
values or entities
from the user
question to
database property
values
● Using vector
similarity search to
find most relevant
few-shot cypher
examples allows
you to scale to
more examples
Introducing dynamic prompting
https://github.com/tomasonjo/streamlit-neo4j-hackathon
Multi-hop question answering
Take for example the following question:
Did any of the former OpenAI employees start
their own company?
Could be broken into two sub questions:
● Who are the former employees of OpenAI?
● Did any of them start their own company?
Typical recommendation is to use vector similarity
search in combination with agents
© 2022 Neo4j, Inc. All rights reserved.
21
Potential problems
● Repeated information
in the top N
documents
● Hard to define ideal
N number of
retrieved documents
● Potentially a lot of
steps in the question
generation process
Multi-hop question answering
© 2022 Neo4j, Inc. All rights reserved.
22
● Move the bulk work
from query time to
ingestion time
● Don’t worry about
repeated
information
● Don’t worry about
determining the
ideal K number of
retrieved
documents
Multi-hop question answering - a
better way
https://blog.langchain.dev/constructing-knowledge-graphs-from-text-using-openai-functions/
Real-time analytics with
knowledge graph
Take for example the following question:
How many new customers we had last week?
Which services depend indirectly on the
authorization service?
Vector similarity search doesn’t natively
handle aggregations, transformation,
graph analytics, etc…
However, a graph database like Neo4j
offers a vast possibility of traditional and
graph analytics through the use of the
graph-based structured query language
Cypher and Graph Data Science plugin
© 2022 Neo4j, Inc. All rights reserved.
24
● Which products will
be affected if
particular system
goes down?
● Who owns a
particular system?
● Are there any active
systems that are
not part of a
product (could be
deprecated)?
● Are there any
existing tasks
related to particular
bug in authorization
service?
Real-time analytics - Microservices
(dev-ops) graph
https://blog.langchain.dev/using-a-knowledge-graph-to-implement-a-devops-rag-application/
© 2022 Neo4j, Inc. All rights reserved.
25
● Future of LLM
applications is the
combination of
structured and
unstructured data
● Explicit links
between structured
and unstructured
information give the
ability to perform
complex “metadata”
filtering
Combining structured and
unstructured information
Unstructured data
Questions
Tomaž Bratanič - Graph & LLM enthusiast Author of:
Book raffle:
https://forms.gle/HKWAaSnmzawYtVqr6
● https://bratanic-tomaz.medium.com/
● https://twitter.com/tb_tomaz
● https://github.com/tomasonjo
● bratanic.tomaz@gmail.com
Special discount code for 40% off: ctwnodes40

More Related Content

What's hot

ChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scaleChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scale
Maxim Salnikov
 
Building, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for ProductionBuilding, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for Production
Sri Ambati
 
Best Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI ServiceBest Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI Service
Kumton Suttiraksiri
 
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
DataScienceConferenc1
 
presentation.pdf
presentation.pdfpresentation.pdf
presentation.pdf
caa28steve
 
Let's talk about GPT: A crash course in Generative AI for researchers
Let's talk about GPT: A crash course in Generative AI for researchersLet's talk about GPT: A crash course in Generative AI for researchers
Let's talk about GPT: A crash course in Generative AI for researchers
Steven Van Vaerenbergh
 
An introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging FaceAn introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging Face
Julien SIMON
 
Generative AI: Past, Present, and Future – A Practitioner's Perspective
Generative AI: Past, Present, and Future – A Practitioner's PerspectiveGenerative AI: Past, Present, and Future – A Practitioner's Perspective
Generative AI: Past, Present, and Future – A Practitioner's Perspective
Huahai Yang
 
Mother of Language`s Langchain
Mother of Language`s LangchainMother of Language`s Langchain
Mother of Language`s Langchain
Jun-hang Lee
 
Google Vertex AI
Google Vertex AIGoogle Vertex AI
Google Vertex AI
VikasBisoi
 
Unlocking the Power of ChatGPT
Unlocking the Power of ChatGPTUnlocking the Power of ChatGPT
Unlocking the Power of ChatGPT
Kristine Schachinger SEO and Online Marketing
 
AzureOpenAI.pptx
AzureOpenAI.pptxAzureOpenAI.pptx
AzureOpenAI.pptx
Udaiappa Ramachandran
 
LLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage
 
Generative AI How It's Changing Our World and What It Means for You_final.pdf
Generative AI How It's Changing Our World and What It Means for You_final.pdfGenerative AI How It's Changing Our World and What It Means for You_final.pdf
Generative AI How It's Changing Our World and What It Means for You_final.pdf
Diego López-de-Ipiña González-de-Artaza
 
How Does Generative AI Actually Work? (a quick semi-technical introduction to...
How Does Generative AI Actually Work? (a quick semi-technical introduction to...How Does Generative AI Actually Work? (a quick semi-technical introduction to...
How Does Generative AI Actually Work? (a quick semi-technical introduction to...
ssuser4edc93
 
Gen AI Cognizant & AWS event presentation_12 Oct.pdf
Gen AI Cognizant & AWS event presentation_12 Oct.pdfGen AI Cognizant & AWS event presentation_12 Oct.pdf
Gen AI Cognizant & AWS event presentation_12 Oct.pdf
PhilipBasford
 
The current state of generative AI
The current state of generative AIThe current state of generative AI
The current state of generative AI
Benjaminlapid1
 
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdfGlobal Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
Aroh Shukla
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
DianaGray10
 
ChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptxChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptx
Jesus Rodriguez
 

What's hot (20)

ChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scaleChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scale
 
Building, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for ProductionBuilding, Evaluating, and Optimizing your RAG App for Production
Building, Evaluating, and Optimizing your RAG App for Production
 
Best Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI ServiceBest Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI Service
 
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
[DSC Europe 23] Marcel Tkacik - Augmented Retrieval Products with GAI models
 
presentation.pdf
presentation.pdfpresentation.pdf
presentation.pdf
 
Let's talk about GPT: A crash course in Generative AI for researchers
Let's talk about GPT: A crash course in Generative AI for researchersLet's talk about GPT: A crash course in Generative AI for researchers
Let's talk about GPT: A crash course in Generative AI for researchers
 
An introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging FaceAn introduction to computer vision with Hugging Face
An introduction to computer vision with Hugging Face
 
Generative AI: Past, Present, and Future – A Practitioner's Perspective
Generative AI: Past, Present, and Future – A Practitioner's PerspectiveGenerative AI: Past, Present, and Future – A Practitioner's Perspective
Generative AI: Past, Present, and Future – A Practitioner's Perspective
 
Mother of Language`s Langchain
Mother of Language`s LangchainMother of Language`s Langchain
Mother of Language`s Langchain
 
Google Vertex AI
Google Vertex AIGoogle Vertex AI
Google Vertex AI
 
Unlocking the Power of ChatGPT
Unlocking the Power of ChatGPTUnlocking the Power of ChatGPT
Unlocking the Power of ChatGPT
 
AzureOpenAI.pptx
AzureOpenAI.pptxAzureOpenAI.pptx
AzureOpenAI.pptx
 
LLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
 
Generative AI How It's Changing Our World and What It Means for You_final.pdf
Generative AI How It's Changing Our World and What It Means for You_final.pdfGenerative AI How It's Changing Our World and What It Means for You_final.pdf
Generative AI How It's Changing Our World and What It Means for You_final.pdf
 
How Does Generative AI Actually Work? (a quick semi-technical introduction to...
How Does Generative AI Actually Work? (a quick semi-technical introduction to...How Does Generative AI Actually Work? (a quick semi-technical introduction to...
How Does Generative AI Actually Work? (a quick semi-technical introduction to...
 
Gen AI Cognizant & AWS event presentation_12 Oct.pdf
Gen AI Cognizant & AWS event presentation_12 Oct.pdfGen AI Cognizant & AWS event presentation_12 Oct.pdf
Gen AI Cognizant & AWS event presentation_12 Oct.pdf
 
The current state of generative AI
The current state of generative AIThe current state of generative AI
The current state of generative AI
 
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdfGlobal Azure Bootcamp Pune 2023 -  Lead the AI era with Microsoft Azure.pdf
Global Azure Bootcamp Pune 2023 - Lead the AI era with Microsoft Azure.pdf
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
 
ChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptxChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptx
 

Similar to Nodes 2023 - Knowledge graph based chatbot.pptx

The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
Neo4j
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Neo4j
 
Graph Data Science at Scale
Graph Data Science at ScaleGraph Data Science at Scale
Graph Data Science at Scale
Neo4j
 
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
Neo4j
 
btNOG 10: Preparing for IPv6 implementation using AI
btNOG 10: Preparing for IPv6 implementation using AIbtNOG 10: Preparing for IPv6 implementation using AI
btNOG 10: Preparing for IPv6 implementation using AI
APNIC
 
Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)
Nikhil Garg
 
Amsterdam - The Neo4j Graph Data Platform Today & Tomorrow
Amsterdam - The Neo4j Graph Data Platform Today & TomorrowAmsterdam - The Neo4j Graph Data Platform Today & Tomorrow
Amsterdam - The Neo4j Graph Data Platform Today & Tomorrow
Neo4j
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
Walid Shaari
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
MLconf
 
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptxNeo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j
 
GPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge GraphGPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge Graph
Neo4j
 
On the Road to Shangri-La: Scaling CD from Teams to the Enterprise
On the Road to Shangri-La: Scaling CD from Teams to the EnterpriseOn the Road to Shangri-La: Scaling CD from Teams to the Enterprise
On the Road to Shangri-La: Scaling CD from Teams to the Enterprise
XebiaLabs
 
raph Databases with Neo4j – Emil Eifrem
raph Databases with Neo4j – Emil Eifremraph Databases with Neo4j – Emil Eifrem
raph Databases with Neo4j – Emil Eifrem
buildacloud
 
The Data Platform for Today's Intelligent Applications.pdf
The Data Platform for Today's Intelligent Applications.pdfThe Data Platform for Today's Intelligent Applications.pdf
The Data Platform for Today's Intelligent Applications.pdf
Neo4j
 
Nordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
Nordics Edition - The Neo4j Graph Data Platform Today & TomorrowNordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
Nordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
Neo4j
 
Data Versioning and Reproducible ML with DVC and MLflow
Data Versioning and Reproducible ML with DVC and MLflowData Versioning and Reproducible ML with DVC and MLflow
Data Versioning and Reproducible ML with DVC and MLflow
Databricks
 
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4jBuilding Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
Neo4j
 
"You don't need a bigger boat": serverless MLOps for reasonable companies
"You don't need a bigger boat": serverless MLOps for reasonable companies"You don't need a bigger boat": serverless MLOps for reasonable companies
"You don't need a bigger boat": serverless MLOps for reasonable companies
Data Science Milan
 
Data Science Meets DevOps: GitOps with OpenShift (1).pdf
Data Science Meets DevOps: GitOps with OpenShift (1).pdfData Science Meets DevOps: GitOps with OpenShift (1).pdf
Data Science Meets DevOps: GitOps with OpenShift (1).pdf
HemaVeeradhi1
 

Similar to Nodes 2023 - Knowledge graph based chatbot.pptx (20)

The Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
Graph Data Science at Scale
Graph Data Science at ScaleGraph Data Science at Scale
Graph Data Science at Scale
 
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
The perfect couple: Uniting Large Language Models and Knowledge Graphs for En...
 
btNOG 10: Preparing for IPv6 implementation using AI
btNOG 10: Preparing for IPv6 implementation using AIbtNOG 10: Preparing for IPv6 implementation using AI
btNOG 10: Preparing for IPv6 implementation using AI
 
Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)Building A Machine Learning Platform At Quora (1)
Building A Machine Learning Platform At Quora (1)
 
Amsterdam - The Neo4j Graph Data Platform Today & Tomorrow
Amsterdam - The Neo4j Graph Data Platform Today & TomorrowAmsterdam - The Neo4j Graph Data Platform Today & Tomorrow
Amsterdam - The Neo4j Graph Data Platform Today & Tomorrow
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
 
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
Nikhil Garg, Engineering Manager, Quora at MLconf SF 2016
 
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptxNeo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
 
GPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge GraphGPT and Graph Data Science to power your Knowledge Graph
GPT and Graph Data Science to power your Knowledge Graph
 
On the Road to Shangri-La: Scaling CD from Teams to the Enterprise
On the Road to Shangri-La: Scaling CD from Teams to the EnterpriseOn the Road to Shangri-La: Scaling CD from Teams to the Enterprise
On the Road to Shangri-La: Scaling CD from Teams to the Enterprise
 
raph Databases with Neo4j – Emil Eifrem
raph Databases with Neo4j – Emil Eifremraph Databases with Neo4j – Emil Eifrem
raph Databases with Neo4j – Emil Eifrem
 
The Data Platform for Today's Intelligent Applications.pdf
The Data Platform for Today's Intelligent Applications.pdfThe Data Platform for Today's Intelligent Applications.pdf
The Data Platform for Today's Intelligent Applications.pdf
 
Nordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
Nordics Edition - The Neo4j Graph Data Platform Today & TomorrowNordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
Nordics Edition - The Neo4j Graph Data Platform Today & Tomorrow
 
Data Versioning and Reproducible ML with DVC and MLflow
Data Versioning and Reproducible ML with DVC and MLflowData Versioning and Reproducible ML with DVC and MLflow
Data Versioning and Reproducible ML with DVC and MLflow
 
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4jBuilding Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
Building Intelligent Solutions with Graphs, Stefan Kolmar, Neo4j
 
"You don't need a bigger boat": serverless MLOps for reasonable companies
"You don't need a bigger boat": serverless MLOps for reasonable companies"You don't need a bigger boat": serverless MLOps for reasonable companies
"You don't need a bigger boat": serverless MLOps for reasonable companies
 
Data Science Meets DevOps: GitOps with OpenShift (1).pdf
Data Science Meets DevOps: GitOps with OpenShift (1).pdfData Science Meets DevOps: GitOps with OpenShift (1).pdf
Data Science Meets DevOps: GitOps with OpenShift (1).pdf
 

Recently uploaded

What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
aisafed42
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 

Recently uploaded (20)

What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 

Nodes 2023 - Knowledge graph based chatbot.pptx

  • 1. © 2022 Neo4j, Inc. All rights reserved. 1 Knowledge-graph-based chatbot By Tomaž Bratanič
  • 2. About me Tomaž Bratanič - Graph & LLM enthusiast Author of: ● https://bratanic-tomaz.medium.com/ ● https://twitter.com/tb_tomaz ● https://github.com/tomasonjo ● bratanic.tomaz@gmail.com Special discount code for 40% off: ctwnodes40 http://mng.bz/vPnM
  • 3. © 2022 Neo4j, Inc. All rights reserved. 3 LLMs are great, but: • Knowledge cutoff date • Hallucinations • Lack of information source • Lack of domain-specific or private information
  • 4. © 2022 Neo4j, Inc. All rights reserved. 4 ● Generating training data is hard and expensive ● Doesn’t solve knowledge cutoff issue, only pushed it to a later date ● No data sources ● Hard to debug, is the information coming from foundation training set or from fine- tuning set or is it hallucinated? Supervised fine-tuning an LLM From Google documentations
  • 5. © 2022 Neo4j, Inc. All rights reserved. 5 ● Providing relevant context in prompt ● Avoid relying on facts provided by LLMs ● Increased transparency due to provided sources ● The answer is as good as the provided context Retrieval-augmented generation (in-context passing)
  • 7. Chat with your PDF application
  • 8. Vector similarity search Given a question, find the most relevant documents based on a similarity metric (such as Cosine Similarity) between vector of the question and vectors of contents. Moving from keyword search to similarity (semantic) search. Q: what is text embedding? abstractId similarity 456 0.923445 22 0.892114 … ... Top K by similarity
  • 9. Vector index in Neo4j - Added in 5.11 Define vector index Query vector index
  • 10. Chat with your PDF - GenAI Stack https://github.com/docker/genai-stack PDF Input User question Generated answer
  • 11. Chat with your PDF - GenAI Stack https://github.com/docker/genai-stack Neo4j LLM integrations with LangChain and LlamaIndex can get you started in less than 5 minutes
  • 12.
  • 13. 13 Knowledge graphs Go beyond unstructured text in your LLM applications
  • 14. © 2022 Neo4j, Inc. All rights reserved. 14 ● Consists of nodes and relationships ● Nodes are used to represent entities, concepts, and more ● Relationships describe the context and how it is connected to other nodes Knowledge graph
  • 15. Retrieval-augmented generation flow for structured information using generated Cypher statements https://towardsdatascience.com/langchain-has-added-cypher-search-cb9d821120d5
  • 16. © 2022 Neo4j, Inc. All rights reserved. 16 ● Pass the schema information to LLM along with the question to generate a database query ● Can be enhanced by providing specific query examples in the prompt Using LLMs to generate queries
  • 17. Few-shot example for Cypher generation Also useful for translating domain- specific lingo to Cypher
  • 18. Answer generating chain Giving an LLM presentation with a pop quiz at the end.
  • 19. © 2022 Neo4j, Inc. All rights reserved. 19 ● Using vector or full text index to map values or entities from the user question to database property values ● Using vector similarity search to find most relevant few-shot cypher examples allows you to scale to more examples Introducing dynamic prompting https://github.com/tomasonjo/streamlit-neo4j-hackathon
  • 20. Multi-hop question answering Take for example the following question: Did any of the former OpenAI employees start their own company? Could be broken into two sub questions: ● Who are the former employees of OpenAI? ● Did any of them start their own company? Typical recommendation is to use vector similarity search in combination with agents
  • 21. © 2022 Neo4j, Inc. All rights reserved. 21 Potential problems ● Repeated information in the top N documents ● Hard to define ideal N number of retrieved documents ● Potentially a lot of steps in the question generation process Multi-hop question answering
  • 22. © 2022 Neo4j, Inc. All rights reserved. 22 ● Move the bulk work from query time to ingestion time ● Don’t worry about repeated information ● Don’t worry about determining the ideal K number of retrieved documents Multi-hop question answering - a better way https://blog.langchain.dev/constructing-knowledge-graphs-from-text-using-openai-functions/
  • 23. Real-time analytics with knowledge graph Take for example the following question: How many new customers we had last week? Which services depend indirectly on the authorization service? Vector similarity search doesn’t natively handle aggregations, transformation, graph analytics, etc… However, a graph database like Neo4j offers a vast possibility of traditional and graph analytics through the use of the graph-based structured query language Cypher and Graph Data Science plugin
  • 24. © 2022 Neo4j, Inc. All rights reserved. 24 ● Which products will be affected if particular system goes down? ● Who owns a particular system? ● Are there any active systems that are not part of a product (could be deprecated)? ● Are there any existing tasks related to particular bug in authorization service? Real-time analytics - Microservices (dev-ops) graph https://blog.langchain.dev/using-a-knowledge-graph-to-implement-a-devops-rag-application/
  • 25. © 2022 Neo4j, Inc. All rights reserved. 25 ● Future of LLM applications is the combination of structured and unstructured data ● Explicit links between structured and unstructured information give the ability to perform complex “metadata” filtering Combining structured and unstructured information Unstructured data
  • 26. Questions Tomaž Bratanič - Graph & LLM enthusiast Author of: Book raffle: https://forms.gle/HKWAaSnmzawYtVqr6 ● https://bratanic-tomaz.medium.com/ ● https://twitter.com/tb_tomaz ● https://github.com/tomasonjo ● bratanic.tomaz@gmail.com Special discount code for 40% off: ctwnodes40