OpenPecha / RAG_chatbot_interface

0 stars 1 forks source link

RAG0012: Knowledge Graph Creation and Integration (5) #7

Open tenzin3 opened 2 weeks ago

tenzin3 commented 2 weeks ago

Description

The idea is to have a knowledge graph created per book that we can additionally use for retrieval besides the vector database. We will kickstart the knowledge graph creation with the help of LLM and decide at later stage if any automated or manual steps are required for further development.

Expected Output

A graph database that can be used for retrieval.

teny19 commented 1 week ago

Created triplets for each chapter, but uncertain whether this is the right approach. When using LLMs, we don't have control over what is identified as a node and what is identified as a relation. Some of the generated triplets don't make sense to include in a knowledge graph, e.g.:

The main issue is the lack of control over node and relation identification which would lead to time-consuming cleanup, and during deduplication process there is also risk of misleading or incorrect information being merged together.

teny19 commented 1 week ago

An alternative approach would be to first identify the entities in each chapter and look them up on Wikidata. If there is a match, we can use the properties and relations from Wikidata to create the graph. Wikidata has a list of properties used for all entities, so we could select a relevant subset and convert them to either node/relation properties or simply relations. This way we would end up with a property graph, which is more powerful since it allows storing properties at both the node and relation levels. To give an example:

Once we have a complete property graph of all the entities that appear in the book, we can still decide whether we want to extend it with the triplets generated from the LLM.