The community members are discussing the feasibility of using the PropertyGraphIndex in Llama Index to load an existing Neo4j graph and also leverage a vector store. Some community members believe this is not fully possible, as the graph store and vector store are strongly coupled. Others suggest that using existing graphs is difficult due to the reliance on a certain structure, and that Text2Cypher retrieval may be the only viable option.
One community member, Logan M, inquires about the coupling between the graph and vector store, and whether it is possible to create a hybrid retriever that incorporates both a vector store and Text2Cypher. The response indicates that the two are tightly coupled, as you need to embed and store references to nodes in the knowledge graph, and then swap the references for the actual data when retrieving.
Another community member shares that they emailed Tomaz Bratanic, who suggested that if you have an existing index, you can use the Neo4JPGStore and create an index from an existing knowledge graph using PropertyGraphIndex.from_existing(). However, it's unclear how the embeddings would work in this scenario if the goal is to create a vector store with VectorContextRetriever.
The community members discuss the challenges of working with an existing graph, as the Llama Index retriever expects certain
If I already have an existing neo4j graph. can i use the PropertyGraphIndex to load the neo4j graph but also leverage a vector store as well? The examples online dont show how this would work with a graph created outside llama index
@Logan M what do you mean that the graph and vector store are strongly coupled? so if i wanted to create a hybrid retriever that incorporates both a vector store and text2cypher - this isnt possible with llama index?
You need to embed and store references to nodes that exist in your KG. Then when retrieving, you can swap the reference for the actual data from the KG, and do any traversal from there (getting triplets or shortest paths)
Im curious how else you think it could work at a technical level?
He said if i have an existing index i can call the Neo4JPGStore and create an index from an existing KG using PropertyGraphIndex.from_existing()…
Apparently it works with a predefined schema and the retriever expects entities with label Entity and embedding property?
Its unclear to me when the embeddings come in though if im trying to create a vector store with VectorContextRetriever from an existing knowledge graph..
Yea it expects those labels, which is why I thought an existing graph wouldn't work easily 🤷♂️ You can definitely try it
Like I mentioned for embeddings, you'd have to embed your existing graph, and theres no utils for doing that right now, so you'd have to do that manually