Find answers from the community

s
F
Y
a
P
Updated last month

If I already have an existing neo4j

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
L
a
8 comments
I don't think its fully possible tbh -- the graph store and vector store are strongly coupled.

Maybe there is some way, it would be pretty manual
Using exisiting graphs is hard becasue we kind of rely on a certain structure. Text2Cypher retrieval is the only one that would work I think
@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?
They are pretty coupled.

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?
So I emailed Tomaz Bratanic about this.

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
@Logan M Gotcha thanks a lot for the help!
Add a reply
Sign up and join the conversation on Discord