Find answers from the community

Updated 2 months ago

Hi, I'm using Llama_index Property Graph

Hi, I'm using Llama_index Property Graph Index to generate a Knowledge Graph from a document. I use the code below to generate the graph.
Plain Text
index = PropertyGraphIndex.from_documents(
    documents,
    llm=llm,
    embed_model=ollama_embedding,
    show_progress=True,
)

I'm trying to get all nodes from the generated KG but can only find how to query a specific topic using retriever. Are there any ways I can retrieve all the nodes and relationships?
L
p
2 comments
If you are using the default graph store, you can use some underlying low-level functions

index.property_graph_store.graph.nodes will get all kg nodes

index.property_graph_store.graph.relations will get all relations

If you were using neo4j or nebula, I would just use cypher
Add a reply
Sign up and join the conversation on Discord