Find answers from the community

Updated 11 months ago

Hi Logan, I built a neo4j graph database

Hi Logan, I built a neo4j graph database separately from using the KnowledgeGraphIndex so I inserted all the cypher on my own. Now I want to use a SubQuestionQueryEngine to merge a VectorStoreIndex and my graph store, but the documentation says I have to pass query engines. But as far as I understand it, I need to use the KnowledgeGraphRAGRetriever to access my graph database. Can I use a retriever as a tool for SubQuestionQueryEngine? If I need to pass a query engine, is there an easy way I can use my existing graph data to populate an Index? PS. I know you're refactoring the knowledge graph stuff so can wait until that is released. Thanks kindly!
L
t
8 comments
You can take the retriever and put it into a RetrieverQueryEngine
Plain Text
from llama_index.query_engine import RetrieverQueryEngine

query_engine = RetrieverQueryEngine.from_args(kg_retriever, service_context=service_context)
ok cool, thanks. I'll give it a try πŸ˜„
Can we use the TokenCountingHandler class with the KnowledgeGraphRAGRetriever? I tried to implement it and got an error back:
WARNING Error in retrieving from nl2graphquery: 'CompletionUsage' object has retrievers.py:790 no attribute 'get'
hmmm what version of llama-index do you have?
Version: 0.9.22
I think this is fixed if you updade (I hope anyways, that token counter is a pain lol)
hahaha. up until now i haven't been paying that much attention to tokens but I need to at least put an estimate to various costs to run this thing πŸ˜‚
Add a reply
Sign up and join the conversation on Discord