Problem defining Knowledge Graph schema using LlamaIndex

143 views Asked by At

Im using llamaIndex to generate a knowledge graph based on unstructured data. I want to define the KG output, things such as Node types, Relationship types, etc. Based on the Llamaindex docs, I dont really see a way to do this. They have code that looks like this which i've successfully used for my project:

`
graph_store = Neo4jGraphStore(
username=username,
password=password,
url=url,
database=database,
)

storage_context = StorageContext.from_defaults(graph_store=graph_store)

# NOTE: can take a while!
index = KnowledgeGraphIndex.from_documents(
    documents,
    storage_context=storage_context,
    max_triplets_per_chunk=2,
)

`

However, I can't find a way to define the KG schema. I was thinking I could initialize my own KG since that is possible in llamaindex but then im not sure how I would populate it using the documents. Any advice/help would be appreciated, thanks!

0

There are 0 answers