use precomputed embeddings to create Propertygraph index #19066
Replies: 1 comment
-
LlamaIndex's PropertyGraphIndex always recomputes embeddings for nodes when you build the index, even if you provide precomputed embeddings in your TextNode objects—there's no built-in way to skip this step or use your own embeddings directly without modifying the code. The embed_kg_nodes parameter only controls whether embeddings are generated, not whether precomputed ones are used; disabling it will skip embedding entirely, but then your precomputed values are ignored as well reference. When using PropertyGraphIndex.from_existing() with a separate vector store, empty responses usually mean the vector store isn't properly storing or retrieving both text and embeddings, or the node IDs between your graph and vector store don't match. For example, FaissVectorStore by default doesn't store text, which can break retrieval reference. You'd need a custom vector store that stores both text and embeddings and ensures ID consistency. Currently, to use precomputed embeddings, you would need to either (a) extend the PropertyGraphIndex code to check for and use existing embeddings on nodes, or (b) build a custom vector store that you populate directly with your nodes and embeddings, then use that for retrieval (but this may not integrate seamlessly with PropertyGraphIndex's higher-level features) reference. Let me know if you want pointers on how to extend the code or set up a custom vector store for your use case. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an existing property graph for which I have created embeddings for every triplet. I have a created a text node for every triplet and added the corresponding embedding. I would like to create an index based on this but could not find a way without using the default kg_extractors. For example,
This command by default creates embeddings again - how to skip this step?, I tried creating vector store separately and then use it with PropertyGraphIndex.from_exising() but that failed as well - empty responses for questions. What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions