Find answers from the community

Updated 3 months ago

hi I am new to llamaindex Is there any

hi I am new to llamaindex. Is there any example of directly import a KG-like json file into GPTKnowledgeGraphIndex? i.e. manually construct GPTKnowledgeGraphIndex.

I have searched related infos: the only related example I found is GPTKnowledgeGraphIndex.from_documents(), but I wonder is it necessary to construct it only by specifying index_struct, in that case there will be no docstore, will it impact the result of index.query()?
L
k
2 comments
Every index needs a docstore, so you can't specify without it

You can insert your own triplets according to this notebook: https://github.com/jerryjliu/llama_index/blob/main/examples/knowledge_graph/KnowledgeGraphDemo.ipynb

However, you'll notice each set of triplets requires a Node object. This is because the default behvior is to map triplets to the chunk of text they were extracted from

Then at query time, it either uses both the triplets and their associated text to generate an answer include_text=True or you can use only the triplets with include_text=False
Thank you very much, very helpful!
Add a reply
Sign up and join the conversation on Discord